Skip to content

Commit

Permalink
Merge branch 'refactor/miniforge' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz committed Jan 7, 2025
2 parents c9f2a62 + ca4427b commit ac33f7c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 25 deletions.
45 changes: 22 additions & 23 deletions conda/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,67 +13,66 @@
name: python3-pip
state: latest

- name: Download Miniconda
- name: Download Miniforge
get_url:
url: https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
dest: /tmp/miniconda.sh
url: https://github.com/conda-forge/miniforge/releases/download/{{conda_vars.MINI_FORGE_RELEASE}}/Miniforge3-{{conda_vars.MINI_FORGE_RELEASE}}-Linux-x86_64.sh

Check failure on line 18 in conda/conda.yml

View workflow job for this annotation

GitHub Actions / build

yaml[line-length]

Line too long (162 > 160 characters)

Check failure on line 18 in conda/conda.yml

View workflow job for this annotation

GitHub Actions / build

yaml[indentation]

Wrong indentation: expected 8 but found 4
dest: /tmp/miniforge.sh

- name: Install Miniconda
command: bash /tmp/miniconda.sh -b -p {{conda_vars.CONDA_DIR}}
- name: Install Miniforge
command: bash /tmp/miniforge.sh -b -p {{ conda_vars.CONDA_DIR }}
args:
creates: "{{conda_vars.CONDA_DIR}}/bin/conda"
creates: "{{ conda_vars.CONDA_DIR }}/bin/mamba"

Check failure on line 24 in conda/conda.yml

View workflow job for this annotation

GitHub Actions / build

yaml[indentation]

Wrong indentation: expected 8 but found 4

- name: Add Miniconda to PATH
- name: Add Miniforge to PATH
lineinfile:
path: /etc/profile
line: 'export PATH={{conda_vars.CONDA_DIR}}/bin:$PATH'
path: /etc/profile

Check failure on line 28 in conda/conda.yml

View workflow job for this annotation

GitHub Actions / build

yaml[indentation]

Wrong indentation: expected 8 but found 4
line: 'export PATH={{ conda_vars.CONDA_DIR }}/bin:$PATH'
become: true
become_user: root

- name: Install conda-env role
include_role:
name: andrewrothstein.conda-env
name: andrewrothstein.conda-env

Check failure on line 35 in conda/conda.yml

View workflow job for this annotation

GitHub Actions / build

yaml[indentation]

Wrong indentation: expected 8 but found 4
vars:
conda_env_conda_dir: "{{conda_vars.CONDA_DIR}}"
conda_env_name: "{{ conda_vars.ENV_NAME| quote }}"
conda_env_environment: conda_env.yml
conda_env_activate_for_login_shell: true
conda_env_conda_dir: "{{conda_vars.CONDA_DIR}}"

Check failure on line 37 in conda/conda.yml

View workflow job for this annotation

GitHub Actions / build

yaml[indentation]

Wrong indentation: expected 8 but found 4
conda_env_name: "{{ conda_vars.ENV_NAME| quote }}"
conda_env_environment: conda_env.yml
conda_env_activate_for_login_shell: true

- name: Adjust miniconda folder rights
- name: Adjust miniforge folder rights
become: true
shell: chown -R {{conda_vars.default_user}}:{{conda_vars.default_user}} {{conda_vars.CONDA_DIR}}/

- name: Add bioconda channel
become_user: "{{conda_vars.default_user}}"
shell: 'timeout 1m bash -c ''source {{conda_vars.CONDA_DIR}}/bin/activate && conda config --add channels bioconda'''
args:
executable: /bin/bash
executable: /bin/bash

Check failure on line 50 in conda/conda.yml

View workflow job for this annotation

GitHub Actions / build

yaml[indentation]

Wrong indentation: expected 8 but found 4

- name: Add conda-forge channel
become_user: "{{conda_vars.default_user}}"
shell: 'timeout 1m bash -c ''source {{conda_vars.CONDA_DIR}}/bin/activate && conda config --add channels conda-forge'''
args:
executable: /bin/bash

executable: /bin/bash

Check failure on line 56 in conda/conda.yml

View workflow job for this annotation

GitHub Actions / build

yaml[indentation]

Wrong indentation: expected 8 but found 4

- name: Init .bashrc for conda
become_user: "{{conda_vars.default_user}}"
shell: 'timeout 1m bash -c ''source {{ conda_vars.CONDA_DIR}}/bin/activate && conda init'''
args:
executable: /bin/bash
executable: /bin/bash

Check failure on line 62 in conda/conda.yml

View workflow job for this annotation

GitHub Actions / build

yaml[indentation]

Wrong indentation: expected 8 but found 4

- name: Create alias for environment
become_user: "{{conda_vars.default_user}}"
lineinfile:
path: "/home/{{conda_vars.default_user}}/.bashrc"
line: "alias {{conda_vars.ENV_NAME|quote}}='conda activate {{conda_vars.ENV_NAME|quote}}'"
path: "/home/{{conda_vars.default_user}}/.bashrc"

Check failure on line 67 in conda/conda.yml

View workflow job for this annotation

GitHub Actions / build

yaml[indentation]

Wrong indentation: expected 8 but found 4
line: "alias {{conda_vars.ENV_NAME|quote}}='conda activate {{conda_vars.ENV_NAME|quote}}'"

- name: Check for installed packages
become_user: "{{conda_vars.default_user}}"
shell: 'source {{conda_vars.CONDA_DIR}}/bin/activate && conda activate {{conda_vars.ENV_NAME|quote}} && conda list'
register: added_packages
args:
executable: /bin/bash
executable: /bin/bash

- name: Install chosen packages
become_user: "{{conda_vars.default_user}}"
Expand All @@ -82,6 +81,6 @@
conda activate {{conda_vars.ENV_NAME|quote}} &&
conda install --yes {{item.key}}={{item.value.version}}
args:
executable: /bin/bash
executable: /bin/bash
loop: "{{ q('dict', conda_vars.packages) }}"
when: added_packages.stdout.find(item.key) == -1
1 change: 1 addition & 0 deletions conda/conda_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
channels:
- conda-forge
- bioconda

3 changes: 2 additions & 1 deletion conda/conda_vars_file.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
conda_vars:
default_user: ubuntu
CONDA_DIR: /home/ubuntu/miniconda3
CONDA_DIR: /home/ubuntu/miniforge
ENV_NAME: denbi
TIMEOUT_LENGTH: 5m
MINI_FORGE_RELEASE: 24.11.2-1
packages:
2 changes: 1 addition & 1 deletion packer/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"dsi_production": "c174e49a-3434-410e-9e83-6175f51658b0",
"dkfz_staging": "6f6ad650-85d6-4a22-b362-849cd2ec2364",
"dkfz_production": "9b35565f-cec0-4f59-9228-9f4a10cee53b",
"berlin_staging": " f979333a-1484-4059-874a-0966a42e505b"
"berlin_staging": "f979333a-1484-4059-874a-0966a42e505b"

}

0 comments on commit ac33f7c

Please sign in to comment.