Skip to content

Commit

Permalink
Merge pull request #114 from hic-infra/bioconda
Browse files Browse the repository at this point in the history
Add bioconda to reverse_proxy
  • Loading branch information
manics authored Aug 1, 2024
2 parents d475c0c + aac42d9 commit bcef6e7
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 24 deletions.
5 changes: 3 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ansible==9.5.1
ansible-compat==24.5.1
ansible-compat==24.6.1
ansible-lint==24.5.0
molecule==24.2.1
molecule==24.7.0
molecule-docker==2.1.0
yamllint==1.35.1
requests==2.31.0
4 changes: 3 additions & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ collections:
version: 1.3.0
type: galaxy
- name: community.general
version: 5.3.0
version: 9.2.0
type: galaxy
- name: community.docker
version: 3.11.0
4 changes: 2 additions & 2 deletions reverse_proxy/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ cran_mirror: https://cran.ma.imperial.ac.uk/
cran_regex: ^/(bin/windows|src)/contrib/(4\.1|4\.3|4\.4|3\.6)*/*[a-zA-Z0-9_\-\.]*(\.tar\.gz|\.zip|PACKAGES)$

# conda-forge
conda_repo_regex: ^/conda-forge/(linux-64|linux-aarch64|win-64|noarch)/(current_)?repodata.json$
conda_pkg_regex: ^/conda-forge/(linux-64|linux-aarch64|win-64|noarch)/[a-zA-Z0-9\-\._!]*(\.tar\.bz2|\.conda)$
conda_repo_regex: ^/(conda-forge|bioconda)/(linux-64|linux-aarch64|win-64|noarch)/(current_)?repodata.json$
conda_pkg_regex: ^/(conda-forge|bioconda)/(linux-64|linux-aarch64|win-64|noarch)/[a-zA-Z0-9\-\._!]*(\.tar\.bz2|\.conda)$

# ClamAV scanner command (file is passed as last argument)
av_scanner: "clamdscan --fdpass"
Expand Down
79 changes: 60 additions & 19 deletions reverse_proxy/molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,29 @@
fail_msg: "Request to valid file extension was blocked."
success_msg: "Request to valid file extension was not blocked."

- name: r package installation
shell:
cmd: |
rm -rf /usr/local/lib/R/site-library/ggplot2 # remove if installed
/usr/bin/R --no-save <<RPROG
install.packages("ggplot2", repos="http://cran.{{zone}}")
library('ggplot2')
q()
RPROG
ls /usr/local/lib/R/site-library/ggplot2
failed_when: false
changed_when: false
register: r_install

- name: ensure r package installed successfully
assert:
that: r_install.rc == 0
fail_msg: "Failed to install R package (ggplot2) from local proxy"
success_msg: "R package (ggplot2) was successfully installed via local proxy"
# Ubuntu 20.04 uses R 3, and packages for R 3 are no longer
# available in CRAN. We can sort this out when we move to Ubuntu
# 22.04 or later:

# - name: r package installation
# shell:
# cmd: |
# rm -rf /usr/local/lib/R/site-library/dplyr # remove if installed
# /usr/bin/R --no-save <<RPROG
# install.packages("dplyr", repos="http://cran.{{zone}}")
# library('dplyr')
# q()
# RPROG
# ls /usr/local/lib/R/site-library/dplyr
# failed_when: false
# changed_when: false
# register: r_install

# - name: ensure r package installed successfully
# assert:
# that: r_install.rc == 0
# fail_msg: "Failed to install R package (dplyr) from local proxy"
# success_msg: "R package (dplyr) was successfully installed via local proxy"

- name: check avscanner headers
uri:
Expand Down Expand Up @@ -198,3 +202,40 @@
that: conda_install.rc == 0
fail_msg: "Failed to install conda package (numpy) from local proxy"
success_msg: "Conda package (numpy) was successfully installed via local proxy"

# and bioconda...

- name: test connection to /bioconda/noarch/current_repodata.json
uri:
url: http://conda.{{zone}}/bioconda/noarch/current_repodata.json
force: true # avoid hitting cache
failed_when: false
changed_when: false
register: bioconda_curl_repodata

- name: test connection to /bioconda/noarch/current_repodata.json
assert:
that: bioconda_curl_repodata.status == 200
fail_msg: "Request to valid repodata was blocked."
success_msg: "Request to valid repodata was allowed."


# I wanted to install plink2 but it's not available for aarch64, and
# using docker linux/amd64 causes the nginx lua VM to crash at
# startup. bamsnap is a noarch package.
- name: perform installation of a package (bamsnap)
shell: |
eval "$(/root/miniconda3/bin/conda shell.bash hook)"
env=$(cat /proc/sys/kernel/random/uuid)
conda create -n "$env" -c bioconda bamsnap
conda activate "$env"
python -c "import bamsnap"
failed_when: false
changed_when: false
register: bioconda_install

- name: ensure bioconda package installation was successful
assert:
that: bioconda_install.rc == 0
fail_msg: "Failed to install conda package (bamsnap) from local proxy"
success_msg: "Conda package (bamsnap) was successfully installed via local proxy"

0 comments on commit bcef6e7

Please sign in to comment.