Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
210 commits
Select commit Hold shift + click to select a range
1de66f7
style: fix code style and add tests
rokroskar Jun 3, 2019
ebcdb0d
refactor: increase encapsulation; minor bug fixes
mohammad-alisafaee Jun 3, 2019
9faaa28
feat: spawn new server for different branch
rokroskar Jun 19, 2019
d90487e
use Kubernetes api for notebook queries (#185)
mohammad-alisafaee Jun 26, 2019
77a7790
fix: uncaught exception when creating notebooks
mohammad-alisafaee Jun 26, 2019
e264540
fix: use local and remote shortened commit-sha to recover from autosa…
mohammad-alisafaee Jul 9, 2019
1f53431
feat: implement new notebook API
mohammad-alisafaee Jun 12, 2019
90d3689
feat: can force delete pods (#205)
mohammad-alisafaee Aug 23, 2019
04897a1
refactor: add more logs (#207)
mohammad-alisafaee Aug 29, 2019
05adf37
restore telepresence script (#209)
lorenzo-cavazzi Sep 11, 2019
6c847b5
feat: use project name in the notebook URL (#211)
lorenzo-cavazzi Sep 13, 2019
618feed
feat: handle k8s api errors when querying for logs (#216)
lorenzo-cavazzi Oct 15, 2019
a2ad149
feat: update server_logs api (#225)
lorenzo-cavazzi Jan 17, 2020
9ab32e1
chore: update werkzeug behavior (#242)
rokroskar Feb 7, 2020
cb246e1
feat: add requested resources info to servers endpoint (#261)
lorenzo-cavazzi Mar 16, 2020
5bbbb74
fix: use registry API to find image
rokroskar Mar 23, 2020
4935c96
feat: allow unprivileged an anonymous users to launch servers
Apr 3, 2020
4ff2832
fix: use lowercase image repository names
rokroskar Apr 28, 2020
22223e7
feat: use user credentials for pulling images (#327)
rokroskar Jun 10, 2020
959cf0e
fix(app): escape username in registry secret name
Oct 4, 2020
4088eb4
chore: add sentry environment (#434)
rokroskar Oct 15, 2020
a5a40e7
feat: automatically remove user registry secrets (#435)
olevski Oct 26, 2020
9564772
bug: fix cull secrets failures with pods forked repos
olevski Nov 18, 2020
bc9435d
feat: specify image in server request
olevski Nov 24, 2020
bb256a1
feat(app): move gitlab oauth token to separate proxy container
Nov 30, 2020
27c1762
bug: launching sessions that are part of a subgroup fails (#493)
olevski Jan 6, 2021
5ff4a87
fix: properly recognize pod status when terminating (#497)
olevski Jan 8, 2021
a63c659
refactor: define models and schemas (#480)
olevski Jan 15, 2021
b7745c0
fix: remove unneccessary log error calls (#512)
olevski Jan 15, 2021
69a2b71
fix: pod resources schema (#513)
olevski Jan 15, 2021
4ea77af
fix: retry when creating notebook fails with 500 (#518)
olevski Jan 28, 2021
aa718c1
feat: validate server options (#529)
olevski Feb 3, 2021
a28f4f7
fix: unknown gpu field in resources request (#538)
olevski Feb 5, 2021
acd7aad
fix: do not check defaultUrl against list of server options (#542)
olevski Feb 10, 2021
877c444
fix: allow and include unknown annotations in schema (#546)
olevski Feb 11, 2021
cadc353
fix: labels values are too long for k8s (#553)
olevski Feb 20, 2021
0a32f06
feat: use pvs for user sessions (#573)
rokroskar Mar 22, 2021
d4479d4
refactor: use python classes (#541)
olevski Mar 26, 2021
f126044
fix: increase huboauth caching from 1min to 5min (#603)
olevski Apr 13, 2021
afda80b
feat: endpoint for autosave information (#607)
olevski Apr 16, 2021
9a98de8
fix missing annotations handling in marshmallow (#637)
olevski Apr 27, 2021
58b1f6d
feat: cleanup PVS and autosave branches (#611)
olevski May 4, 2021
d866249
fix: remove disk request values (#657)
olevski May 14, 2021
31beed9
fix: properly assign default server option values (#649)
olevski May 31, 2021
4ab422a
Add autosave delete endpoint (#673)
olevski Jun 5, 2021
ecf33bb
chore: dependabot Updates Batch (#705)
olevski Jul 21, 2021
c375d91
fix: properly display storage (#708)
olevski Jul 23, 2021
9999f29
fix: upper case letters in pvc name (#713)
olevski Jul 28, 2021
8ccf7e4
fix: failing on pvcs created with old 0.8.4 renku verison pvc naming …
olevski Jul 29, 2021
faba5be
fix: listing sessions when a project has been deleted (#718)
olevski Aug 5, 2021
66052b2
fix: bugs with mistyped variable and missing branches in autosaves (#…
olevski Aug 10, 2021
60eb80c
feat: use Amalthea to run sessions through a K8s operator (#668)
olevski Sep 15, 2021
ba20a15
fix: use `jupyter notebook` as arg for launching a server
olevski Sep 16, 2021
dcd29b7
chore: prep release 1.0.0 (#755)
olevski Sep 17, 2021
3041a04
fix(app): when a gitlab project does not exist log a warning instead …
olevski Oct 4, 2021
a1d164c
fix(app): use the right storage class name parameter in Jupyter serve…
olevski Oct 6, 2021
c26bccf
feat(app): option to not limit size of user session emptyDir (#785)
olevski Oct 26, 2021
2c4a343
fix(app): displaying gpu resources in API responses (#786)
olevski Oct 26, 2021
b5e074a
fix: add ingress annotation to each session so iframes work (#794)
olevski Nov 8, 2021
7a77228
fix(app): check out the correct branch instead of always master(#802)
olevski Nov 11, 2021
835a182
feat(chart): add session tolerations, affinity, nodeSelector (#806)
olevski Nov 15, 2021
1f8772d
fix(app): do not delete autosaves before restoring (#814)
olevski Nov 18, 2021
bd7cf1d
fix(app): use pyjwt to decode token (#818)
olevski Nov 23, 2021
dea4ab4
fix(app): apply CPU limits to user sessions (#826)
olevski Nov 28, 2021
eda1ddf
fix(app): use 3 scenarios for session cpu limits (#828)
olevski Nov 30, 2021
27cc804
fix(app): user not authenticated and anonymous sessions not allowed (…
olevski Nov 30, 2021
71827d0
fix(app): return proper values for image and repository (#834)
olevski Dec 2, 2021
7b7a56d
fix(app): do not accept an empty anonymous user id (#845)
olevski Dec 7, 2021
59979f3
feat(app): enable age-based session culling (#848)
olevski Dec 13, 2021
8aebfa9
fix(app): case insensitive project and namespace (#858)
olevski Jan 19, 2022
a723aea
feat: mount s3 buckets in sessions (#729)
olevski Jan 20, 2022
192b9f3
feat: modify for custom CA certificates (#788)
olevski Jan 28, 2022
f564d2b
chore: fix swagger page (#894)
olevski Jan 31, 2022
73abd60
chore(app): enable sentry performance monitoring (#907)
olevski Feb 3, 2022
e6d41b8
fix(app)!: change s3 bucket naming (#922)
olevski Feb 11, 2022
ef7eea7
build: update sentry values (#912)
lorenzo-cavazzi Feb 14, 2022
353e7dd
chore: Dependabot updates batch (#917)
olevski Feb 15, 2022
19f1c65
fix(app): remove S3 flag from server options (#940)
olevski Feb 18, 2022
875b9f1
feat(app): version endpoint (#938)
mohammad-alisafaee Feb 28, 2022
bfa5dd1
feat(app)!: better messages on session launch fail (#923)
olevski Mar 11, 2022
9c58761
feat(app): return logs from all containers (#887)
olevski Mar 14, 2022
f988b1e
fix(app): enable s3 flag in server options (#969)
olevski Mar 18, 2022
72879e5
feat(app): use python for git clone (#956)
olevski Mar 21, 2022
2ab48b4
feat(app): add sentry to git clone (#963)
olevski Mar 22, 2022
9304fbf
feat(app): add endpoint to verify docker image availability (#990)
lorenzo-cavazzi Apr 4, 2022
ec6571f
fix(app): keep git-proxy alive on session shutdown (#951)
olevski Apr 11, 2022
6a5a96d
chore: run as non-root (#1020)
olevski Apr 13, 2022
dceae82
chore: set runAsNonRoot to true (#1031)
olevski Apr 25, 2022
62aab53
fix(app): eliminate unnecessary gitlab calls (#1035)
olevski Apr 26, 2022
db3f005
feat: add git error codes to notebooks response (#1055)
Panaetius May 18, 2022
80880dd
enahance(app): minimize gitlab api calls (#1087)
olevski Jun 1, 2022
875ffb5
chore: bump pyjwt from 1.7.1 to 2.4.0 (#1079)
dependabot[bot] Jun 10, 2022
fa37e08
fix(app): s3 bucket location (#1083)
olevski Jun 10, 2022
72d6cd1
feat(app): surface message and status when pod is unschedulable (#1088)
olevski Jun 10, 2022
23d20c2
feat(app): show session resource usage (#968)
olevski Jun 13, 2022
8ab720f
fix(app): show starting message (#1099)
olevski Jun 13, 2022
6ffc354
fix(app): handle missing project in autosave list (#1090)
olevski Jun 13, 2022
7f26941
fix(app): custom certs env variables in git clone (#1101)
olevski Jun 13, 2022
2614ad6
fix(app): serialize cpu and gpu request to number (#1103)
olevski Jun 13, 2022
55700b4
fix(app): no main pod in status when getting logs (#1104)
olevski Jun 14, 2022
de75365
fix(app): properly deserialize server options (#1108)
olevski Jun 15, 2022
d3f1da9
fix(app): cloudstorage in server_options schema (#1113)
olevski Jun 21, 2022
22b821b
fix(app): parse unschedulable resources message (#1114)
olevski Jun 21, 2022
8e69d45
fix(app): list autosaves only for the current user (#1118)
olevski Jun 21, 2022
04d0ef3
fix(app): handle endpoints for s3 not on AWS (#1124)
olevski Jun 23, 2022
3ed2075
feat: add support for passing env variables to notebooks (#1131)
Panaetius Jul 4, 2022
5766aae
chore(app): fix for updating gitlab sdk to 3.6.0 (#1169)
olevski Jul 19, 2022
5b02f98
fix(app): listing autosaves and debug statements (#1168)
olevski Jul 19, 2022
ec650ed
fix(app): show latest unschedulable message (#1161)
olevski Jul 20, 2022
44eb06f
chore(app): document max lines for getting logs (#1184)
olevski Aug 2, 2022
39617eb
feat(app): use dataconf and telepresence (#1186)
olevski Aug 2, 2022
faa45ce
chore: use 'sub' JWT field for user id (#1199)
olevski Aug 8, 2022
26e65f4
enhancement(app): standardized error responses (#849)
olevski Aug 16, 2022
4cb4be7
fix(app): usernames starting with numbers/symbols (#1213)
olevski Aug 17, 2022
bb9afb4
feat(app): add auth and expose rpc server sidecar (#762)
olevski Aug 24, 2022
7739b12
feat(sidecar): run renku cli commands in rpc server (#1219)
olevski Aug 24, 2022
6178513
feat(app): add session url env var (#1231)
mohammad-alisafaee Aug 30, 2022
2a81c7a
feat(sidecar): symlink cloudstorage into project (#1230)
Panaetius Aug 30, 2022
973565f
chore(app): reduce image size (#1239)
olevski Sep 20, 2022
ab65157
feat(app): detailed status messages (#1289)
olevski Oct 14, 2022
d4dce70
feat(app): add jupyter server caching and multiple namespace support …
olevski Nov 18, 2022
2f5f228
fix: accept zero as max_lines parameter for logs (#1336)
olevski Nov 29, 2022
ade924f
fix: handle Gitlab token expiry (#1338)
olevski Dec 8, 2022
7af0b60
fix(app): snyk vulnerabilities (#1341)
olevski Dec 9, 2022
fc7fb01
fix(app): propagate environment variables for R (#1339)
olevski Dec 14, 2022
8f6ce8a
feat(app): experimental azure blob storage support (#1374)
olevski Jan 10, 2023
b2e1514
feat(session): fail when injecting env vars that exist in session (#1…
mohammad-alisafaee Feb 13, 2023
ffd3e1f
feat: ssh access to sessions with jump host (#1389)
olevski Feb 15, 2023
ff0edf5
fix(app): show if ssh enabled in /version (#1407)
olevski Feb 16, 2023
703913b
fix(app): missing return statement (#1412)
olevski Feb 24, 2023
ffc693c
fix(app): server filtering parameter names (#1423)
olevski Mar 20, 2023
9bd27ea
feat(app): use crc service (#1483)
olevski Jul 5, 2023
94c224c
chore: update python dependencies (#1557)
olevski Aug 3, 2023
7a5604d
feat: add session warnings to jupyter server API responses (#1482)
Panaetius Aug 3, 2023
fb11fb6
fix(app): parse old server options in request (#1570)
olevski Aug 11, 2023
4073527
chore: add resource quota label (#1613)
rokroskar Sep 5, 2023
36b8ce1
feat(app): use PV to hibernate/resume sessions (#1518)
mohammad-alisafaee Sep 14, 2023
55d8b9b
feat(app): use tolerations and affinities from CRC (#1626)
olevski Sep 28, 2023
e78ab25
fix(app): fix session hibernation (#1645)
mohammad-alisafaee Oct 2, 2023
b7a0a5b
feat: add support for new cloud storage (#1614)
Panaetius Oct 9, 2023
b46ca93
fix secret order and mount path check (#1666)
Panaetius Oct 16, 2023
3d0e3a8
fix: overwrite existing files with storage mounts (#1672)
olevski Oct 19, 2023
f49ae98
fix(app): handle OCI image manifests (#1673)
olevski Oct 20, 2023
62040f7
chore: do not set oauth2proxy version in notebooks (#1644)
olevski Oct 23, 2023
92412a0
fix: scientific notation integer parsing in config (#1662)
olevski Oct 23, 2023
9c450ef
fix: properly patch tolerations and affinities (#1695)
olevski Nov 6, 2023
7120e51
fix: patch in a larger value for /dev/shm (#1723)
olevski Dec 8, 2023
7eb612b
fix: inject new set of tokens when the session is resumed (#1734)
olevski Dec 14, 2023
402efd5
fix: handle missing gitlab tokens (#1735)
olevski Dec 15, 2023
aa2baf0
feat: rclone csi support (#1707)
Panaetius Jan 15, 2024
e326095
feat: allow patching of resource class (#1728)
olevski Jan 16, 2024
13fdd60
feat: support for renku 2 sessions (#1810) (#1815)
leafty Mar 19, 2024
7e68e1e
chore: combined dependency update (#1825)
github-actions[bot] Apr 8, 2024
5eb49eb
fix: project path case sensitivity (#1857)
olevski May 3, 2024
7606156
fix: make dataconf ignore unexpected env vars (#1866)
Panaetius May 10, 2024
e565961
feat: add sidecar for mounting secrets (#1847)
Panaetius May 10, 2024
87c766f
feat: support connected services (#1874)
leafty May 16, 2024
6f9cbd4
fix: do not setup any git provider for anonymous sessions (#1879)
leafty May 17, 2024
9c5a34f
feat: restrict secrets mount paths (#1873)
Panaetius May 21, 2024
4b65e56
fix: remove subpath "None" from sidecar container for Renku 2.0 sessi…
leafty May 21, 2024
0b3bd25
feat: custom culling times (#1852)
Panaetius May 22, 2024
9f3eda9
fix: do not add storage mounts patches when a session has no reposito…
leafty May 28, 2024
12fb497
chore: add kubernetes_asyncio
olevski Jun 14, 2024
15462f8
refactor: split the service into components
rokroskar Jun 2, 2019
d417783
feat: update and expand apispec for environments
olevski Jul 10, 2024
559f07e
chore: filter environments by owner type
olevski Jul 11, 2024
86b8962
squashme: address comments
olevski Jul 12, 2024
691edb6
feat: notebook changes
olevski Jul 19, 2024
1bd387b
Merge branch 'main' into feat-run-notebook-service
olevski Jul 19, 2024
47cba96
squashme: get type checks into semi-normal state
olevski Jul 20, 2024
625fee8
fix: typing for decorators
olevski Jul 21, 2024
a1764ef
Merge branch 'feat-add-new-environments-apispec' into feat-expand-env…
olevski Jul 30, 2024
0f00298
feat!: expand environment specification
olevski Aug 2, 2024
6c34b27
chore: add tests and minor fixes
olevski Aug 2, 2024
1bb167e
chore: test the global environments migration
olevski Aug 2, 2024
35f5c8e
chore: fix tests
olevski Aug 2, 2024
a821046
chore: minor improvements to db session handling
olevski Aug 2, 2024
fac749a
Merge branch 'feat-expand-environments-specification' into feat-run-n…
olevski Aug 2, 2024
5a24a91
squashme: minor fix
olevski Aug 4, 2024
2862edd
Merge branch 'main' into feat-expand-environments-specification
olevski Aug 12, 2024
69fe88b
squashme: fixups for conflict resolutuion after merge
olevski Aug 12, 2024
92921d6
chore: apispec changes
olevski Aug 12, 2024
7b649ab
chore: changes to generated classes from CRDs
olevski Aug 12, 2024
1b01929
chore: add image build for a valid session
olevski Aug 12, 2024
bb55f64
chore: initial implementation with anonymous users
olevski Aug 12, 2024
9b417a5
chore(ci): install both amathea helm charts
olevski Aug 12, 2024
3986aff
Merge branch 'main' into feat-run-notebook-service
olevski Aug 12, 2024
8b0ee42
squashme: fix failing tests
olevski Aug 12, 2024
3a49eb6
chore: address comments
olevski Aug 12, 2024
72a36ea
squashme: minor fix
olevski Aug 12, 2024
0787533
Merge branch 'feat-expand-environments-specification' into feat-run-n…
olevski Aug 12, 2024
079d3a7
squashme: minor fixes
olevski Aug 12, 2024
c89d7fb
feat: add new apispec for the new amalthea sessions
olevski Aug 20, 2024
077d555
squashme: drop conflicting apispec portions
olevski Aug 20, 2024
f902ee6
Merge branch 'feat-add-new-sessions-apispec' into feat-run-notebook-s…
olevski Aug 20, 2024
a7aeb12
squashme: modify apispec for new sessions
olevski Aug 21, 2024
783b605
squasme: refactor crc validator to use db directly
olevski Aug 21, 2024
24c3093
Merge branch 'main' into feat-run-notebook-service
olevski Aug 21, 2024
38ef08e
squashme: resolve merge conflict problems
olevski Aug 21, 2024
0f88d89
squashme: minor fix
olevski Aug 22, 2024
143d024
squashme: minor fixes
olevski Aug 24, 2024
8304787
Merge branch 'main' into feat-run-notebook-service
olevski Aug 24, 2024
ba373f6
squashme: minor fix
olevski Aug 24, 2024
3445eb8
chore: update actions to 1.12.1
olevski Aug 24, 2024
5f6396d
squashme: minor fixes
olevski Aug 25, 2024
5a4dfa2
Merge branch 'main' into feat-add-new-sessions-apispec
olevski Aug 27, 2024
0da8412
Merge branch 'feat-add-new-sessions-apispec' into feat-expand-environ…
olevski Aug 27, 2024
f10ec03
feat: add command and args to environments
olevski Aug 25, 2024
288bdab
chore: adapt blueprint to new spec
olevski Aug 27, 2024
92d4ca6
chore: merge dependent branch
olevski Aug 27, 2024
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
5 changes: 4 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
"minikube": "none"
},
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {},
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {
"jqVersion": "latest",
"yqVersion": "latest"
},
"ghcr.io/dhoeric/features/k9s:1": {},
"ghcr.io/EliiseS/devcontainer-features/bash-profile:1": {
"command": "alias k=kubectl"
Expand Down
3 changes: 3 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ services:
ZED_TOKEN: renku
ZED_INSECURE: "true"
POETRY_CACHE_DIR: "/poetry_cache"
NB_SERVER_OPTIONS__DEFAULTS_PATH: /workspace/server_defaults.json
NB_SERVER_OPTIONS__UI_CHOICES_PATH: /workspace/server_options.json
network_mode: service:db
depends_on:
- db
Expand All @@ -43,6 +45,7 @@ services:
- "8080:8080"
- "5678:5678"
- "50051:50051"
- "8888:80"

swagger:
image: swaggerapi/swagger-ui
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ jobs:
renku-graph: ${{ steps.deploy-comment.outputs.renku-graph}}
renku-notebooks: ${{ steps.deploy-comment.outputs.renku-notebooks}}
renku-ui: ${{ steps.deploy-comment.outputs.renku-ui}}
amalthea-sessions: ${{ steps.deploy-comment.outputs.amalthea-sessions}}
amalthea: ${{ steps.deploy-comment.outputs.amalthea}}
test-enabled: ${{ steps.deploy-comment.outputs.test-enabled}}
test-cypress-enabled: ${{ steps.deploy-comment.outputs.test-cypress-enabled}}
persist: ${{ steps.deploy-comment.outputs.persist}}
extra-values: ${{ steps.deploy-comment.outputs.extra-values}}
steps:
- id: deploy-comment
uses: SwissDataScienceCenter/renku-actions/check-pr-description@v1.11.3
uses: SwissDataScienceCenter/renku-actions/check-pr-description@v1.12.1
with:
string: /deploy
pr_ref: ${{ github.event.number }}
Expand Down Expand Up @@ -61,7 +63,7 @@ jobs:
body: |
You can access the deployment of this PR at https://renku-ci-ds-${{ github.event.number }}.dev.renku.ch
- name: Build and deploy
uses: SwissDataScienceCenter/renku-actions/deploy-renku@v1.11.3
uses: SwissDataScienceCenter/renku-actions/deploy-renku@v1.12.1
env:
RANCHER_PROJECT_ID: ${{ secrets.CI_RANCHER_PROJECT }}
DOCKER_PASSWORD: ${{ secrets.RENKU_DOCKER_PASSWORD }}
Expand All @@ -84,14 +86,16 @@ jobs:
renku_graph: "${{ needs.check-deploy.outputs.renku-graph }}"
renku_notebooks: "${{ needs.check-deploy.outputs.renku-notebooks }}"
renku_data_services: "@${{ github.head_ref }}"
amalthea: "${{ needs.check-deploy.outputs.amalthea }}"
amalthea-sessions: "${{ needs.check-deploy.outputs.amalthea-sessions }}"
extra_values: "${{ needs.check-deploy.outputs.extra-values }}"

selenium-acceptance-tests:
needs: [check-deploy, deploy-pr]
if: github.event.action != 'closed' && needs.check-deploy.outputs.pr-contains-string == 'true' && needs.check-deploy.outputs.test-enabled == 'true'
runs-on: ubuntu-22.04
steps:
- uses: SwissDataScienceCenter/renku-actions/test-renku@v1.11.3
- uses: SwissDataScienceCenter/renku-actions/test-renku@v1.12.1
with:
kubeconfig: ${{ secrets.RENKUBOT_DEV_KUBECONFIG }}
renku-release: renku-ci-ds-${{ github.event.number }}
Expand All @@ -118,7 +122,7 @@ jobs:
steps:
- name: Extract Renku repository reference
run: echo "RENKU_REFERENCE=`echo '${{ needs.check-deploy.outputs.renku }}' | cut -d'@' -f2`" >> $GITHUB_ENV
- uses: SwissDataScienceCenter/renku-actions/test-renku-cypress@v1.11.3
- uses: SwissDataScienceCenter/renku-actions/test-renku-cypress@v1.12.1
with:
e2e-target: ${{ matrix.tests }}
renku-reference: ${{ env.RENKU_REFERENCE }}
Expand Down Expand Up @@ -146,7 +150,7 @@ jobs:
body: |
Tearing down the temporary RenkuLab deplyoment for this PR.
- name: renku teardown
uses: SwissDataScienceCenter/renku-actions/cleanup-renku-ci-deployments@v1.11.3
uses: SwissDataScienceCenter/renku-actions/cleanup-renku-ci-deployments@v1.12.1
env:
HELM_RELEASE_REGEX: "^renku-ci-ds-${{ github.event.number }}$"
GITLAB_TOKEN: ${{ secrets.DEV_GITLAB_TOKEN }}
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/save_cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Create cache from commits on main

on:
push:
branches:
- main
- chore-add-kind
workflow_dispatch:


jobs:
save-poetry-cache:
runs-on: ubuntu-latest
env:
CACHE_KEY: main-branch-poetry-cache-ubuntu
CACHE_PATH: .devcontainer/.poetry_cache
DEVCONTAINER_IMAGE_CACHE: ghcr.io/swissdatasciencecenter/renku-data-services/devcontainer

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install python deps
uses: devcontainers/ci@v0.3
with:
runCmd: poetry install --with dev
push: always
skipContainerUserIdUpdate: false
imageName: ${{ env.DEVCONTAINER_IMAGE_CACHE }}
cacheFrom: ${{ env.DEVCONTAINER_IMAGE_CACHE }}
- uses: actions/cache/save@v3
name: Create cache
with:
path: ${{ env.CACHE_PATH }}
key: ${{ env.CACHE_KEY }}
15 changes: 15 additions & 0 deletions .github/workflows/test_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache/restore@v3
name: Restore cache
with:
path: ${{ env.CACHE_PATH }}
key: ${{ env.CACHE_KEY }}
- name: Set Git config
shell: bash
run: |
Expand Down Expand Up @@ -99,6 +104,11 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache/restore@v3
name: Restore cache
with:
path: ${{ env.CACHE_PATH }}
key: ${{ env.CACHE_KEY }}
- name: Set Git config
shell: bash
run: |
Expand Down Expand Up @@ -143,6 +153,11 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache/restore@v3
name: Restore cache
with:
path: ${{ env.CACHE_PATH }}
key: ${{ env.CACHE_KEY }}
- name: Set Git config
shell: bash
run: |
Expand Down
30 changes: 24 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: schemas tests test_setup main_tests schemathesis_tests collect_coverage style_checks pre_commit_checks run download_avro check_avro avro_models update_avro kind_cluster install_amaltheas all

AMALTHEA_JS_VERSION ?= 0.11.0
AMALTHEA_SESSIONS_VERSION ?= 0.0.1-new-operator-chart
AMALTHEA_JS_VERSION ?= 0.12.2
AMALTHEA_SESSIONS_VERSION ?= 0.0.9-new-operator-chart
codegen_params = --input-file-type openapi --output-model-type pydantic_v2.BaseModel --use-double-quotes --target-python-version 3.12 --collapse-root-models --field-constraints --strict-nullable --set-default-enum-member --openapi-scopes schemas paths parameters --set-default-enum-member --use-one-literal-as-default --use-default

define test_apispec_up_to_date
Expand Down Expand Up @@ -41,7 +41,17 @@ components/renku_data_services/platform/apispec.py: components/renku_data_servic

##@ Apispec

schemas: components/renku_data_services/crc/apispec.py components/renku_data_services/storage/apispec.py components/renku_data_services/users/apispec.py components/renku_data_services/project/apispec.py components/renku_data_services/namespace/apispec.py components/renku_data_services/secrets/apispec.py components/renku_data_services/connected_services/apispec.py components/renku_data_services/repositories/apispec.py components/renku_data_services/notebooks/apispec.py components/renku_data_services/platform/apispec.py ## Generate pydantic classes from apispec yaml files
schemas: components/renku_data_services/crc/apispec.py \
components/renku_data_services/storage/apispec.py \
components/renku_data_services/users/apispec.py \
components/renku_data_services/project/apispec.py \
components/renku_data_services/session/apispec.py \
components/renku_data_services/namespace/apispec.py \
components/renku_data_services/secrets/apispec.py \
components/renku_data_services/connected_services/apispec.py \
components/renku_data_services/repositories/apispec.py \
components/renku_data_services/notebooks/apispec.py \
components/renku_data_services/platform/apispec.py ## Generate pydantic classes from apispec yaml files
@echo "generated classes based on ApiSpec"

##@ Avro schemas
Expand Down Expand Up @@ -84,6 +94,8 @@ style_checks: ## Run linting and style checks
@$(call test_apispec_up_to_date,"notebooks")
@echo "checking platform apispec is up to date"
@$(call test_apispec_up_to_date,"platform")
@echo "checking session apispec is up to date"
@$(call test_apispec_up_to_date,"session")
poetry run mypy
poetry run ruff format --check
poetry run ruff check .
Expand Down Expand Up @@ -141,7 +153,13 @@ kind_cluster: ## Creates a kind cluster for testing
sleep 15
kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=90s

install_amaltheas: ## Installs both version of amalthea in the currently active k8s context.
install_amaltheas: ## Installs both version of amalthea in the. NOTE: It uses the currently active k8s context.
helm repo add renku https://swissdatasciencecenter.github.io/helm-charts
helm install amalthea-js renku/amalthea --version $(AMALTHEA_JS_VERSION)
helm install amalthea-sessions renku/amalthea-sessions --version $(AMALTHEA_SESSIONS_VERSION)
helm repo update
helm upgrade --install amalthea-js renku/amalthea --version $(AMALTHEA_JS_VERSION)
helm upgrade --install amalthea-sessions amalthea-sessions-0.0.9-new-operator-chart.tgz --version $(AMALTHEA_SESSIONS_VERSION)

# TODO: Add the version variables from the top of the file here when the charts are fully published
amalthea_schema: ## Updates generates pydantic classes from CRDs
curl https://raw.githubusercontent.com/SwissDataScienceCenter/amalthea/fix-missing-status/config/crd/bases/amalthea.dev_amaltheasessions.yaml | yq '.spec.versions[0].schema.openAPIV3Schema' | poetry run datamodel-codegen --input-file-type jsonschema --output-model-type pydantic_v2.BaseModel --output components/renku_data_services/notebooks/cr_amalthea_session.py --use-double-quotes --target-python-version 3.12 --collapse-root-models --field-constraints --strict-nullable --base-class renku_data_services.notebooks.cr_base.BaseCRD --allow-extra-fields --use-default-kwarg
curl https://raw.githubusercontent.com/SwissDataScienceCenter/amalthea/main/controller/crds/jupyter_server.yaml | yq '.spec.versions[0].schema.openAPIV3Schema' | poetry run datamodel-codegen --input-file-type jsonschema --output-model-type pydantic_v2.BaseModel --output components/renku_data_services/notebooks/cr_jupyter_server.py --use-double-quotes --target-python-version 3.12 --collapse-root-models --field-constraints --strict-nullable --base-class renku_data_services.notebooks.cr_base.BaseCRD --allow-extra-fields --use-default-kwarg
21 changes: 21 additions & 0 deletions bases/renku_data_services/data_api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
UserResourcePoolsBP,
)
from renku_data_services.namespace.blueprints import GroupsBP
from renku_data_services.notebooks.blueprints import NotebooksBP, NotebooksNewBP
from renku_data_services.platform.blueprints import PlatformConfigBP
from renku_data_services.project.blueprints import ProjectsBP
from renku_data_services.repositories.blueprints import RepositoriesBP
Expand Down Expand Up @@ -134,6 +135,24 @@ def register_all_handlers(app: Sanic, config: Config) -> Sanic:
authenticator=config.authenticator,
internal_gitlab_authenticator=config.gitlab_authenticator,
)
notebooks = NotebooksBP(
name="notebooks_old",
url_prefix=url_prefix,
authenticator=config.authenticator,
nb_config=config.nb_config,
internal_gitlab_authenticator=config.gitlab_authenticator,
git_repo=config.git_repositories_repo,
)
notebooks_new = NotebooksNewBP(
name="notebooks",
url_prefix=url_prefix,
authenticator=config.authenticator,
nb_config=config.nb_config,
project_repo=config.project_repo,
session_repo=config.session_repo,
rp_repo=config.rp_repo,
internal_gitlab_authenticator=config.gitlab_authenticator,
)
platform_config = PlatformConfigBP(
name="platform_config",
url_prefix=url_prefix,
Expand Down Expand Up @@ -161,6 +180,8 @@ def register_all_handlers(app: Sanic, config: Config) -> Sanic:
oauth2_clients.blueprint(),
oauth2_connections.blueprint(),
repositories.blueprint(),
notebooks.blueprint(),
notebooks_new.blueprint(),
platform_config.blueprint(),
]
)
Expand Down
11 changes: 9 additions & 2 deletions components/renku_data_services/app_config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
from renku_data_services.message_queue.interface import IMessageQueue
from renku_data_services.message_queue.redis_queue import RedisQueue
from renku_data_services.namespace.db import GroupRepository
from renku_data_services.notebooks.config import _NotebooksConfig
from renku_data_services.platform.db import PlatformRepository
from renku_data_services.project.db import ProjectMemberRepository, ProjectRepository
from renku_data_services.repositories.db import GitRepositoriesRepository
Expand Down Expand Up @@ -144,6 +145,7 @@ class Config:
kc_api: IKeycloakAPI
message_queue: IMessageQueue
gitlab_url: str | None
nb_config: _NotebooksConfig

secrets_service_public_key: rsa.RSAPublicKey
"""The public key of the secrets service, used to encrypt user secrets that only it can decrypt."""
Expand Down Expand Up @@ -208,6 +210,9 @@ def __post_init__(self) -> None:
with open(spec_file) as f:
repositories = safe_load(f)

spec_file = Path(renku_data_services.notebooks.__file__).resolve().parent / "api.spec.yaml"
with open(spec_file) as f:
repositories = safe_load(f)
spec_file = Path(renku_data_services.platform.__file__).resolve().parent / "api.spec.yaml"
with open(spec_file) as f:
platform = safe_load(f)
Expand Down Expand Up @@ -408,8 +413,8 @@ def from_env(cls, prefix: str = "") -> "Config":
gitlab_client: base_models.GitlabAPIProtocol
user_preferences_config: UserPreferencesConfig
version = os.environ.get(f"{prefix}VERSION", "0.0.1")
server_options_file = os.environ.get("SERVER_OPTIONS")
server_defaults_file = os.environ.get("SERVER_DEFAULTS")
server_options_file = os.environ.get("NB_SERVER_OPTIONS__UI_CHOICES_PATH")
server_defaults_file = os.environ.get("NB_SERVER_OPTIONS__DEFAULTS_PATH")
k8s_namespace = os.environ.get("K8S_NAMESPACE", "default")
max_pinned_projects = int(os.environ.get(f"{prefix}MAX_PINNED_PROJECTS", "10"))
user_preferences_config = UserPreferencesConfig(max_pinned_projects=max_pinned_projects)
Expand Down Expand Up @@ -491,6 +496,7 @@ def from_env(cls, prefix: str = "") -> "Config":
sentry = SentryConfig.from_env(prefix)
trusted_proxies = TrustedProxiesConfig.from_env(prefix)
message_queue = RedisQueue(redis)
nb_config = _NotebooksConfig.from_env(db)

return cls(
version=version,
Expand All @@ -511,4 +517,5 @@ def from_env(cls, prefix: str = "") -> "Config":
encryption_key=encryption_key,
secrets_service_public_key=secrets_service_public_key,
gitlab_url=gitlab_url,
nb_config=nb_config,
)
3 changes: 2 additions & 1 deletion components/renku_data_services/authn/dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ async def authenticate(access_token: str, request: Request) -> base_models.APIUs
)

return base_models.APIUser(
is_admin=user_props.get("is_admin", False),
is_admin_init=user_props.get("is_admin", False),
id=user_props.get("id", "some-id") if is_set else None,
access_token=access_token,
first_name=user_props.get("first_name", "John") if is_set else None,
last_name=user_props.get("last_name", "Doe") if is_set else None,
email=user_props.get("email", "john.doe@gmail.com") if is_set else None,
full_name=user_props.get("full_name", "John Doe") if is_set else None,
refresh_token=request.headers.get("Renku-Auth-Refresh-Token"),
)
36 changes: 33 additions & 3 deletions components/renku_data_services/authn/gitlab.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
"""Gitlab authenticator."""

import base64
import contextlib
import json
import re
import urllib.parse as parse
from contextlib import suppress
from dataclasses import dataclass
from datetime import datetime
from typing import Any

import gitlab
from sanic import Request
from sanic.compat import Header

import renku_data_services.base_models as base_models
from renku_data_services import errors
Expand Down Expand Up @@ -36,10 +43,10 @@ async def authenticate(self, access_token: str, request: Request) -> base_models
if self.token_field != "Authorization": # nosec: B105
access_token = str(request.headers.get(self.token_field))

result = await self._get_gitlab_api_user(access_token)
result = await self._get_gitlab_api_user(access_token, request.headers)
return result

async def _get_gitlab_api_user(self, access_token: str) -> base_models.APIUser:
async def _get_gitlab_api_user(self, access_token: str, headers: Header) -> base_models.APIUser:
"""Get and validate a Gitlab API User."""
client = gitlab.Gitlab(self.gitlab_url, oauth_token=access_token)
try:
Expand Down Expand Up @@ -69,12 +76,35 @@ async def _get_gitlab_api_user(self, access_token: str) -> base_models.APIUser:
if len(name_parts) >= 1:
last_name = " ".join(name_parts)

_, _, _, expires_at = self.git_creds_from_headers(headers)
return base_models.APIUser(
is_admin=False,
id=str(user_id),
access_token=access_token,
first_name=first_name,
last_name=last_name,
email=email,
full_name=full_name,
access_token_expires_at=expires_at,
)

@staticmethod
def git_creds_from_headers(headers: Header) -> tuple[Any, Any, Any, datetime | None]:
"""Extract git credentials from the encoded header sent by the gateway."""
parsed_dict = json.loads(base64.decodebytes(headers["Renku-Auth-Git-Credentials"].encode()))
git_url, git_credentials = next(iter(parsed_dict.items()))
token_match = re.match(r"^[^\s]+\ ([^\s]+)$", git_credentials["AuthorizationHeader"])
git_token = token_match.group(1) if token_match is not None else None
git_token_expires_at_raw = git_credentials["AccessTokenExpiresAt"]
git_token_expires_at_num: float | None = None
with suppress(ValueError, TypeError):
git_token_expires_at_num = float(git_token_expires_at_raw)
git_token_expires_at: datetime | None = None
if git_token_expires_at_num is not None and git_token_expires_at_num > 0:
with suppress(ValueError):
git_token_expires_at = datetime.fromtimestamp(git_token_expires_at_num)
return (
git_url,
git_credentials["AuthorizationHeader"],
git_token,
git_token_expires_at,
)
Loading
Loading