Browse Source

Merge pull request #5 from dahak-metagenomics/fix-instructions

Fix instructions
master
Charles Reid 7 years ago committed by GitHub
parent
commit
2236075b6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      README.md
  2. 32
      TODO.md
  3. 4
      bootstrap.sh
  4. 2
      cloud_init/cloud_init.sh
  5. 63
      tasks_sudo/install_singularity.py
  6. 2
      tasks_user/gen_ssh_keys.sh

13
README.md

@ -47,7 +47,7 @@ To run the sudo init script, which calls several other scripts, run: @@ -47,7 +47,7 @@ To run the sudo init script, which calls several other scripts, run:
```
# as the sudo user:
$PWD/sudo_init/sudo_init.sh
$PWD/tasks_sudo/sudo_init.sh
```
### Step 3: Run User Init Script
@ -56,10 +56,10 @@ To run the user init script, run: @@ -56,10 +56,10 @@ To run the user init script, run:
```
# as the regular dahak user,
$PWD/sudo_init/sudo_init.sh
$PWD/tasks_user/user_init.sh
# or if you are still sudo,
sudo -H -i -u dahak $PWD/sudo_init/sudo_init.sh
sudo -H -i -u dahak $PWD/tasks_user/user_init.sh
```
## Using the Dotfiles
@ -95,3 +95,10 @@ git config --global user.name "$GIT_AUTHOR_NAME" @@ -95,3 +95,10 @@ git config --global user.name "$GIT_AUTHOR_NAME"
git config --global user.email "$GIT_AUTHOR_EMAIL"
```
Note that if you are pushing to Github, you should add the private key
from your AWS node (which is located at `$HOME/.ssh/id_rsa.pub`) to
your list of authorized public keys in your Github account settings page.

32
TODO.md

@ -1,32 +0,0 @@ @@ -1,32 +0,0 @@
stupid stupid stupid stupid stupid stupid ssh key problems
- key is owned by root for some unknown reason
```
Load key "/home/ubuntu/.ssh/id_rsa": Permission denied
```
docker:
- docker is not installed
- with and without docker? (short cloud-init url at charlesreid1.com?)
- add user to docker group
- add user to sudo group
- etc etc
dotfile problems:
- git s does not work
- stupid "back" being inserted when I do ctrl+b
- arrow keys in vim - already mentioned.
vim syntax:
- .rule, .settings, and .snakefile and etc - syntax highlight with snakemake highlights, add .vim to repo
- left arrow right arrow in insert mode inserts C
vim helpers:
- syntax highlighting ok
- need better helpers and bundling
dotfile repo organization:
- allows adding color schemes
- separate common dotfile components for each machine into components
- submodules is definitely the way to go here.

4
bootstrap.sh

@ -10,15 +10,13 @@ git pull origin master; @@ -10,15 +10,13 @@ git pull origin master;
function doIt() {
rsync \
--exclude ".git/" \
--exclude "bootstrap.sh" \
--exclude "cloud_init" \
--exclude "img" \
--exclude "gen_ssh_keys.sh" \
--exclude "tasks_sudo" \
--exclude "tasks_user" \
--exclude "LICENSE" \
--exclude "README.md" \
--exclude "TODO.md" \
--exclude "LICENSE" \
-avh --no-perms . ~;
source ~/.bash_profile;
}

2
cloud_init/cloud_init.sh

@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
# python, snakemake, and singularity.)
#
# Run as a one-shot installer:
# bash <( curl https://raw.githubusercontent.com/charlesreid1/dahak-yeti/master/cloud_init/cloud_init.sh )
# bash <( curl https://raw.githubusercontent.com/dahak-metagenomics/dahak-yeti/master/cloud_init/cloud_init.sh )
set -x
# ubuntu AMI provides this non-root user by default :)

63
tasks_sudo/install_singularity.py

@ -1,63 +0,0 @@ @@ -1,63 +0,0 @@
#!/usr/bin/env python3
import getpass
import os, sys
import subprocess
def install_singularity_the_slightly_easier_way():
user = getpass.getuser()
if(user!="root"):
raise Exception("You are not root - this script requires root (or write access to /usr/local).")
else:
print("Installing singularity...")
#############################
# Prerequisites
print(" - installing libarchive-devel")
aptlibarchive = ["apt-get","install","-y","libarchive-dev"]
keyupdateproc = subprocess.call(aptlibarchive)
#############################
# Singularity
version = "2.5.1"
print(" - downloading singularity")
tarurl = "https://github.com/singularityware/singularity/releases/download/{version}/singularity-{version}.tar.gz".format(version=version)
wgetcmd = ["wget",tarurl]
subprocess.call(wgetcmd)
print(" - unpacking singularity")
tarcmd = ["tar","xvf","singularity-{version}.tar.gz".format(version=version)]
subprocess.call(tarcmd)
print(" - configuring singularity")
singularity_dir = "singularity-{version}".format(version=version)
configurecmd = ["./configure","--prefix=/usr/local"]
subprocess.call(configurecmd, cwd=singularity_dir)
print(" - making singularity")
makecmd = ["make"]
subprocess.call(makecmd, cwd=singularity_dir)
print(" - installing singularity")
makeinstallcmd = ["make","install"]
subprocess.call(makeinstallcmd, cwd=singularity_dir)
print(" - removing singularity")
rmtar = ["rm","-rf","singularity-{version}.tar.gz".format(version=version)]
subprocess.call(rmtar)
rmdir = ["rm","-rf","singularity-{version}".format(version=version)]
subprocess.call(rmdir)
print(" ~~*~~ ~~*~~ ~~*~~ SUCCESS! ~~*~~ ~~*~~ ~~*~~\n")
print(" Singularity is now installed.")
print()
if __name__=="__main__":
install_singularity_the_slightly_easier_way()

2
tasks_user/gen_ssh_keys.sh

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
#
# create ssh keys for the user in $HOME/.ssh/id_rsa
ssh-keygen -t rsa -N '' -b 4096 -f /home/ubuntu/.ssh/id_rsa -C "charlesreid1@gmail.com"
ssh-keygen -t rsa -N '' -b 4096 -f $HOME/.ssh/id_rsa -C "charlesreid1@gmail.com"
chmod 700 $HOME/.ssh
touch $HOME/.ssh/authorized_keys
chmod 600 $HOME/.ssh/authorized_keys

Loading…
Cancel
Save