Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
cboettig committed Jan 23, 2024
2 parents cad6cb7 + 09562ea commit 51f8b8e
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 19 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/spatial-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Docker Spatial Image
on:
workflow_dispatch: null
push:
paths: ['images/*']
jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
- name: Login to GitHub Container Registry
if: github.repository == 'boettiger-lab/k8s'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Build the Docker image
if: github.repository == 'boettiger-lab/k8s'
run: docker build images/ -f images/Dockerfile.spatial --tag ghcr.io/boettiger-lab/spatial:latest
- name: Publish
if: github.repository == 'boettiger-lab/k8s'
run: docker push ghcr.io/boettiger-lab/spatial:latest

4 changes: 4 additions & 0 deletions images/Dockerfile.spatial
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM ghcr.io/boettiger-lab/k8s

RUN pip install -U --find-links https://girder.github.io/large_image_wheels GDAL

13 changes: 4 additions & 9 deletions initial-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
# Otherwise, to use jupyter's cert manager, or manual caddy, do:
curl -sfL https://get.k3s.io | sh -s - --disable=traefik

echo "export KUBECONFIG=/etc/rancher/k3s/k3s.yaml" >> ~/.bashrc
source ~/.bashrc
sudo chown $(id -u) /etc/rancher/k3s/k3s.yaml

# Install Helm
# ============================
Expand All @@ -19,15 +22,7 @@ curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
# Enable GPU + timeslicing
# ============================

helm upgrade -i nvdp nvdp/nvidia-device-plugin \
--namespace nvidia-device-plugin \
--create-namespace \
--version 0.14.3 \
--wait \
--values nvidia/nvidia-device-plugin-config.yaml

# identically:
# bash nvidia/nvidia-device-plugin.sh
bash nvidia/nvidia-device-plugin.sh



Expand Down
2 changes: 2 additions & 0 deletions jupyterhub/jupyterhub.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

helm repo add jupyterhub https://hub.jupyter.org/helm-chart/
helm repo update

## use your name for install name and namespace name
helm upgrade --cleanup-on-fail \
Expand Down
19 changes: 10 additions & 9 deletions jupyterhub/public-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ proxy:
type: NodePort
singleuser:
storage:
capacity: 60Gi
extraVolumeMounts:
- name: "volume-{username}{servername}"
mountPath: /home/rstudio
Expand All @@ -26,21 +27,21 @@ singleuser:
display_name: Resource Allocation
choices:
small:
display_name: Small (1.9 GB RAM)
display_name: Small (8 GB RAM)
kubespawner_override:
mem_guarantee: 1991341312
mem_limit: 1991341312
mem_guarantee: 7991341312
mem_limit: 7991341312
default: true
med:
display_name: Medium (14.8 GB RAM)
display_name: Medium (16 GB RAM)
kubespawner_override:
mem_guarantee: 15930730496
mem_limit: 15930730496
large:
display_name: Large (29.7 GB RAM)
display_name: Large (60 GB RAM)
kubespawner_override:
mem_guarantee: 31861460992
mem_limit: 31861460992
mem_guarantee: 59861460992
mem_limit: 59861460992
kubespawner_override:
image: ghcr.io/boettiger-lab/k8s:latest
default_url: /lab # change to /rstudio to go straight to RStudio
Expand Down Expand Up @@ -86,10 +87,10 @@ hub:
- cboettig
GitHubOAuthenticator:
allowed_organizations:
- espm-288
- boettiger-lab
scope:
- read:org
oauth_callback_url: https://jupyterhub.thelio.carlboettiger.info/hub/oauth_callback
oauth_callback_url: https://jupyterhub.cirrus.carlboettiger.info/hub/oauth_callback
JupyterHub:
authenticator_class: github

5 changes: 4 additions & 1 deletion nvidia/nvidia-device-plugin.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/bash
helm repo add nvdp https://nvidia.github.io/k8s-device-plugin
helm repo update

helm upgrade -i nvdp nvdp/nvidia-device-plugin \
--namespace nvidia-device-plugin \
--create-namespace \
--version 0.14.3 \
--wait \
--values nvidia-device-plugin-config.yaml
--values nvidia/nvidia-device-plugin-config.yaml


0 comments on commit 51f8b8e

Please sign in to comment.