Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
FROM {{mamba_image}} AS build
USER root
COPY --chown=$MAMBA_USER:$MAMBA_USER conda.yml /tmp/conda.yml
RUN (micromamba install -y -n base -f /tmp/conda.yml > /tmp/mamba.log 2>&1 \
# expose `which` at /usr/bin/which for R (bioconda) post-link scripts; the amazon2023 base image lacks it
RUN micromamba install -y -n base conda-forge::which \
&& ln -sf "$MAMBA_ROOT_PREFIX/bin/which" /usr/bin/which \
&& (micromamba install -y -n base -f /tmp/conda.yml > /tmp/mamba.log 2>&1 \
&& cat /tmp/mamba.log \
|| (cat /tmp/mamba.log >&2 && grep -q __cuda /tmp/mamba.log \
&& CONDA_OVERRIDE_CUDA="99" micromamba install -y -n base -f /tmp/conda.yml)) \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
FROM {{mamba_image}} AS build
USER root
# expose `which` at /usr/bin/which for R (bioconda) post-link scripts; the amazon2023 base image lacks it
RUN \
(micromamba install -y -n base {{channel_opts}} {{target}} > /tmp/mamba.log 2>&1 \
micromamba install -y -n base conda-forge::which \
&& ln -sf "$MAMBA_ROOT_PREFIX/bin/which" /usr/bin/which \
&& (micromamba install -y -n base {{channel_opts}} {{target}} > /tmp/mamba.log 2>&1 \
&& cat /tmp/mamba.log \
|| (cat /tmp/mamba.log >&2 && grep -q __cuda /tmp/mamba.log \
&& CONDA_OVERRIDE_CUDA="99" micromamba install -y -n base {{channel_opts}} {{target}})) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ From: {{mamba_image}}
%files
{{wave_context_dir}}/conda.yml /scratch/conda.yml
%post
# expose `which` at /usr/bin/which for R (bioconda) post-link scripts; the amazon2023 base image lacks it
micromamba install -y -n base conda-forge::which
ln -sf "$MAMBA_ROOT_PREFIX/bin/which" /usr/bin/which
micromamba install -y -n base -f /scratch/conda.yml > /tmp/mamba.log 2>&1 \
&& cat /tmp/mamba.log \
|| (cat /tmp/mamba.log >&2 && grep -q __cuda /tmp/mamba.log \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
BootStrap: docker
From: {{mamba_image}}
%post
# expose `which` at /usr/bin/which for R (bioconda) post-link scripts; the amazon2023 base image lacks it
micromamba install -y -n base conda-forge::which
ln -sf "$MAMBA_ROOT_PREFIX/bin/which" /usr/bin/which
micromamba install -y -n base {{channel_opts}} {{target}} > /tmp/mamba.log 2>&1 \
&& cat /tmp/mamba.log \
|| (cat /tmp/mamba.log >&2 && grep -q __cuda /tmp/mamba.log \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ COPY conda.yml /opt/wave/conda.yml
WORKDIR /opt/wave

RUN pixi init --import /opt/wave/conda.yml \
&& pixi add conda-forge::which \
{{base_packages}}
&& pixi shell-hook > /shell-hook.sh \
&& echo 'exec "$@"' >> /shell-hook.sh \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ From: {{pixi_image}}
%post
mkdir /opt/wave && cd /opt/wave
pixi init --import /scratch/conda.yml
pixi add conda-forge::which
{{base_packages}}
pixi shell-hook > /shell-hook.sh
echo ">> CONDA_LOCK_START"
Expand Down
26 changes: 22 additions & 4 deletions src/test/groovy/io/seqera/wave/util/ContainerHelperTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ class ContainerHelperTest extends Specification {
WORKDIR /opt/wave

RUN pixi init --import /opt/wave/conda.yml \\
&& pixi add conda-forge::which \\
&& pixi add conda-forge::procps-ng \\
&& pixi shell-hook > /shell-hook.sh \\
&& echo 'exec "$@"' >> /shell-hook.sh \\
Expand Down Expand Up @@ -686,6 +687,7 @@ class ContainerHelperTest extends Specification {
WORKDIR /opt/wave

RUN pixi init --import /opt/wave/conda.yml \\
&& pixi add conda-forge::which \\
&& pixi add foo::one bar::two \\
&& pixi shell-hook > /shell-hook.sh \\
&& echo 'exec "$@"' >> /shell-hook.sh \\
Expand Down Expand Up @@ -730,8 +732,12 @@ class ContainerHelperTest extends Specification {
then:
result =='''\
FROM mambaorg/micromamba:2-amazon2023 AS build
USER root
COPY --chown=$MAMBA_USER:$MAMBA_USER conda.yml /tmp/conda.yml
RUN (micromamba install -y -n base -f /tmp/conda.yml > /tmp/mamba.log 2>&1 \\
# expose `which` at /usr/bin/which for R (bioconda) post-link scripts; the amazon2023 base image lacks it
RUN micromamba install -y -n base conda-forge::which \\
&& ln -sf "$MAMBA_ROOT_PREFIX/bin/which" /usr/bin/which \\
&& (micromamba install -y -n base -f /tmp/conda.yml > /tmp/mamba.log 2>&1 \\
&& cat /tmp/mamba.log \\
|| (cat /tmp/mamba.log >&2 && grep -q __cuda /tmp/mamba.log \\
&& CONDA_OVERRIDE_CUDA="99" micromamba install -y -n base -f /tmp/conda.yml)) \\
Expand Down Expand Up @@ -768,8 +774,12 @@ class ContainerHelperTest extends Specification {
then:
result =='''\
FROM mambaorg/micromamba:2-amazon2023 AS build
USER root
COPY --chown=$MAMBA_USER:$MAMBA_USER conda.yml /tmp/conda.yml
RUN (micromamba install -y -n base -f /tmp/conda.yml > /tmp/mamba.log 2>&1 \\
# expose `which` at /usr/bin/which for R (bioconda) post-link scripts; the amazon2023 base image lacks it
RUN micromamba install -y -n base conda-forge::which \\
&& ln -sf "$MAMBA_ROOT_PREFIX/bin/which" /usr/bin/which \\
&& (micromamba install -y -n base -f /tmp/conda.yml > /tmp/mamba.log 2>&1 \\
&& cat /tmp/mamba.log \\
|| (cat /tmp/mamba.log >&2 && grep -q __cuda /tmp/mamba.log \\
&& CONDA_OVERRIDE_CUDA="99" micromamba install -y -n base -f /tmp/conda.yml)) \\
Expand Down Expand Up @@ -811,8 +821,12 @@ class ContainerHelperTest extends Specification {
then:
result =='''\
FROM mambaorg/micromamba:2.0.0 AS build
USER root
COPY --chown=$MAMBA_USER:$MAMBA_USER conda.yml /tmp/conda.yml
RUN (micromamba install -y -n base -f /tmp/conda.yml > /tmp/mamba.log 2>&1 \\
# expose `which` at /usr/bin/which for R (bioconda) post-link scripts; the amazon2023 base image lacks it
RUN micromamba install -y -n base conda-forge::which \\
&& ln -sf "$MAMBA_ROOT_PREFIX/bin/which" /usr/bin/which \\
&& (micromamba install -y -n base -f /tmp/conda.yml > /tmp/mamba.log 2>&1 \\
&& cat /tmp/mamba.log \\
|| (cat /tmp/mamba.log >&2 && grep -q __cuda /tmp/mamba.log \\
&& CONDA_OVERRIDE_CUDA="99" micromamba install -y -n base -f /tmp/conda.yml)) \\
Expand Down Expand Up @@ -848,8 +862,12 @@ class ContainerHelperTest extends Specification {
then:
result =='''\
FROM mambaorg/micromamba:2-amazon2023 AS build
USER root
# expose `which` at /usr/bin/which for R (bioconda) post-link scripts; the amazon2023 base image lacks it
RUN \\
(micromamba install -y -n base -c conda-forge -c bioconda -f https://foo.com/lock.yml > /tmp/mamba.log 2>&1 \\
micromamba install -y -n base conda-forge::which \\
&& ln -sf "$MAMBA_ROOT_PREFIX/bin/which" /usr/bin/which \\
&& (micromamba install -y -n base -c conda-forge -c bioconda -f https://foo.com/lock.yml > /tmp/mamba.log 2>&1 \\
&& cat /tmp/mamba.log \\
|| (cat /tmp/mamba.log >&2 && grep -q __cuda /tmp/mamba.log \\
&& CONDA_OVERRIDE_CUDA="99" micromamba install -y -n base -c conda-forge -c bioconda -f https://foo.com/lock.yml)) \\
Expand Down
42 changes: 38 additions & 4 deletions src/test/groovy/io/seqera/wave/util/TemplateUtilsTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ class TemplateUtilsTest extends Specification {
WORKDIR /opt/wave

RUN pixi init --import /opt/wave/conda.yml \\
&& pixi add conda-forge::which \\
&& pixi add foo::bar \\
&& pixi shell-hook > /shell-hook.sh \\
&& echo 'exec "$@"' >> /shell-hook.sh \\
Expand Down Expand Up @@ -393,6 +394,7 @@ class TemplateUtilsTest extends Specification {
WORKDIR /opt/wave

RUN pixi init --import /opt/wave/conda.yml \\
&& pixi add conda-forge::which \\
&& pixi add conda-forge::procps-ng \\
&& pixi shell-hook > /shell-hook.sh \\
&& echo 'exec "$@"' >> /shell-hook.sh \\
Expand Down Expand Up @@ -431,6 +433,7 @@ class TemplateUtilsTest extends Specification {
WORKDIR /opt/wave

RUN pixi init --import /opt/wave/conda.yml \\
&& pixi add conda-forge::which \\
&& pixi add conda-forge::procps-ng \\
&& pixi shell-hook > /shell-hook.sh \\
&& echo 'exec "$@"' >> /shell-hook.sh \\
Expand Down Expand Up @@ -482,8 +485,12 @@ class TemplateUtilsTest extends Specification {
expect:
TemplateUtils.condaFileToDockerFileUsingV2(CONDA_OPTS) == '''\
FROM mambaorg/micromamba:2.1.1 AS build
USER root
COPY --chown=$MAMBA_USER:$MAMBA_USER conda.yml /tmp/conda.yml
RUN (micromamba install -y -n base -f /tmp/conda.yml > /tmp/mamba.log 2>&1 \\
# expose `which` at /usr/bin/which for R (bioconda) post-link scripts; the amazon2023 base image lacks it
RUN micromamba install -y -n base conda-forge::which \\
&& ln -sf "$MAMBA_ROOT_PREFIX/bin/which" /usr/bin/which \\
&& (micromamba install -y -n base -f /tmp/conda.yml > /tmp/mamba.log 2>&1 \\
&& cat /tmp/mamba.log \\
|| (cat /tmp/mamba.log >&2 && grep -q __cuda /tmp/mamba.log \\
&& CONDA_OVERRIDE_CUDA="99" micromamba install -y -n base -f /tmp/conda.yml)) \\
Expand All @@ -507,8 +514,12 @@ class TemplateUtilsTest extends Specification {
expect:
TemplateUtils.condaFileToDockerFileUsingV2(new CondaOpts([:])) == '''\
FROM mambaorg/micromamba:1.5.10-noble AS build
USER root
COPY --chown=$MAMBA_USER:$MAMBA_USER conda.yml /tmp/conda.yml
RUN (micromamba install -y -n base -f /tmp/conda.yml > /tmp/mamba.log 2>&1 \\
# expose `which` at /usr/bin/which for R (bioconda) post-link scripts; the amazon2023 base image lacks it
RUN micromamba install -y -n base conda-forge::which \\
&& ln -sf "$MAMBA_ROOT_PREFIX/bin/which" /usr/bin/which \\
&& (micromamba install -y -n base -f /tmp/conda.yml > /tmp/mamba.log 2>&1 \\
&& cat /tmp/mamba.log \\
|| (cat /tmp/mamba.log >&2 && grep -q __cuda /tmp/mamba.log \\
&& CONDA_OVERRIDE_CUDA="99" micromamba install -y -n base -f /tmp/conda.yml)) \\
Expand Down Expand Up @@ -541,8 +552,12 @@ class TemplateUtilsTest extends Specification {
expect:
TemplateUtils.condaPackagesToDockerFileUsingV2(PACKAGES, CHANNELS, CONDA_OPTS) == '''\
FROM mambaorg/micromamba:2.1.1 AS build
USER root
# expose `which` at /usr/bin/which for R (bioconda) post-link scripts; the amazon2023 base image lacks it
RUN \\
(micromamba install -y -n base -c conda-forge -c bioconda bwa=0.7.15 salmon=1.1.1 > /tmp/mamba.log 2>&1 \\
micromamba install -y -n base conda-forge::which \\
&& ln -sf "$MAMBA_ROOT_PREFIX/bin/which" /usr/bin/which \\
&& (micromamba install -y -n base -c conda-forge -c bioconda bwa=0.7.15 salmon=1.1.1 > /tmp/mamba.log 2>&1 \\
&& cat /tmp/mamba.log \\
|| (cat /tmp/mamba.log >&2 && grep -q __cuda /tmp/mamba.log \\
&& CONDA_OVERRIDE_CUDA="99" micromamba install -y -n base -c conda-forge -c bioconda bwa=0.7.15 salmon=1.1.1)) \\
Expand Down Expand Up @@ -575,8 +590,12 @@ class TemplateUtilsTest extends Specification {
expect:
TemplateUtils.condaPackagesToDockerFileUsingV2(PACKAGES, CHANNELS, CONDA_OPTS) == '''\
FROM mambaorg/micromamba:2.1.1 AS build
USER root
# expose `which` at /usr/bin/which for R (bioconda) post-link scripts; the amazon2023 base image lacks it
RUN \\
(micromamba install -y -n base -c conda-forge numpy pandas > /tmp/mamba.log 2>&1 \\
micromamba install -y -n base conda-forge::which \\
&& ln -sf "$MAMBA_ROOT_PREFIX/bin/which" /usr/bin/which \\
&& (micromamba install -y -n base -c conda-forge numpy pandas > /tmp/mamba.log 2>&1 \\
&& cat /tmp/mamba.log \\
|| (cat /tmp/mamba.log >&2 && grep -q __cuda /tmp/mamba.log \\
&& CONDA_OVERRIDE_CUDA="99" micromamba install -y -n base -c conda-forge numpy pandas)) \\
Expand Down Expand Up @@ -665,6 +684,7 @@ class TemplateUtilsTest extends Specification {
%post
mkdir /opt/wave && cd /opt/wave
pixi init --import /scratch/conda.yml
pixi add conda-forge::which
pixi add conda-forge::procps-ng
pixi shell-hook > /shell-hook.sh
echo ">> CONDA_LOCK_START"
Expand All @@ -685,6 +705,7 @@ class TemplateUtilsTest extends Specification {
%post
mkdir /opt/wave && cd /opt/wave
pixi init --import /scratch/conda.yml
pixi add conda-forge::which
pixi add conda-forge::procps-ng
pixi shell-hook > /shell-hook.sh
echo ">> CONDA_LOCK_START"
Expand Down Expand Up @@ -712,6 +733,7 @@ class TemplateUtilsTest extends Specification {
%post
mkdir /opt/wave && cd /opt/wave
pixi init --import /scratch/conda.yml
pixi add conda-forge::which
pixi shell-hook > /shell-hook.sh
echo ">> CONDA_LOCK_START"
cat /opt/wave/pixi.lock
Expand Down Expand Up @@ -769,6 +791,9 @@ class TemplateUtilsTest extends Specification {
%files
{{wave_context_dir}}/conda.yml /scratch/conda.yml
%post
# expose `which` at /usr/bin/which for R (bioconda) post-link scripts; the amazon2023 base image lacks it
micromamba install -y -n base conda-forge::which
ln -sf "$MAMBA_ROOT_PREFIX/bin/which" /usr/bin/which
micromamba install -y -n base -f /scratch/conda.yml > /tmp/mamba.log 2>&1 \\
&& cat /tmp/mamba.log \\
|| (cat /tmp/mamba.log >&2 && grep -q __cuda /tmp/mamba.log \\
Expand All @@ -794,6 +819,9 @@ class TemplateUtilsTest extends Specification {
%files
{{wave_context_dir}}/conda.yml /scratch/conda.yml
%post
# expose `which` at /usr/bin/which for R (bioconda) post-link scripts; the amazon2023 base image lacks it
micromamba install -y -n base conda-forge::which
ln -sf "$MAMBA_ROOT_PREFIX/bin/which" /usr/bin/which
micromamba install -y -n base -f /scratch/conda.yml > /tmp/mamba.log 2>&1 \\
&& cat /tmp/mamba.log \\
|| (cat /tmp/mamba.log >&2 && grep -q __cuda /tmp/mamba.log \\
Expand Down Expand Up @@ -825,6 +853,9 @@ class TemplateUtilsTest extends Specification {
BootStrap: docker
From: mambaorg/micromamba:2.1.1
%post
# expose `which` at /usr/bin/which for R (bioconda) post-link scripts; the amazon2023 base image lacks it
micromamba install -y -n base conda-forge::which
ln -sf "$MAMBA_ROOT_PREFIX/bin/which" /usr/bin/which
micromamba install -y -n base -c conda-forge -c bioconda bwa=0.7.15 salmon=1.1.1 > /tmp/mamba.log 2>&1 \\
&& cat /tmp/mamba.log \\
|| (cat /tmp/mamba.log >&2 && grep -q __cuda /tmp/mamba.log \\
Expand Down Expand Up @@ -856,6 +887,9 @@ class TemplateUtilsTest extends Specification {
BootStrap: docker
From: mambaorg/micromamba:2.1.1
%post
# expose `which` at /usr/bin/which for R (bioconda) post-link scripts; the amazon2023 base image lacks it
micromamba install -y -n base conda-forge::which
ln -sf "$MAMBA_ROOT_PREFIX/bin/which" /usr/bin/which
micromamba install -y -n base -c conda-forge numpy pandas > /tmp/mamba.log 2>&1 \\
&& cat /tmp/mamba.log \\
|| (cat /tmp/mamba.log >&2 && grep -q __cuda /tmp/mamba.log \\
Expand Down
Loading