Skip to content

Commit 328cecb

Browse files
authored
feat: Add jupyter-notebook container (#88)
1 parent df88e13 commit 328cecb

6 files changed

Lines changed: 86 additions & 10 deletions

File tree

.github/dependabot.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,9 @@ updates:
1010
directories:
1111
- 'src/**/*'
1212
schedule:
13-
interval: 'daily'
13+
interval: 'daily'
14+
- package-ecosystem: 'pip'
15+
directories:
16+
- 'src/dockerfiles/jupyter-gap/ubuntu-2204-lts/'
17+
schedule:
18+
interval: 'daily'

.github/workflows/main.yaml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ jobs:
4646
operating-system-base: ${{ fromJSON(needs.define-matrix.outputs.systems) }}
4747
uses: ./.github/workflows/worflow-dispatch-build.yaml
4848
with:
49-
gap-build: bare
49+
gap-type: gap
50+
target: bare
5051
gap-version: ${{ matrix.gap-version }}
5152
operating-system-base: ${{ matrix.operating-system-base }}
5253

@@ -61,7 +62,8 @@ jobs:
6162
operating-system-base: ${{ fromJSON(needs.define-matrix.outputs.systems) }}
6263
uses: ./.github/workflows/worflow-dispatch-build.yaml
6364
with:
64-
gap-build: slim
65+
gap-type: gap
66+
target: slim
6567
gap-version: ${{ matrix.gap-version }}
6668
operating-system-base: ${{ matrix.operating-system-base }}
6769

@@ -77,6 +79,25 @@ jobs:
7779
operating-system-base: ${{ fromJSON(needs.define-matrix.outputs.systems) }}
7880
uses: ./.github/workflows/worflow-dispatch-build.yaml
7981
with:
80-
gap-build: full
82+
gap-type: gap
83+
target: full
84+
gap-version: ${{ matrix.gap-version }}
85+
operating-system-base: ${{ matrix.operating-system-base }}
86+
87+
build-full-jupyter:
88+
needs:
89+
- define-matrix
90+
- build-bare
91+
- build-slim
92+
- build-full
93+
strategy:
94+
fail-fast: true
95+
matrix:
96+
gap-version: ${{ fromJSON(needs.define-matrix.outputs.versions) }}
97+
operating-system-base: ${{ fromJSON(needs.define-matrix.outputs.systems) }}
98+
uses: ./.github/workflows/worflow-dispatch-build.yaml
99+
with:
100+
gap-type: jupyter-gap
101+
target: full
81102
gap-version: ${{ matrix.gap-version }}
82103
operating-system-base: ${{ matrix.operating-system-base }}

.github/workflows/worflow-dispatch-build.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ name: Docker - build and publish image
33
on:
44
workflow_call:
55
inputs:
6+
gap-type:
7+
required: true
8+
type: string
69
gap-version:
710
required: true
811
type: string
9-
gap-build:
12+
target:
1013
required: true
1114
type: string
1215
operating-system-base:
@@ -30,10 +33,10 @@ jobs:
3033
uses: docker/metadata-action@v5
3134
with:
3235
images: |
33-
name=ghcr.io/${{ github.repository }}
36+
name=ghcr.io/${{ github.repository_owner }}/${{ inputs.gap-type }}
3437
tags: |
3538
type=sha,priority=100
36-
type=raw,priority=900,value=${{ inputs.gap-version }}-${{ inputs.gap-build }}
39+
type=raw,priority=900,value=${{ inputs.gap-version }}-${{ inputs.target }}
3740
3841
3942
- name: 📦 docker -- login to ghcr-registry
@@ -54,12 +57,12 @@ jobs:
5457
- name: 🐬 docker -- build and push
5558
uses: docker/build-push-action@v6
5659
with:
57-
context: ./src/dockerfiles/${{ inputs.operating-system-base }}
58-
file: ./src/dockerfiles/${{ inputs.operating-system-base }}/Dockerfile
60+
context: ./src/dockerfiles/${{ inputs.gap-type}}/${{ inputs.operating-system-base }}
61+
file: ./src/dockerfiles/${{ inputs.gap-type}}/${{ inputs.operating-system-base }}/Dockerfile
5962
push: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
6063
tags: ${{ steps.meta.outputs.tags }}
6164
labels: ${{ steps.meta.outputs.labels }}
62-
target: ${{ inputs.gap-build }}
65+
target: ${{ inputs.target }}
6366
cache-from: type=gha
6467
cache-to: type=gha,mode=max`
6568
build-args: |
File renamed without changes.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## {{{
2+
ARG GAP_VERSION="4.12.1"
3+
ARG DOCKER_BASE_IMAGE_URL="ghcr.io/limakzi/gap-docker:${GAP_VERSION}-full"
4+
## }}}
5+
6+
## {{{
7+
ARG JUPYTER_KERNEL_PATH="/opt/gap/gap-${GAP_VERSION}/pkg/jupyterkernel/"
8+
## }}}
9+
10+
## {{{
11+
ARG GAP_USER_USERNAME="gap"
12+
ARG GAP_USER_GROUPNAME="gap"
13+
ARG GAP_USER_UID=1000
14+
ARG GAP_USER_GID=1000
15+
ARG GAP_USER_SHELL="/bin/bash"
16+
ARG GAP_USER_HOMEDIR="/opt/gap"
17+
## }}}
18+
19+
FROM ${DOCKER_BASE_IMAGE_URL} AS full
20+
21+
EXPOSE 8888
22+
23+
ARG GAP_USER_GID
24+
ARG GAP_USER_GROUPNAME
25+
ARG GAP_USER_UID
26+
ARG GAP_USER_USERNAME
27+
ARG GAP_USER_HOMEDIR
28+
ARG JUPYTER_KERNEL_PATH
29+
30+
USER 'root'
31+
32+
RUN apt-get -y clean && \
33+
apt-get -y update && \
34+
apt-get -y install python3-pip
35+
36+
USER ${GAP_USER_USERNAME}
37+
ENV PATH="/opt/gap/.local/bin/:${JUPYTER_KERNEL_PATH}/bin/:${PATH}"
38+
ENV JUPYTER_GAP_EXECUTABLE "gap"
39+
40+
COPY ./requirements.txt ./
41+
RUN pip3 install -r requirements.txt
42+
RUN pip3 install --no-dependencies ${JUPYTER_KERNEL_PATH}
43+
44+
WORKDIR "/tmp"
45+
46+
CMD ["jupyter-lab", "--ip=0.0.0.0"]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
jupyterlab==4.3.3

0 commit comments

Comments
 (0)