diff --git a/conda/conda.yml b/conda/conda.yml index 132959b..66bb627 100644 --- a/conda/conda.yml +++ b/conda/conda.yml @@ -13,33 +13,33 @@ 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 + 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" -- 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 + 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 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}}" + 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}}/ @@ -47,33 +47,32 @@ 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 - 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 - 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 - 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" + 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}}" @@ -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 diff --git a/conda/conda_env.yml b/conda/conda_env.yml index 4490128..a2488a4 100644 --- a/conda/conda_env.yml +++ b/conda/conda_env.yml @@ -2,3 +2,4 @@ channels: - conda-forge - bioconda + diff --git a/conda/conda_vars_file.yml b/conda/conda_vars_file.yml index 00b230d..9a0f70b 100644 --- a/conda/conda_vars_file.yml +++ b/conda/conda_vars_file.yml @@ -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: diff --git a/packer/networks.json b/packer/networks.json index 0b4ec33..2bd9b23 100644 --- a/packer/networks.json +++ b/packer/networks.json @@ -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" }