commit eab696d011242e71c2ec2e3a43cd28452645c6e9 Author: redxef Date: Sat Jun 22 13:10:49 2024 +0200 Initial commit, add Docker file and ci pipeline. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1fd6a1e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM quay.io/jupyter/datascience-notebook + +USER root +RUN apt update && apt -y --no-install-recommends upgrade +USER ${NB_UID} +RUN mamba install --yes \ + sage \ + && mamba clean --all -f -y \ + && fix-permissions "${CONDA_DIR}" \ + && fix-permissions "/home/${NB_USER}" + diff --git a/ci/pipeline.yml b/ci/pipeline.yml new file mode 100644 index 0000000..8ad5a1a --- /dev/null +++ b/ci/pipeline.yml @@ -0,0 +1,119 @@ +--- +resource_types: +- name: oci-image + type: registry-image + source: + repository: redxef/concourse-oci-resource + tag: latest + +resources: +- name: source + type: git + source: + uri: https://gitea.redxef.at/redxef/jupyter-docker-spawner-image + branch: main + fetch_tags: true +- name: upstream-image + type: registry-image + check_every: 6h + source: + repository: quay.io/jupyter/datascience-notebook +- name: image + type: oci-image + source: + repository: redxef/jupyter-docker-spawner-image + tag: edge + username: ((docker.username)) + password: ((docker.password)) + +jobs: +- name: build-push-edge + plan: + - get: source + trigger: true + - get: upstream-image + trigger: true + - task: compute-docker-tags + config: + platform: linux + image_resource: + type: registry-image + source: + repository: alpine/git + inputs: + - name: source + path: . + outputs: + - name: docker-tags + run: + path: sh + args: + - -c + - | + #!/usr/bin/env sh + git rev-parse --short HEAD > docker-tags/tags.txt + git show-ref --tags | \ + sed -n "/$(git rev-parse HEAD)/ s|$(git rev-parse HEAD).refs/tags/||gp" \ + >> docker-tags/tags.txt + - task: build + privileged: true + config: + platform: linux + image_resource: + type: registry-image + source: + repository: redxef/concourse-buildkit + inputs: + - name: source + path: . + outputs: + - name: build-output + params: + dest: build-output/image.tar + platform: aarch64,arm,i386,ppc64le,s390x,x86_64 + run: + path: build + - put: image + inputs: + - build-output + - docker-tags + params: + image: build-output/image.tar + additional_tags: docker-tags/tags.txt + +- name: test + plan: + - get: image + trigger: true + passed: + - build-push-edge + +- name: tag-latest + plan: + - get: image + trigger: true + passed: + - test + - task: write-latest-file + config: + platform: linux + image_resource: + type: registry-image + source: + repository: alpine + outputs: + - name: latest-tag + run: + path: sh + args: + - -c + - | + #!/usr/bin/env sh + echo latest > latest-tag/tags.txt + - put: image + inputs: + - image + - latest-tag + params: + image: image/image.tar + additional_tags: latest-tag/tags.txt