Skip to content

Commit

Permalink
unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rsarm committed May 30, 2024
1 parent ca0d6a7 commit 5555d71
Show file tree
Hide file tree
Showing 9 changed files with 828 additions and 27 deletions.
4 changes: 2 additions & 2 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ apiVersion: v2
name: f7t4jhub
description: A Helm chart to Deploy JupyterHub with the FirecREST Spawner
type: application
version: 0.5.0
version: 0.5.1
appVersion: "4.1.5"
dependencies:
- name: f7t4jhub
version: 0.5.0
version: 0.5.1
repository: "file://./f7t4jhub"
- name: reloader
version: v1.0.51
Expand Down
2 changes: 1 addition & 1 deletion chart/f7t4jhub/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: f7t4jhub
description: A Helm chart to Deploy JupyterHub with the FirecREST Spawner
type: application
version: 0.5.0
version: 0.5.1
appVersion: "4.1.5"
2 changes: 1 addition & 1 deletion chart/f7t4jhub/files/jupyterhub-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ async def refresh_user(self, user, handler=None):
# Default: 'jupyterhub.spawner.LocalProcessSpawner'
# c.JupyterHub.spawner_class = 'jupyterhub.spawner.LocalProcessSpawner'

c.JupyterHub.spawner_class = 'firecrest_spawner.spawner.SlurmSpawner'
c.JupyterHub.spawner_class = 'firecrestspawner.spawner.SlurmSpawner'
#
c.FirecRESTSpawnerBase.req_host = '{{ .Values.config.spawner.host }}'
c.FirecRESTSpawnerBase.node_name_template = '{{ .Values.config.spawner.nodeNameTemplate }}'
Expand Down
2 changes: 1 addition & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ f7t4jhub:

hub:
# Image for the JupyterHub application (replace with your own JupyterHub image)
image: 'rsarm/jhub:4.1.5-f7t-x86_64'
image: 'ghcr.io/eth-cscs/f7t4fjhub:4.1.5'

vault:
# Enable or disable Vault integration
Expand Down
4 changes: 0 additions & 4 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ RUN . /opt/conda/bin/activate && \
# git clone https://github.com/moment/moment.git -b 2.29.1 && \
# git clone https://github.com/requirejs/requirejs.git -b 2.3.6

# COPY socket.py /opt/conda/envs/py311/lib/python3.11/socket.py
# COPY user.py /opt/conda/envs/py311/lib/python3.11/site-packages/jupyterhub/user.py
# COPY app.py /opt/conda/envs/py311/lib/python3.11/site-packages/jupyterhub/app.py

EXPOSE 8000

RUN useradd -ms /bin/bash juhu
Expand Down
19 changes: 1 addition & 18 deletions dockerfiles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,4 @@

This is a dockerfile to build the image used for the deployment of the Hub.

The image can be found in DockerHub: [rsarm/jhub:2.0.0-f7t-x86_64](https://hub.docker.com/layers/rsarm/jhub/2.0.0-f7t-x86_64/images/sha256-3474b7295728c7a61caad03711c2ae64e0615ed8c9c6ae15f8e273d72c7b7027?context=explore).

## Notes

### Build for linux/amd64 on an arm64 macbook

From the based directory of the repo:

```bash
docker build -f dockerfiles/Dockerfile --platform linux/amd64 -t rsarm/jhub:2.0.0-f7t-x86_64 .
```
The dockerfile has a `COPY` that needs the repository to be in the build directory.

### Push
```bash
docker login # only once per shell
docker push rsarm/jhub:2.0.0-f7t-x86_64
```
The available images can be found [here](https://github.com/eth-cscs/firecrestspawner/pkgs/container/f7t4fjhub).
13 changes: 13 additions & 0 deletions tests/context.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import os
import sys


os.environ["FIRECREST_URL"] = "https://firecrest-url-pytest.com"

sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))

from firecrestspawner.spawner import (
SlurmSpawner,
format_template,
FirecrestAccessTokenAuth,
)
Loading

0 comments on commit 5555d71

Please sign in to comment.