Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
version: 2
updates:
- package-ecosystem: "pip"
directories:
- package-ecosystem: "pip"
directories:
- "docs/"
- "scripts/init-realm"
- "acceptance-tests/"
- "global-images/**"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
ignore:
- dependency-name: "python-keycloak"
# I would like to replace this with "version-update:semver-patch", "version-update:semver-minor"
# I would like to replace this with "version-update:semver-patch", "version-update:semver-minor"
# but just want to test this first...
update-types: ["version-update:semver-patch"]
update-types: ["version-update:semver-patch"]
groups:
python:
patterns:
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/build-global-renkulab-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build global base images

on:
push:
paths:
- "global-images/**"
- ".github/workflows/build-global-renkulab-images.yml"
tags:
- "[0-9]+.[0-9]+.[0-9]+"

env:
DOCKER_PREFIX: ghcr.io/swissdatasciencecenter/renku
BUILDER_IMAGE: ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/selector:0.0.6
RUN_IMAGE: ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/base-image:0.0.6
jobs:
build-images:
runs-on: ubuntu-24.04
strategy:
fail-fast: true
matrix:
FLAVOR:
- basic
- datascience
FRONTEND:
- jupyterlab
- vscodium
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_PREFIX }}/py-${{ matrix.FLAVOR }}-${{ matrix.FRONTEND }}
tags: |
type=sha,prefix=
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
type=semver,pattern={{version}},event=tag
- uses: buildpacks/github-actions/setup-pack@v5.0.0
- name: Build image
run: |
tags=$(echo "${{ steps.meta.outputs.tags }}" | tr '\n' ',')
tags=${tags::-1}
TAGS=$tags \
FRONTEND=${{ matrix.FRONTEND }} \
RUN_IMAGE=${{ env.RUN_IMAGE }} \
BUILDER=${{ env.BUILDER_IMAGE }} \
PUBLISH=1 \
EXTRA_FLAGS="--cache-image ${{ env.DOCKER_PREFIX }}/py-${{ matrix.FLAVOR }}-${{ matrix.FRONTEND }}-cache:latest" \
make -C global-images ${{ matrix.FLAVOR }}
59 changes: 37 additions & 22 deletions cypress-tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions global-images/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FRONTEND ?= vscodium
BUILDER ?= ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/selector:0.0.6
RUN_IMAGE ?= ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/base-image:0.0.6
GIT_SHA := $(shell git rev-parse --short=7 HEAD)

.PHONY: all basic datascience

all: basic datascience

basic datascience:
@BASE=$@; \
PUBLISH_FLAG=""; \
if [ -n "$$PUBLISH" ]; then PUBLISH_FLAG="--publish"; fi; \
if [ -n "$$DOCKER_PREFIX" ]; then \
case "$$DOCKER_PREFIX" in \
*/) FINAL_PREFIX="$$DOCKER_PREFIX";; \
*) FINAL_PREFIX="$$DOCKER_PREFIX/";; \
esac; \
else \
FINAL_PREFIX=""; \
fi; \
TAGS=$${TAGS:-$${FINAL_PREFIX}py-$$BASE-$(FRONTEND):$(GIT_SHA)}; \
echo "Building from \"$$BASE\" sub-directory"; \
FIRST_TAG=$${TAGS%%,*}; \
pack build $$FIRST_TAG \
-p $$BASE \
--builder $(BUILDER) \
--run-image $(RUN_IMAGE) \
--env BP_RENKU_FRONTENDS=$(FRONTEND) \
--tag $$TAGS \
$$PUBLISH_FLAG \
$$EXTRA_FLAGS
49 changes: 49 additions & 0 deletions global-images/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Collection of global images for renkulab

The subdirectories here contain basic spec for images that can be used in global session launchers in RenkuLab.
They are built using [buildpacks](https://github.com/SwissDataScienceCenter/renku-frontend-buildpacks/) and contain
some basic libraries. Consult the environment definition files in the subdirectories to see which packages they contain.

## Building

To build the images, install [pack](https://buildpacks.io/docs/for-platform-operators/how-to/integrate-ci/pack/) then run:

```shell
$ make all
```

## Configuration

There are a few environment variables you can set to modify the build.

| Environment Variable | Description | Default |
------------------------------------------------
| BUILDER | Builder image to use | ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/selector:0.0.6 |
| DOCKER_PREFIX | Prefix to use for the image | None |
| FRONTEND | The frontend to add (vscodium or jupyterlab) | vscodium |
| PUBLISH | Push the image to the registry | False |
| RUN_IMAGE | Run image to use | ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/base-image:0.0.6 |
| TAGS | Comma-separated list of image names | None |

## Adding packages to existing images

The python images use poetry (< 2.0) for dependency management. Use poetry to add packages, for example:

```bash
$ cd datascience
$ poetry add tensorflow
```

Make sure `pyproject.toml` and `poetry.lock` are updated and push the changes.

## Adding additional images

To configure an additional image spec to be built, follow these steps:

- create a new sub-directory with the corresponding environment definition file
- add the new directory name to the Makefile targets
- add the directory name to the `FLAVOR` list in the build matrix in `build-global-renkulab-images.yml`

## Publishing

These images are automatically built and published by a GitHub Action whenever the repository is tagged.
7 changes: 7 additions & 0 deletions global-images/basic/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading