Skip to content

Commit

Permalink
remove git-lfs=2.12.0 requirement
Browse files Browse the repository at this point in the history
use mamba instead of conda when possible
remove libc symlink hack
use apt instead of apt-get
  • Loading branch information
vigsterkr authored and rokroskar committed Jun 14, 2022
1 parent 3b491a6 commit db03a95
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 47 deletions.
20 changes: 3 additions & 17 deletions .github/workflows/acceptance_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,14 @@ on:
types:
- synchronize

env:
DOCKER_PLATFORMS: linux/amd64,linux/arm64

jobs:
build-base-python-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
# https://github.com/docker/setup-qemu-action/releases/tag/v1.2.0
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25
- uses: actions/checkout@v2
- name: Build Image
run: |
docker buildx build --platform ${{env.DOCKER_PLATFORMS}} -t py docker/py/
docker build -t py docker/py/
docker save py > /tmp/py.tar
- name: Upload Image Artifact
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -56,18 +47,13 @@ jobs:
with:
name: py
path: /tmp
- name: Set up QEMU
# https://github.com/docker/setup-qemu-action/releases/tag/v1.2.0
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25
- name: Load Base Image in Docker
run: |
docker load --input /tmp/py.tar
- name: Build images
if: ${{ matrix.image_name != 'py' }}
run: |
docker buildx build --platform ${{env.DOCKER_PLATFORMS}} -t ${{ matrix.image_name }} --build-arg ${{ matrix.build_arg }} docker/${{ matrix.image_name }}/
docker build -t ${{ matrix.image_name }} --build-arg ${{ matrix.build_arg }} docker/${{ matrix.image_name }}/
- name: Py Image Acceptance Tests
uses: cypress-io/github-action@v2
env:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/build_and_push_to_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ env:
jobs:

build-py:

runs-on: ubuntu-latest

strategy:
Expand Down Expand Up @@ -84,6 +83,8 @@ jobs:
matrix:
EXTENSIONS:
- vnc
PLATFORMS:
- linux/amd64

steps:
- name: Docker Login
Expand All @@ -106,10 +107,10 @@ jobs:
export LABEL=$(echo ${{ github.sha }} | cut -c 1-7)
fi
docker buildx build --platform ${{env.DOCKER_PLATFORMS}} docker/$EXTENSION \
docker buildx build --platform ${{matrix.PLATFORMS}} docker/$EXTENSION \
--build-arg BASE_IMAGE="$DOCKER_NAME-py:3.9-$LABEL" \
--tag $DOCKER_NAME-$EXTENSION:$LABEL
docker push $DOCKER_NAME-$EXTENSION:$LABEL
--tag $DOCKER_NAME-$EXTENSION:$LABEL \
--push
env:
EXTENSION: ${{ matrix.EXTENSIONS }}

Expand Down Expand Up @@ -470,7 +471,7 @@ jobs:
--build-arg RENKU_BASE="$DOCKER_NAME-py:3.9-$LABEL" \
--build-arg BASE_IMAGE=bioconductor/bioconductor_docker:${{ matrix.RELEASE }} \
--tag $DOCKER_NAME-bioc:$DOCKER_TAG
docker push $DOCKER_NAME-bioc:$DOCKER_TAG
--push
# on master push latest image
if [ "$REF" == "refs/heads/master" ] && [ "${{ matrix.RELEASE }}" == "devel" ]
Expand Down
5 changes: 1 addition & 4 deletions docker/batch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ LABEL maintainer="Swiss Data Science Center <[email protected]>"

# install dependencies
RUN apt-get update -y && \
apt-get install -y curl && \
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get update -y && \
apt-get install -y gcc git git-lfs nodejs && \
apt-get install -y curl gcc git-lfs nodejs && \
apt-get purge && \
apt-get clean && \
apt autoremove --yes && \
Expand Down
4 changes: 1 addition & 3 deletions docker/generic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ RUN apt-get update --fix-missing && \
bzip2 \
ca-certificates \
curl \
gpg-agent && \
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get install -yq --no-install-recommends \
gpg-agent \
git-lfs \
gnupg \
libglib2.0-0 \
Expand Down
20 changes: 13 additions & 7 deletions docker/julia/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ ENV JULIA_PKGDIR=/opt/julia
# If this changes, you also need to change the checksum below
ENV JULIA_VERSION=1.7.1

RUN mkdir /opt/julia-${JULIA_VERSION} && \
cd /tmp && \
wget -q https://julialang-s3.julialang.org/bin/linux/x64/`echo ${JULIA_VERSION} | cut -d. -f 1,2`/julia-${JULIA_VERSION}-linux-x86_64.tar.gz && \
echo "44658e9c7b45e2b9b5b59239d190cca42de05c175ea86bc346c294a8fe8d9f11 *julia-${JULIA_VERSION}-linux-x86_64.tar.gz" | sha256sum -c - && \
tar xzf julia-${JULIA_VERSION}-linux-x86_64.tar.gz -C /opt/julia-${JULIA_VERSION} --strip-components=1 && \
rm /tmp/julia-${JULIA_VERSION}-linux-x86_64.tar.gz
RUN ln -fs /opt/julia-*/bin/julia /usr/local/bin/julia
RUN set -x && \
julia_arch=$(uname -m) && \
julia_short_arch="${julia_arch}" && \
if [ "${julia_short_arch}" == "x86_64" ]; then \
julia_short_arch="x64"; \
fi; \
julia_installer="julia-${JULIA_VERSION}-linux-${julia_arch}.tar.gz" && \
julia_major_minor=$(echo "${JULIA_VERSION}" | cut -d. -f 1,2) && \
mkdir "/opt/julia-${JULIA_VERSION}" && \
wget -q "https://julialang-s3.julialang.org/bin/linux/${julia_short_arch}/${julia_major_minor}/${julia_installer}" && \
tar xzf "${julia_installer}" -C "/opt/julia-${JULIA_VERSION}" --strip-components=1 && \
rm "${julia_installer}" && \
ln -fs /opt/julia-*/bin/julia /usr/local/bin/julia

# Show Julia where conda libraries are \
RUN mkdir /etc/julia && \
Expand Down
17 changes: 7 additions & 10 deletions docker/py/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ LABEL maintainer="Swiss Data Science Center <[email protected]>"
USER root

# Install additional dependencies and nice-to-have packages
RUN apt-get update && apt-get install -yq --no-install-recommends \
RUN apt update && apt install -yq --no-install-recommends \
build-essential \
curl && \
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get update && apt-get install -yq --no-install-recommends \
curl \
git \
git-lfs=2.12.0 \
git-lfs \
gnupg \
graphviz \
jq \
Expand All @@ -30,9 +28,8 @@ RUN apt-get update && apt-get install -yq --no-install-recommends \
python-dev \
unzip \
vim && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1
apt clean && \
rm -rf /var/lib/apt/lists/*

# Add a new group with id 1000 and arbitrary name
# Note: this is to standardize groups between the R and jupyter images
Expand All @@ -51,10 +48,10 @@ RUN python3 -m pip install --no-cache -U pip && \
rm -rf /home/${NB_USER}/.cache

# fix https://github.com/SwissDataScienceCenter/renku-jupyter/issues/14
RUN conda install gxx_linux-64 && \
RUN mamba install -y gxx_linux-64 && \
# jupyter sets channel priority to strict which often causes very long error messages
conda config --system --set channel_priority flexible && \
conda clean --all -f -y
mamba clean --all -f -y

# install renku-python
ENV RENKU_DISABLE_VERSION_CHECK 1
Expand Down
1 change: 0 additions & 1 deletion docker/r/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ RUN apt-get update --fix-missing && \
curl \
gpg-agent && \
curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get update && \
apt-get install -yq --no-install-recommends \
git-lfs \
Expand Down

0 comments on commit db03a95

Please sign in to comment.