Skip to content

Commit

Permalink
feat: add base image for batch execution (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
TaoSunVoyage authored Aug 12, 2021
1 parent 35900b0 commit 141a832
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build_and_push_to_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,34 @@ jobs:
EXTENSION: ${{ matrix.EXTENSIONS }}
DOCKER_NAME: "renku/renkulab"

build-py-batch:
needs: build-py
runs-on: ubuntu-latest

steps:
- name: Docker Login
uses: Azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- uses: actions/checkout@v2
- name: Build renku project python-based docker image for batch execution
run: |
if [[ ${{ github.ref }} == refs/tags* ]]; then
export LABEL=$(echo ${{ github.ref }} | cut -d / -f 3)
else
export LABEL=$(echo ${{ github.sha }} | cut -c 1-7)
fi
docker build docker/batch \
--build-arg RENKU_BASE="$DOCKER_NAME-py:3.9-$LABEL" \
--build-arg BASE_IMAGE="python:3.9-slim" \
--tag $DOCKER_NAME-batch:$LABEL
docker push $DOCKER_NAME-batch:$LABEL
env:
DOCKER_NAME: "renku/renkulab"

build-julia-ext:
needs: build-py
runs-on: ubuntu-latest
Expand Down
34 changes: 34 additions & 0 deletions docker/batch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# define build arguments
ARG RENKU_BASE=renku/renkulab-py:latest
ARG BASE_IMAGE=python:3.9-slim

# define base images
FROM $RENKU_BASE as renku_base
FROM $BASE_IMAGE

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 git git-lfs nodejs && \
apt-get purge && \
apt-get clean && \
apt autoremove --yes && \
rm -rf /var/lib/apt/lists/*

RUN pip install pipx

# override default locations of pipx and app installation
ENV PIPX_BIN_DIR /share/bin
ENV PIPX_HOME /share/pipx
ENV PATH /share/bin:$PATH

# install renku-python
RUN pipx install --pip-args="--no-cache" renku

# inject entrypoint.sh
COPY --from=renku_base /entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

0 comments on commit 141a832

Please sign in to comment.