Skip to content

Commit

Permalink
Try Dockerfile_pixi
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Jan 9, 2024
1 parent 58b911c commit 10390db
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 11 deletions.
53 changes: 42 additions & 11 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
stages:
- conda
- image-pixi
- pixi
- image
- lint
- test
Expand Down Expand Up @@ -28,18 +29,48 @@ 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 <<EOF
{
"auths": {
"$CI_REGISTRY": {
"username": "$CI_REGISTRY_USER",
"password": "$CI_REGISTRY_PASSWORD"
}
}
}
EOF
- >
/kaniko/executor --context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/docker/Dockerfile_pixi
--single-snapshot
--cleanup
--destination registry.heptapod.net:443/fluiddyn/fluidsim/ci/default:pixi
# --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/default: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
Expand Down
32 changes: 32 additions & 0 deletions docker/Dockerfile_pixi
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM debian:bookworm
LABEL Pierre Augier <[email protected]>

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 .
RUN mv pixi $HOME/.local/bin

0 comments on commit 10390db

Please sign in to comment.