Skip to content

Commit

Permalink
squashme: use micromamba to install conda
Browse files Browse the repository at this point in the history
  • Loading branch information
olevski committed Nov 25, 2024
1 parent c49cb93 commit 68364cb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/build-and-push-to-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -756,10 +756,15 @@ jobs:
fail-fast: true
matrix:
include:
- CONDA_VERSION: 24.9.2-0
- PYTHON_VERSION: 3.12.7
BASE_IMAGE_TAG: debian
- CONDA_VERSION: latest
LATEST: true
- PYTHON_VERSION: 3.11.10
BASE_IMAGE_TAG: debian
LATEST: true
- PYTHON_VERSION: 3.10.15
BASE_IMAGE_TAG: debian
LATEST: true
steps:
- name: Docker Login
uses: docker/login-action@v3
Expand All @@ -781,11 +786,11 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_PREFIX }}-vscode-conda
images: ${{ env.DOCKER_PREFIX }}-vscode-python
tags: |
type=sha,prefix=${{ matrix.CONDA_VERSION }}-
type=semver,pattern={{version}},prefix=${{ matrix.CONDA_VERSION }}-
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' && matrix.CONDA_VERSION == 'latest' }}
type=sha,prefix=py-${{ matrix.PYTHON_VERSION }}-
type=semver,pattern={{version}},prefix=py-${{ matrix.PYTHON_VERSION }}-
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' && matrix.LATEST }}
- name: Build and export
uses: docker/build-push-action@v6
with:
Expand Down Expand Up @@ -906,8 +911,8 @@ jobs:
with:
images: ${{ env.DOCKER_PREFIX }}-vscode-r
tags: |
type=sha,prefix=${{ matrix.R_VERSION }}-
type=semver,pattern={{version}},prefix=${{ matrix.R_VERSION }}-
type=sha,prefix=r-${{ matrix.R_VERSION }}-
type=semver,pattern={{version}},prefix=r-${{ matrix.R_VERSION }}-
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' && matrix.LATEST }}
- name: Build and export
uses: docker/build-push-action@v6
Expand Down
19 changes: 13 additions & 6 deletions docker/vscode/conda.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
ARG BASE_IMAGE=renku/renkulab-vscode:latest
FROM $BASE_IMAGE
ARG MINIFORGE_VERSION=24.9.2-0
ARG OS=Linux
ARG ARCH=x86_64
ARG MICROMAMBA_VERSION=2.0.2-2
ARG MAMBA_VERSION=1.5.9
ARG CONDA_VERSION=24.9.2
ARG PYTHON_VERSION=3.12.7
ARG OS=linux
ARG ARCH=64
ARG SESSION_USER=vscode
ARG WORKDIR=/home/${SESSION_USER}/work
ARG VENVS_PATH=${WORKDIR}/.venvs
ENV VENVS_PATH=${VENVS_PATH}
ENV __VENVS_PATH__=${VENVS_PATH}
ENV __PYTHON_VERSION__=${PYTHON_VERSION}
ENV __MAMBA_VERSION__=${MAMBA_VERSION}
ENV __CONDA_VERSION__=${CONDA_VERSION}
SHELL [ "/bin/bash", "-c", "-o", "pipefail" ]
USER root
RUN apt-get update && \
apt-get install -y curl --no-install-recommends && \
curl -L "https://github.com/conda-forge/miniforge/releases/download/${MINIFORGE_VERSION}/Miniforge3-${OS}-${ARCH}.sh" -o /install.sh && \
curl -L "https://github.com/mamba-org/micromamba-releases/releases/download/${MICROMAMBA_VERSION}/micromamba-${OS}-${ARCH}" -o /usr/local/bin/micromamba && \
chmod a+x /usr/local/bin/micromamba && \
rm -rf /var/lib/apt/lists/*

USER ${SESSION_USER}
WORKDIR ${WORKDIR}
ENTRYPOINT ["tini", "--", "sh", "-c"]
CMD ["bash /install.sh -b -u -p ${VENVS_PATH} && ${VENVS_PATH}/bin/conda init && bash /entrypoint.sh"]
CMD ["set -ex && micromamba install --yes --root-prefix=${__VENVS_PATH__} --prefix=${__VENVS_PATH__} python=${__PYTHON_VERSION__} mamba=${__MAMBA_VERSION__} conda=${__CONDA_VERSION__} && ${__VENVS_PATH__}/bin/mamba init && ${__VENVS_PATH__}/bin/conda config --add channels conda-forge && ${__VENVS_PATH__}/bin/conda config --set channel_priority strict && bash /entrypoint.sh"]

0 comments on commit 68364cb

Please sign in to comment.