Skip to content

Commit

Permalink
Working on resolving issue #17
Browse files Browse the repository at this point in the history
  • Loading branch information
tbooth committed May 9, 2022
1 parent a0d093c commit 2ec6f61
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 271 deletions.
41 changes: 19 additions & 22 deletions files/ansible_playbook_ec2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
#
# If other VMs are running then you'll need to do something smarter.
#
- hosts: training_vm
- hosts: tag_Role_training_snakemake
become: yes
become_user: training
tasks:

- name: Set alternative password for VNC
vars:
passwd: "ed-dash-vnc"
become_user: training
shell:
executable: /bin/bash
chdir: /home/training/.vnc
chdir: ~/.vnc
cmd: |
set -euo pipefail
cd ~
mv passwd passwd.old
echo '{{ passwd }}' | /opt/tigervnc/usr/bin/vncpasswd -f > passwd
chmod 0600 passwd
args:
creates: /home/training/.vnc/passwd.old
creates: ~/.vnc/passwd.old
when: false # rule is disabled for now

# This one runs as root. The conda-forge versions of these packages are problematic
Expand All @@ -47,69 +47,66 @@
- name: Fetch Miniconda Installer
get_url:
url: https://repo.anaconda.com/miniconda/Miniconda3-py39_4.9.2-Linux-x86_64.sh
dest: /home/training/Downloads/miniconda3_installer.sh
dest: "~/Downloads/miniconda3_installer.sh"
mode: '0644'
checksum: sha256:536817d1b14cb1ada88900f5be51ce0a5e042bae178b5550e62f61e223deae7c

- name: Run Miniconda Installer
shell:
executable: /bin/bash
chdir: /home/training
cmd: |
set -euo pipefail
rm -rf ~/.conda ~/miniconda3
bash ./Downloads/miniconda3_installer.sh -b
bash ~/Downloads/miniconda3_installer.sh -b
source ~/miniconda3/bin/activate
conda init
creates: /home/training/.conda/environments.txt
creates: ~/.conda/environments.txt

# I could do a full checkout of the GitHub repo here?
# No checksum - the file may change
- name: Download conda env spec
get_url:
url: https://raw.githubusercontent.com/carpentries-incubator/snakemake-novice-bioinformatics/gh-pages/files/conda_env_min.yaml
dest: /home/training/Downloads/snakemake_conda_env.yaml
url: https://raw.githubusercontent.com/carpentries-incubator/snakemake-novice-bioinformatics/gh-pages/files/conda_env.yaml
dest: "~/Downloads/snakemake_conda_env.yaml"
mode: '0644'
backup: yes

- name: Bootstrap deps into base env
shell:
executable: /bin/bash
chdir: /home/training
cmd: |
set -euo pipefail
source ~/miniconda3/bin/activate
conda env update -n base --file /home/training/Downloads/snakemake_conda_env.yaml
conda env update -n base --file ~/Downloads/snakemake_conda_env.yaml
snakemake --version
creates: /home/training/miniconda3/bin/snakemake
creates: "~/miniconda3/bin/snakemake"

- name: Download the data files
get_url:
url: https://ndownloader.figshare.com/files/28531743
dest: /home/training/Downloads/snakemake_data.tar.gz
url: https://ndownloader.figshare.com/files/35058796
dest: "~/Downloads/snakemake_data.tar.gz"
mode: '0644'
backup: no

- name: Unpack the data files
unarchive:
src: /home/training/Downloads/snakemake_data.tar.gz
dest: /home/training
src: "~/Downloads/snakemake_data.tar.gz"
dest: "~"
remote_src: yes
extra_opts: [ --strip-components=1 ]
creates: /home/training/yeast
creates: "~/yeast"

# I didn't realise GG GZipped all the reads. I can probably work with this but for
# the initial run-through I'll stick with the unpacked version.
# I didn't realise GG GZipped all the reads. This re-unzips them.
# Redundant since I actually fixed the tarball.
- name: Fix up the data files
shell:
executable: /bin/bash
chdir: /home/training
cmd: |
set -euo pipefail
cd ~
gunzip yeast/reads/*.gz
rm -rf yeast/bams
rm -f yeast/samples.csv
rm -f yeast/.*.txt
creates: /home/training/yeast/reads/ref1_1.fq
creates: "~/yeast/reads/ref1_1.fq"

2 changes: 1 addition & 1 deletion files/conda_env_min.yaml → files/conda_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ dependencies:
- c-ares=1.17.1=h7f98852_1
- cachetools=4.2.2=pyhd8ed1ab_0
- cairo=1.16.0=h6cf1ce9_1008
- certifi=2021.10.8=py39hf3d152e_0
- cffi=1.14.5=py39he32792d_0
- chardet=4.0.0=py39hf3d152e_1
- click=7.1.2=pyh9f0ad1d_0
Expand Down Expand Up @@ -68,6 +67,7 @@ dependencies:
- google-resumable-media=1.2.0=pyhd3deb0d_0
- googleapis-common-protos=1.53.0=py39hf3d152e_0
- graphite2=1.3.13=h58526e2_1001
- graphicsmagick=1.3.26=hf0fcf2e_2
- graphviz=2.42.3=h0511662_0
- grpcio=1.37.1=py39hff7568b_0
- harfbuzz=2.8.1=h83ec7ef_0
Expand Down
246 changes: 0 additions & 246 deletions files/conda_env_all.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To prepare for the course:
* Download and unpack [the sample dataset tarball](https://ndownloader.figshare.com/files/35058796)
* Install software packages, including Snakemake and the bioinformatics tools, via Conda:
* If you don't already have Conda, get [the Miniconda installer](https://docs.conda.io/en/latest/miniconda.html) and follow instructions
* Get [the environment file](files/conda_env_all.yaml) and run `conda env update --file conda_env_all.yaml`
* Get [the environment file](files/conda_env.yaml) and run `conda env update --file conda_env.yaml`
* Ensure the right environment is active - `conda activate snakemake_dash`
* Set up the GEdit or Nano text editor (other text editors will work fine but we only provide specific setup instructions
for GEdit and Nano).
Expand All @@ -44,7 +44,7 @@ The following settings are also recommended:
* Set the Syntax to "Python3", rather than "Plain Text"
* Set Tab width to 4
* Enable automatic indentation
* Hilight matching brackets
* Highlight matching brackets
* Display line numbers

### Nano
Expand Down

0 comments on commit 2ec6f61

Please sign in to comment.