Compare commits

...
20 Commits
Author SHA1 Message Date
Adrien Bouvais 8e8ebce721 Moved back test bucket in image
Build and Push Docker Images / build-and-push (push) Successful in 1m6s
2026-08-16 13:52:05 +02:00
Adrien Bouvais 756a781524 Update notebook image path 2026-08-16 13:50:04 +02:00
Adrien Bouvais 0ffe89a881 Moved bucket test py
Build and Push Docker Images / build-and-push (push) Successful in 1m13s
2026-08-16 13:41:20 +02:00
Adrien Bouvais 5287ca66a1 Fix CI tests
Build and Push Docker Images / build-and-push (push) Successful in 1m7s
2026-08-16 13:24:03 +02:00
Adrien Bouvais cb63016421 Added tests for images building
Build and Push Docker Images / build-and-push (push) Failing after 27s
2026-08-16 10:34:32 +02:00
Adrien Bouvais 43802259ed Redo builded action to use only shell 2026-08-16 10:33:09 +02:00
Adrien Bouvais c8046eb98f Added tests to CI
Build and Push Docker Images / build-and-push (push) Failing after 58s
2026-08-15 23:21:26 +02:00
Adrien Bouvais 57d1335fba Fix
Build and Push Docker Images / build-and-push (push) Failing after 34s
2026-08-15 20:14:54 +02:00
Adrien Bouvais ea7ee88ce1 Removed unknow AI stuff 2026-08-15 20:13:43 +02:00
Adrien Bouvais a20c7e2c59 Fix
Build and Push Docker Images / build-and-push (push) Failing after 1m15s
2026-08-15 20:12:15 +02:00
Adrien Bouvais 6945db40e1 With last commit 2026-08-15 20:10:22 +02:00
Adrien Bouvais 1d8cfbfc07 Renamed test_buckets 2026-08-15 20:10:08 +02:00
Adrien Bouvais 74da180a07 Removed label
Build and Push Docker Images / build-and-push (push) Successful in 1m49s
2026-08-15 18:03:21 +02:00
Adrien Bouvais 0aa9488627 Fixs
Build and Push Docker Images / build-and-push (push) Failing after 1m34s
2026-08-15 17:19:35 +02:00
Adrien Bouvais 2782d6d43d Add base build name in jupyter step to build it
Build and Push Docker Images / build-and-push (push) Successful in 4m32s
2026-08-15 16:55:47 +02:00
Adrien Bouvais 82cf6bf7e6 Only on tag push
Build and Push Docker Images / build-and-push (push) Failing after 1m36s
2026-08-15 16:49:27 +02:00
Adrien Bouvais 7662463c7d Removed CI condition
Build and Push Docker Images / build-and-push (push) Failing after 2m58s
2026-08-15 16:45:26 +02:00
Adrien Bouvais 9ee2fd2837 Fix pipeline cred 2026-08-15 16:41:19 +02:00
Adrien Bouvais 2fef740a5f Added tenant-b + removed name in config to use path
Build and Push Docker Images / build-and-push (push) Failing after 29s
2026-08-15 16:38:02 +02:00
Adrien Bouvais 7abb8db1e4 Removed comments
Build and Push Docker Images / build-and-push (push) Failing after 4m51s
2026-08-15 16:26:41 +02:00
9 changed files with 83 additions and 79 deletions
+57 -52
View File
@@ -2,72 +2,77 @@ name: Build and Push Docker Images
on:
push:
branches:
- main
paths:
- 'images/base/**'
- 'images/jupyter/**'
tags:
- 'v*.*.*'
- '*.*.*'
env:
REGISTRY: registry.bouvais.lu
BASE_IMAGE_NAME: something/base
JUPYTER_IMAGE_NAME: something/jupyter
BASE_IMAGE_NAME: tenant/base
JUPYTER_IMAGE_NAME: tenant/jupyter
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
run: |
docker login ${{ env.REGISTRY }} \
--username adrien \
--password "${{ secrets.DOCKER_PASSWORD }}"
# --- 1. BUILD BASE IMAGE ---
- name: Extract metadata for Base
id: meta-base
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
type=sha,format=short
type=semver,pattern={{version}}
# --- 1. BUILD & TEST BASE IMAGE ---
- name: Build Base image
run: |
docker build \
-f ./images/base/dockerfile \
-t ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ github.ref_name }} \
./images/base
- name: Build and push Base image
uses: docker/build-push-action@v5
with:
context: ./images/base
# Note: Linux is case-sensitive. If your file is literally lowercase "dockerfile", change this to "dockerfile"
file: ./images/base/Dockerfile
push: true
tags: ${{ steps.meta-base.outputs.tags }}
labels: ${{ steps.meta-base.outputs.labels }}
- name: Test Base image
run: |
cid=$(docker create -u root -w /tests ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ github.ref_name }} sleep 60)
docker start "$cid"
docker cp ${{ github.workspace }}/tests/. "$cid":/tests
docker exec "$cid" python3 /tests/base.py
docker rm -f "$cid"
# --- 2. BUILD JUPYTER IMAGE ---
- name: Extract metadata for Jupyter
id: meta-jupyter
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
type=sha,format=short
type=semver,pattern={{version}}
- name: Tag Base image as latest
run: |
docker tag ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ github.ref_name }} \
${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:latest
- name: Build and push Jupyter image
uses: docker/build-push-action@v5
with:
context: ./images/jupyter
file: ./images/jupyter/Dockerfile
push: true
tags: ${{ steps.meta-jupyter.outputs.tags }}
labels: ${{ steps.meta-jupyter.outputs.labels }}
- name: Push Base image
run: |
docker push ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ github.ref_name }}
docker push ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:latest
# --- 2. BUILD & TEST JUPYTER IMAGE ---
- name: Build Jupyter image
run: |
docker build \
-f ./images/jupyter/dockerfile \
--build-arg BASE_IMAGE=${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ github.ref_name }} \
-t ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:${{ github.ref_name }} \
./images/jupyter
- name: Test Jupyter dependencies
run: |
cid=$(docker create -w /tests ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:${{ github.ref_name }} sleep 60)
docker start "$cid"
docker cp ${{ github.workspace }}/tests/. "$cid":/tests
docker exec "$cid" python3 /tests/dependencies.py
docker rm -f "$cid"
- name: Tag Jupyter image as latest
run: |
docker tag ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:${{ github.ref_name }} \
${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:latest
- name: Push Jupyter image
run: |
docker push ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:${{ github.ref_name }}
docker push ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:latest
+7 -3
View File
@@ -5,6 +5,7 @@ metadata:
namespace: argocd
spec:
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- git:
repoURL: https://git.bouvais.lu/adrien/ctie-exercice
@@ -13,7 +14,7 @@ spec:
- path: "tenants/*/config.yaml"
template:
metadata:
name: 'tenant-{{.name}}'
name: 'tenant-{{ trimPrefix "tenant-" .path.basename }}'
spec:
project: tenants
sources:
@@ -22,13 +23,16 @@ spec:
path: charts/tenant
helm:
valueFiles:
- '$values/tenants/tenant-{{.name}}/config.yaml'
- '$values/{{.path.path}}/config.yaml'
parameters:
- name: name
value: '{{ trimPrefix "tenant-" .path.basename }}'
- repoURL: https://git.bouvais.lu/adrien/ctie-exercice
targetRevision: main
ref: values
destination:
server: https://kubernetes.default.svc
namespace: 'tenant-{{.name}}'
namespace: 'tenant-{{ trimPrefix "tenant-" .path.basename }}'
syncPolicy:
automated:
prune: true
-7
View File
@@ -1,17 +1,11 @@
FROM python:3.12-slim-bookworm AS base
LABEL org.opencontainers.image.title="tenant-base" \
org.opencontainers.image.description="Hardened base image for tenant workspaces" \
org.opencontainers.image.source="https://git.bouvais.lu/adrien/"
# System deps only — keep this layer stable so it's rarely rebuilt
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
tini \
&& rm -rf /var/lib/apt/lists/*
# Non-root user, fixed UID/GID for predictable K8s securityContext
RUN groupadd --gid 1000 appuser \
&& useradd --uid 1000 --gid appuser --shell /bin/bash --create-home appuser
@@ -19,4 +13,3 @@ WORKDIR /home/appuser
USER appuser
ENTRYPOINT ["tini", "--"]
+2 -8
View File
@@ -1,21 +1,15 @@
ARG BASE_IMAGE=registry.bouvais.lu/tenant-base:1.0.0
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title="tenant-jupyter" \
org.opencontainers.image.description="JupyterLab image built on tenant-base" \
org.opencontainers.image.base.name="${BASE_IMAGE}"
USER root
COPY --chown=appuser:appuser test_buckets.py /home/appuser/work/test_buckets.py
COPY --chown=appuser:appuser requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt \
&& rm /tmp/requirements.txt
# No secrets baked in — S3 creds come from a mounted K8s Secret / env at runtime
USER appuser
WORKDIR /home/appuser/work
COPY --chown=appuser:appuser test_script.py /home/appuser/test_script.py
EXPOSE 8888
CMD ["jupyter", "lab", \
+2 -9
View File
@@ -1,8 +1,6 @@
name: "a" # TODO: Remove this and use path instead
image:
repository: registry.bouvais.lu/tenant-jupyter
tag: "1.0.0"
repository: registry.bouvais.lu/tenant/jupyter
tag: "1.0.1"
resources:
requests:
@@ -12,8 +10,3 @@ resources:
cpu: "1"
memory: 2Gi
gpu:
enabled: true
type: "t4" # one of: none | t4 | a100 | l4
count: 1
+11
View File
@@ -0,0 +1,11 @@
image:
repository: registry.bouvais.lu/tenant/jupyter
tag: "1.0.1"
resources:
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: "1"
memory: 2Gi
+1
View File
@@ -0,0 +1 @@
print("SUCCESS: Python works.")
+3
View File
@@ -0,0 +1,3 @@
import os
import boto3
print("SUCCESS: Import works.")