-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use Amalthea to run sessions through a K8s operator (#668)
- refactoring of the notebook service - adapt existing and expand test suite Co-authored-by: Andreas Bleuler <andreas.bleuler@sdsc.ethz.ch>
- Loading branch information
Showing
75 changed files
with
3,471 additions
and
4,834 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
name: Integration tests | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- reopened | ||
- closed | ||
|
||
jobs: | ||
integration-test: | ||
strategy: | ||
matrix: | ||
session-type: ["registered", "anonymous"] | ||
if: github.event.action != 'closed' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
- name: Create k8s Kind Cluster | ||
uses: helm/kind-action@v1.1.0 | ||
with: | ||
cluster_name: kind | ||
wait: 10m0s | ||
version: v0.11.1 | ||
- name: Create values file | ||
env: | ||
OIDC_GITLAB_CLIENT_ID: ${{ secrets.OIDC_GITLAB_CLIENT_ID }} | ||
OIDC_GITLAB_CLIENT_SECRET: ${{ secrets.OIDC_GITLAB_CLIENT_SECRET }} | ||
RENKUBOT_DEV_GITLAB_ACCESS_TOKEN: ${{ secrets.RENKUBOT_DEV_GITLAB_ACCESS_TOKEN }} | ||
run: | | ||
cat <<EOF > test-values.yaml | ||
amalthea: | ||
scope: | ||
namespaces: [default] | ||
deployCrd: true | ||
global: | ||
anonymousSessions: | ||
enabled: true | ||
userSessionPersistentVolumes: | ||
enabled: true | ||
storageClass: standard | ||
gitlab: | ||
registry: | ||
host: registry.dev.renku.ch | ||
url: https://dev.renku.ch/gitlab | ||
oidc: | ||
clientId: $OIDC_GITLAB_CLIENT_ID | ||
clientSecret: $OIDC_GITLAB_CLIENT_SECRET | ||
tokenUrl: https://dev.renku.ch/gitlab/oauth/token | ||
authUrl: https://dev.renku.ch/gitlab/oauth/authorize | ||
allowUnverifiedEmail: true | ||
sessionIngress: | ||
host: test.host.com | ||
tlsSecret: dummy-tls-secret | ||
serverDefaults: | ||
defaultUrl: /lab | ||
cpu_request: 0.1 | ||
mem_request: 0.5G | ||
disk_request: 1G | ||
gpu_request: 0 | ||
lfs_auto_fetch: false | ||
serverOptions: | ||
cpu_request: | ||
order: 1 | ||
displayName: Number of CPUs | ||
type: enum | ||
default: 0.1 | ||
options: [0.1, 1.0] | ||
mem_request: | ||
order: 2 | ||
displayName: Amount of Memory | ||
type: enum | ||
default: 0.5G | ||
options: [0.5G, 2G] | ||
tests: | ||
sessionTypes: | ||
- ${{ matrix.session-type }} | ||
enabled: true | ||
oidc_issuer: https://dev.renku.ch/gitlab | ||
gitlab_token: $RENKUBOT_DEV_GITLAB_ACCESS_TOKEN | ||
debug: false | ||
EOF | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
- name: Setup chartpress | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
run: | | ||
pip install --user pipx | ||
pipx ensurepath | ||
pipx install pipenv | ||
pipenv install --dev | ||
echo ${DOCKER_PASSWORD} | docker login -u ${DOCKER_USERNAME} --password-stdin | ||
pipenv run chartpress --push | ||
- name: Install Helm Chart | ||
run: | | ||
helm dep update helm-chart/renku-notebooks | ||
helm install renku-notebooks helm-chart/renku-notebooks -f test-values.yaml --wait --timeout 5m0s | ||
- name: Helm Test | ||
run: | | ||
helm test renku-notebooks --timeout 60m0s --logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM python:3.7-slim | ||
|
||
LABEL maintainer="info@datascience.ch" | ||
|
||
RUN pip install --no-cache-dir --disable-pip-version-check -U pip && \ | ||
pip install --no-cache-dir --disable-pip-version-check pipenv && \ | ||
apt-get update && \ | ||
apt-get install -y git && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install renku | ||
ENV PATH=$PATH:/.renku/bin | ||
|
||
RUN mkdir -p /.renku/bin && \ | ||
virtualenv /.renku/venv && \ | ||
. /.renku/venv/bin/activate && \ | ||
pip install --no-cache renku && \ | ||
deactivate && \ | ||
ln -s /.renku/venv/bin/renku /.renku/bin/renku | ||
|
||
# Install all packages | ||
COPY Pipfile Pipfile.lock /renku-notebooks/ | ||
WORKDIR /renku-notebooks | ||
RUN pipenv install --dev | ||
|
||
COPY renku_notebooks /renku-notebooks/renku_notebooks | ||
COPY tests /renku-notebooks/tests | ||
|
||
CMD ["pipenv", "run", "pytest", "tests/integration"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.