Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
f667f1c
additions for eoepca+ release beta01
fabricebrito Sep 20, 2024
3fef71f
Updated version packages on requirements.txt
MicheleSica Sep 25, 2024
96002b7
new Dockerfile improved
MicheleSica Sep 25, 2024
9d1f262
Update Dockerfile set from image
MicheleSica Sep 26, 2024
6de51f7
Create .github-ci.yaml
MicheleSica Sep 26, 2024
77ee30e
Update .github-ci.yaml
MicheleSica Sep 27, 2024
c6a4d23
Update .github-ci.yaml
MicheleSica Sep 27, 2024
75af2db
Update .github-ci.yaml
MicheleSica Sep 27, 2024
fa72cf2
Update .github-ci.yaml
MicheleSica Sep 27, 2024
a7c82f1
Update .github-ci.yaml
MicheleSica Sep 27, 2024
4c6255d
Update requirements.in aligned to requirements.txt
MicheleSica Oct 1, 2024
002182a
fixes for demo cluster
fabricebrito Oct 1, 2024
467b0c4
Merge branch 'eoepca-beta01' of https://github.com/EOEPCA/application…
fabricebrito Oct 1, 2024
f86611d
files for demo
fabricebrito Oct 1, 2024
3efa2d9
removes secret
fabricebrito Oct 1, 2024
ce8b1c9
adds flag to check namespace check and creation
fabricebrito Oct 2, 2024
59fd408
updated config for demos
fabricebrito Oct 2, 2024
2aefd56
bumps image to 1.3.0
fabricebrito Oct 7, 2024
ba4b63c
Update .github-ci.yaml fixed variable
MicheleSica Oct 7, 2024
c47bb38
Update .github-ci.yaml
MicheleSica Oct 8, 2024
ade381e
Update .github-ci.yaml
MicheleSica Oct 8, 2024
651dfdf
Update .github-ci.yaml new configuration
MicheleSica Oct 8, 2024
10d0691
Update .github-ci.yaml
MicheleSica Oct 9, 2024
859ec7b
Update .github-ci.yaml
MicheleSica Oct 9, 2024
0388aab
Update requirements.txt
fabricebrito Oct 15, 2024
62a9aab
Update requirements.txt
fabricebrito Oct 15, 2024
2bef910
removed redundant builds
liviodonnini Oct 15, 2024
bdb313b
fix issue
liviodonnini Oct 15, 2024
8fa3549
fix issue
liviodonnini Oct 15, 2024
ec5be71
added tag to docker image
liviodonnini Oct 15, 2024
02ba446
added tag to docker image
liviodonnini Oct 15, 2024
a4c9fa1
fix saved docker
liviodonnini Oct 15, 2024
68fb7e0
[FIX]Use config_map.name instead of config_map.key
fzingaretti Oct 24, 2024
ab2163d
updated github-ci
liviodonnini Oct 24, 2024
dd69e17
WIP on new chart 4.0.0
fabricebrito Dec 18, 2024
7ab42df
Merge branch 'eoepca-beta01' of https://github.com/EOEPCA/application…
fabricebrito Dec 18, 2024
892c6ef
fix docker CVE-2024-52804
fabricebrito Dec 18, 2024
13f6f61
updates Dockerfile for 4.0.0
fabricebrito Dec 21, 2024
5509810
adds spawner object to manifest templating
fabricebrito Dec 21, 2024
6b91432
adds env from configmap
fabricebrito Dec 21, 2024
3d71d27
adds env from secrets
fabricebrito Dec 21, 2024
da198ba
adds secret mounts
fabricebrito Dec 21, 2024
6f93dfc
add crossplane jelm releases
fabricebrito Dec 21, 2024
2d53789
adds render to config map and object names
fabricebrito Dec 21, 2024
91b4ec7
adds render to all object names
fabricebrito Dec 21, 2024
09e0f1c
tidy requirements.txt
fabricebrito Dec 21, 2024
2804078
fixes hub init script (skaffold)
fabricebrito Dec 21, 2024
8ef5334
add external secrets (WIP)
fabricebrito Dec 21, 2024
e797c92
adds namespace labels
fabricebrito Dec 24, 2024
74ff47d
adds eso secrets - needs a review
fabricebrito Dec 24, 2024
89e7233
removes old helm chart
fabricebrito Dec 24, 2024
ccd38b4
fixes empty envs
fabricebrito Dec 27, 2024
d8ad8b7
fixes manifest persistance
fabricebrito Dec 27, 2024
8f8df19
add crossplane kubernets object
fabricebrito Dec 29, 2024
0ebeafe
fixes the manifest persistence
fabricebrito Dec 29, 2024
975ff21
adds render to environment variables
fabricebrito Jan 5, 2025
c1c390a
render once
fabricebrito Jan 7, 2025
0e5a79e
adds config generator script
fabricebrito Jan 7, 2025
d6d418d
adds config generation in skaffold
fabricebrito Jan 7, 2025
2ab0168
fixes typo in tests
fabricebrito Jan 7, 2025
151d36e
updates
fabricebrito Jan 7, 2025
e0099dc
clean-up
fabricebrito Jan 7, 2025
7771cb1
updates docs CI
fabricebrito Jan 7, 2025
0870ae4
removes docs libraries in CI
fabricebrito Jan 7, 2025
dc21b82
trying trivy CI
fabricebrito Jan 7, 2025
1ed806d
bumps to 1.4.0
fabricebrito Jan 7, 2025
7ad1d9b
removes old docker build CI config
fabricebrito Jan 7, 2025
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
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
jupyterhub
values.yaml
config.yml
config-generator
skaffold.yaml
files/*
171 changes: 171 additions & 0 deletions .github/workflows/.github-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
name: Build, Test, and Deploy Docker Image

on:
push:
branches:
- develop

jobs:
build:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout repository
- uses: actions/checkout@v4

# Step 2: Install Trivy
- name: Install Trivy
run: |
sudo apt-get update -y
sudo apt-get install -y wget apt-transport-https gnupg lsb-release
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt-get update -y
sudo apt-get install -y trivy

# Step 3: Read image name
- name: Read docker name
id: yaml-docker-name
uses: jbutcher5/read-yaml@main
with:
file: 'build.yml'
key-path: '["docker_image_name"]'

# Step 4: Read image version
- name: Read docker version
id: yaml-docker-version
uses: jbutcher5/read-yaml@main
with:
file: 'build.yml'
key-path: '["docker_image_version"]'

# Step 5: Generate Docker tag
- name: Generate docker tag
env:
GITHUB_BRANCH: ${{ github.ref }}
docker_image_name: ${{ steps.yaml-docker-name.outputs.data }}
docker_image_version: ${{ steps.yaml-docker-version.outputs.data }}
run: |
branch_name=${GITHUB_BRANCH#refs/heads/}
echo "branch_name=${GITHUB_BRANCH#refs/heads/}" >> $GITHUB_ENV
if [[ "$branch_name" = "main" ]]
then
mType=""
else
mType="dev"
fi
echo "docker_tag=$docker_image_name:$docker_image_version" >> $GITHUB_ENV
echo "docker_tag_latest=$docker_image_name:latest" >> $GITHUB_ENV
docker_image_application=(${docker_image_name#*/})
echo "docker_image_application=$docker_image_application" >> $GITHUB_ENV
echo "docker_image_version=$docker_image_version" >> $GITHUB_ENV

# Step 6: Build Docker image to inspect it with Trivy
- name: Build Docker image
run: |
tag="${docker_image_application}:${docker_image_version}"
echo "${{ secrets.CR_PASSWORD }}" | docker login -u "${{ secrets.CR_USERNAME }}" --password-stdin "${{ secrets.CR_REGISTRY }}"
docker build -t "${tag}" --file Dockerfile .

# Step 7: Save Docker image as tar.gz
- name: Save Docker Image as tar.gz
run: |
tag="${docker_image_application}:${docker_image_version}"
docker save "${tag}" -o "${docker_image_application}_${docker_image_version}.tar"
tar -czf "${docker_image_application}_${docker_image_version}.tar.gz" "${docker_image_application}_${docker_image_version}.tar"

# Step 8: Upload Docker Image tar.gz as an artifact
- name: Upload Docker Image Artifact
uses: actions/upload-artifact@v3
with:
name: docker-image-tar
path: ${{ env.docker_image_application }}_${{ env.docker_image_version }}.tar.gz


# Step 9: Scan Docker Image with Trivy
- name: Scan Docker Image with Trivy
run: |
tag="${docker_image_application}:${docker_image_version}"
trivy image --no-progress --exit-code 1 --severity HIGH,CRITICAL,UNKNOWN --format table "${tag}"


deploy:
needs: build
runs-on: ubuntu-latest
steps:
# Step 1: Checkout repository
- uses: actions/checkout@v4

# Step 2: Read image name
- name: Read docker name
id: yaml-docker-name
uses: jbutcher5/read-yaml@main
with:
file: 'build.yml'
key-path: '["docker_image_name"]'

# Step 3: Read image version
- name: Read docker version
id: yaml-docker-version
uses: jbutcher5/read-yaml@main
with:
file: 'build.yml'
key-path: '["docker_image_version"]'

# Step 4: Generate Docker tag
- name: Generate docker tag
env:
GITHUB_BRANCH: ${{ github.ref }}
docker_image_name: ${{ steps.yaml-docker-name.outputs.data }}
docker_image_version: ${{ steps.yaml-docker-version.outputs.data }}
run: |
branch_name=${GITHUB_BRANCH#refs/heads/}
echo "branch_name=${GITHUB_BRANCH#refs/heads/}" >> $GITHUB_ENV
echo "docker_tag=$docker_image_name:$docker_image_version" >> $GITHUB_ENV
echo "docker_tag_latest=$docker_image_name:latest" >> $GITHUB_ENV
docker_image_application=(${docker_image_name#*/})
echo "docker_image_application=$docker_image_application" >> $GITHUB_ENV
echo "docker_image_version=$docker_image_version" >> $GITHUB_ENV

# Step 5: Download Docker Image tar.gz Artifact
- name: Download Docker Image Artifact
uses: actions/download-artifact@v3
with:
name: docker-image-tar

# Step 6: Extract the Docker Image tar.gz
- name: Extract Docker Image tar.gz
run: |
tar -xzf "${docker_image_application}_${docker_image_version}.tar.gz"

# Step 7: Load Docker Image
- name: Load Docker Image
run: |
docker load -i "${docker_image_application}_${docker_image_version}.tar"

# Step 8: Log in to Docker Registry (use GitHub secrets for security)
- name: Login to Docker Registry
run: |
echo "${{ secrets.CR_PASSWORD }}" | docker login -u "${{ secrets.CR_USERNAME }}" --password-stdin "${{ secrets.CR_REGISTRY }}"

# Step 9: Push Docker Image to Registry
- name: Push Docker Image to Registry
run: |
tag="${docker_image_application}:${docker_image_version}"
docker tag "${tag}" "${{ secrets.CR_REGISTRY }}"/"${{ secrets.CR_REPO }}"/"${tag}"
docker push "${{ secrets.CR_REGISTRY }}"/"${{ secrets.CR_REPO }}"/"${tag}"

# Step 10: Login Docker Hub
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# Step 11: Push to Docker Hub
- name: push to Docker Hub
run: |
tag="${docker_image_application}:${docker_image_version}"
docker tag "${tag}" "docker.io/${{ env.docker_tag }}"
docker tag "${tag}" "docker.io/${{ env.docker_tag_latest }}"
docker push "docker.io/${{ env.docker_tag }}"
docker push "docker.io/${{ env.docker_tag_latest }}"
60 changes: 0 additions & 60 deletions .github/workflows/build_publish.yml

This file was deleted.

22 changes: 8 additions & 14 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
branches:
- develop
- main
- secrets
paths:
# Only rebuild website when docs have changed
- 'README.md'
Expand All @@ -16,18 +15,13 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout master
uses: actions/checkout@v2

- name: Install Conda environment from environment.yml
uses: mamba-org/provision-with-micromamba@main
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
environment-file: docs/environment.yml
environment-name: env_zoo_calrissian
channels: terradue,eoepca,conda-forge
channel-priority: flexible

- name: Install project
run: |
/home/runner/micromamba-root/envs/env_zoo_calrissian/bin/python setup.py install

- run: /home/runner/micromamba-root/envs/env_zoo_calrissian/bin/mkdocs gh-deploy --force
python-version: 3.x
- run: |
pip install mkdocs-material mkdocs-mermaid2-plugin mkdocs-jupyter
mkdocs gh-deploy --force
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
*.pyc
__pycache__
jupyterhub
values.yaml
*.egg-info
build
_README.md
dist
.env-config-generator
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
args:
- --max-line-length=88
- --max-doc-length=90
- --ignore=E203,W503,W505
- --ignore=E203,W503,W505,F821,E302,E402
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
Expand Down
56 changes: 37 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,58 @@
FROM jupyterhub/k8s-hub:2.0.0
FROM ghcr.io/eoepca/container-k8s-hub/container-k8s-hub:4.0.0

ARG NB_USER=johub
ARG NB_UID=1001
ARG HOME=/home/johub

USER root

RUN apt update && \
apt install npm git sudo -y && \
npm install -g configurable-http-proxy

RUN adduser --disabled-password \
--gecos "Default user" \
# Packages update and dependencies installation
RUN microdnf update -y && \
microdnf install -y \
npm \
git \
sudo \
python3-pip \
python3-devel \
gcc \
libcurl-devel \
openssl-devel \
&& microdnf clean all

# Installation of configurable-http-proxy via npm
RUN npm install -g configurable-http-proxy

# User creation
RUN adduser \
--uid ${NB_UID} \
--home ${HOME} \
--force-badname \
${NB_USER}
${NB_USER} \
--comment "Default user" \
--shell /bin/bash

RUN adduser jovyan sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Add jovyan to the sudoers group
RUN usermod -aG wheel jovyan && \
echo '%wheel ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# Python packages installation from requirements.txt
COPY requirements.txt /tmp/requirements.txt
RUN pip3 install --upgrade --no-cache-dir \
setuptools \
pip
RUN pip3 install --upgrade --no-cache-dir setuptools pip

# Specific Python dependencies installation
RUN PYCURL_SSL_LIBRARY=openssl \
pip install --no-cache-dir \
-r /tmp/requirements.txt
pip install --no-cache-dir -r /tmp/requirements.txt

# Check and correct requirejs version
RUN sed -i 's/"version": "[^"]*"/"version": "2.3.7"/' /usr/local/share/jupyterhub/static/components/requirejs/package.json

# So we can actually write a db file here
# Set permission on the directory /srv/jupyterhub
RUN chown ${NB_USER}:${NB_USER} /srv/jupyterhub

COPY . /tmp
RUN cd /tmp && python setup.py install
RUN cd /tmp && python3 setup.py install

# Set not root user
USER ${NB_USER}

CMD ["jupyterhub", "--config", "/etc/jupyterhub/jupyterhub_config.py"]
# Command to start jupyterhub
CMD ["jupyterhub", "--config", "/etc/jupyterhub/jupyterhub_config.py"]
1 change: 1 addition & 0 deletions application_hub_context/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = "1.3.1"
Loading