seqeralabs / wave

On-demand containers provisioning service
https://seqera.io/wave/
GNU Affero General Public License v3.0
32 stars 4 forks source link

Use Pixi to resolve Conda environment #521

Open pditommaso opened 4 months ago

pditommaso commented 4 months ago

Wave uses Micromanba-docker to resolve and install Conda packages in the built containers.

Pixi should allows the creation of smaller containers in less time.

The goal of this issue is to implement the support for Pixi as a replacement for Micromamba.

Given Conda environment file, the Container image can be built using the following Dockerfile

FROM ghcr.io/prefix-dev/pixi:0.18.0 AS build

COPY env.yml /app/env.yml
WORKDIR /app

RUN pixi init --import /app/env.yml
RUN pixi add conda-forge::procps-ng

FROM ubuntu:lunar AS release
COPY --from=build /app/.pixi/envs/default /app/.pixi/envs/default
ENV PATH="/app/.pixi/envs/default/bin:$PATH"

The above above approach allows the use of a generic base image for the target container image (in place of ubuntu:lunar)

As a secondary goal, it should be evaluated how to make faster builds using the shared repodata approach as described here.

pditommaso commented 2 months ago

Worth noting that pixi also automatically creates the environment lock file.

# ls -la 
total 36
drwxr-xr-x 1 root root 4096 Aug 12 21:33 .
drwxr-xr-x 1 root root 4096 Aug 12 21:34 ..
-rw-r--r-- 1 root root   63 Aug 12 21:33 .gitattributes
-rw-r--r-- 1 root root   27 Aug 12 21:33 .gitignore
drwxr-xr-x 1 root root 4096 Aug 12 21:33 .pixi
-rw-r--r-- 1 root root   55 Jun  7 16:28 env.yml
-rw-r--r-- 1 root root 5519 Aug 12 21:33 pixi.lock
-rw-r--r-- 1 root root  244 Aug 12 21:33 pixi.toml

https://pixi.sh/v0.20.0/features/lockfile/