Skip to content
Draft
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
Expand Up @@ -17,6 +17,10 @@ FROM {{base_image}} AS final
COPY --from=build /opt/wave/.pixi/envs/default /opt/wave/.pixi/envs/default
COPY --from=build /shell-hook.sh /shell-hook.sh

# set user and environment variables for Python compatibility
USER root
ENV USER=root

# set the entrypoint to the shell-hook script (activate the environment and run the command)
# no more pixi needed in the final container
ENTRYPOINT ["/bin/bash", "/shell-hook.sh"]
Expand Down
20 changes: 14 additions & 6 deletions src/test/groovy/io/seqera/wave/util/ContainerHelperTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,10 @@ class ContainerHelperTest extends Specification {
COPY --from=build /opt/wave/.pixi/envs/default /opt/wave/.pixi/envs/default
COPY --from=build /shell-hook.sh /shell-hook.sh

# set user and environment variables for Python compatibility
USER root
ENV USER=root

# set the entrypoint to the shell-hook script (activate the environment and run the command)
# no more pixi needed in the final container
ENTRYPOINT ["/bin/bash", "/shell-hook.sh"]
Expand Down Expand Up @@ -676,28 +680,32 @@ class ContainerHelperTest extends Specification {
then:
result =='''\
FROM ghcr.io/prefix-dev/pixi:0.47.0-jammy-cuda-12.8.1 AS build

COPY conda.yml /opt/wave/conda.yml
WORKDIR /opt/wave

RUN pixi init --import /opt/wave/conda.yml \\
&& pixi add foo::one bar::two \\
&& pixi shell-hook > /shell-hook.sh \\
&& echo 'exec "$@"' >> /shell-hook.sh \\
&& echo ">> CONDA_LOCK_START" \\
&& cat /opt/wave/pixi.lock \\
&& echo "<< CONDA_LOCK_END"

FROM base/image AS final

# copy the pixi environment in the final container
COPY --from=build /opt/wave/.pixi/envs/default /opt/wave/.pixi/envs/default
COPY --from=build /shell-hook.sh /shell-hook.sh


# set user and environment variables for Python compatibility
USER root
ENV USER=root

# set the entrypoint to the shell-hook script (activate the environment and run the command)
# no more pixi needed in the final container
ENTRYPOINT ["/bin/bash", "/shell-hook.sh"]

# Default command for "docker run"
CMD ["/bin/bash"]
'''.stripIndent()
Expand Down
12 changes: 12 additions & 0 deletions src/test/groovy/io/seqera/wave/util/TemplateUtilsTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@ class TemplateUtilsTest extends Specification {
COPY --from=build /opt/wave/.pixi/envs/default /opt/wave/.pixi/envs/default
COPY --from=build /shell-hook.sh /shell-hook.sh

# set user and environment variables for Python compatibility
USER root
ENV USER=root

# set the entrypoint to the shell-hook script (activate the environment and run the command)
# no more pixi needed in the final container
ENTRYPOINT ["/bin/bash", "/shell-hook.sh"]
Expand Down Expand Up @@ -402,6 +406,10 @@ class TemplateUtilsTest extends Specification {
COPY --from=build /opt/wave/.pixi/envs/default /opt/wave/.pixi/envs/default
COPY --from=build /shell-hook.sh /shell-hook.sh

# set user and environment variables for Python compatibility
USER root
ENV USER=root

# set the entrypoint to the shell-hook script (activate the environment and run the command)
# no more pixi needed in the final container
ENTRYPOINT ["/bin/bash", "/shell-hook.sh"]
Expand Down Expand Up @@ -436,6 +444,10 @@ class TemplateUtilsTest extends Specification {
COPY --from=build /opt/wave/.pixi/envs/default /opt/wave/.pixi/envs/default
COPY --from=build /shell-hook.sh /shell-hook.sh

# set user and environment variables for Python compatibility
USER root
ENV USER=root

# set the entrypoint to the shell-hook script (activate the environment and run the command)
# no more pixi needed in the final container
ENTRYPOINT ["/bin/bash", "/shell-hook.sh"]
Expand Down