From d31b426199449411926119b2468ff8e692e3bb85 Mon Sep 17 00:00:00 2001 From: paugier Date: Tue, 9 Jan 2024 22:55:16 +0100 Subject: [PATCH] Try Dockerfile_pixi --- .gitlab-ci.yml | 52 +++++++++++++++++++++++++++++++++--------- docker/Dockerfile_pixi | 31 +++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 11 deletions(-) create mode 100644 docker/Dockerfile_pixi diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3c6cdc52..7240b909 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,6 @@ stages: - - conda + - image-pixi + - pixi - image - lint - test @@ -28,18 +29,47 @@ workflow: # - python3.9 tmp_bug_unearth.py -test_conda: - stage: conda - image: debian:bookworm +CI image pixi: + stage: image-pixi + tags: + - container-registry-push + # rules: + # - if: '$CI_PIPELINE_SOURCE == "schedule"' + # - if: '$CI_BUILD_IMAGES == "1"' + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [ "" ] + before_script: + - "" + script: + - | + cat > /kaniko/.docker/config.json < + /kaniko/executor --context $CI_PROJECT_DIR + --dockerfile $CI_PROJECT_DIR/docker/Dockerfile_pixi + --single-snapshot + --cleanup + --destination registry.heptapod.net:443/fluiddyn/fluidsim/ci/$CI_COMMIT_HG_BRANCH:pixi + + +test_pixi: + stage: pixi + image: registry.heptapod.net:443/fluiddyn/fluidsim/ci/$CI_COMMIT_HG_BRANCH:pixi + needs: + - job: "CI image pixi" + optional: true script: - - apt-get update - - apt-get install wget -y - - wget https://github.com/prefix-dev/pixi/releases/latest/download/pixi-x86_64-unknown-linux-musl.tar.gz - - tar -xzf pixi-x86_64-unknown-linux-musl.tar.gz . - - mkdir -p $HOME/.local/bin - - mv pixi $HOME/.local/bin - - export PATH=$HOME/.local/bin:$PATH - pixi info + - hg clone https://foss.heptapod.net/fluiddyn/transonic ../transonic - pixi run install-editable - pixi run pytest -v lib - pixi run fluidsim-test -v diff --git a/docker/Dockerfile_pixi b/docker/Dockerfile_pixi new file mode 100644 index 00000000..16be5559 --- /dev/null +++ b/docker/Dockerfile_pixi @@ -0,0 +1,31 @@ +FROM debian:bookworm +LABEL Pierre Augier + +RUN apt-get update + +RUN apt-get install -y --no-install-recommends \ + mercurial python3-pip wget sudo \ + --option=Dpkg::Options::=--force-confdef + +RUN rm -rf /var/lib/apt/lists/* + +RUN groupadd -g 1000 appuser && useradd -m -r -u 1000 -g appuser -s /bin/bash appuser -s /bin/bash && usermod -a -G sudo appuser +RUN echo appuser:appuser | chpasswd +USER appuser +ARG HOME=/home/appuser +RUN mkdir -p $HOME/opt +WORKDIR $HOME/opt +RUN echo $USER $HOME $PWD && whoami + +RUN $(hg debuginstall -T '{pythonexe}') -m pip install hg-evolve hg-git --no-cache-dir --user --break-system-packages + +COPY --chown=appuser:appuser docker/hgrc $HOME/.hgrc + +RUN mkdir -p $HOME/.local/bin +ENV PATH=$HOME/.local/bin:$PATH + +RUN mkdir -p $HOME/.config/matplotlib +RUN echo 'backend : agg' > $HOME/.config/matplotlib/matplotlibrc + +RUN wget https://github.com/prefix-dev/pixi/releases/latest/download/pixi-x86_64-unknown-linux-musl.tar.gz +RUN tar -xzf pixi-x86_64-unknown-linux-musl.tar.gz $HOME/.local/bin