diff --git a/.github/workflows/spatial-image.yml b/.github/workflows/spatial-image.yml new file mode 100644 index 0000000..4a4bb88 --- /dev/null +++ b/.github/workflows/spatial-image.yml @@ -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 + diff --git a/images/Dockerfile.spatial b/images/Dockerfile.spatial new file mode 100644 index 0000000..309e8d9 --- /dev/null +++ b/images/Dockerfile.spatial @@ -0,0 +1,4 @@ +FROM ghcr.io/boettiger-lab/k8s + +RUN pip install -U --find-links https://girder.github.io/large_image_wheels GDAL + diff --git a/initial-setup.sh b/initial-setup.sh index e46a7e6..ad1bb33 100644 --- a/initial-setup.sh +++ b/initial-setup.sh @@ -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 # ============================ @@ -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 diff --git a/jupyterhub/jupyterhub.sh b/jupyterhub/jupyterhub.sh index f4f3f31..ad5c83a 100755 --- a/jupyterhub/jupyterhub.sh +++ b/jupyterhub/jupyterhub.sh @@ -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 \ diff --git a/jupyterhub/public-config.yaml b/jupyterhub/public-config.yaml index 8156040..8c0c3cb 100644 --- a/jupyterhub/public-config.yaml +++ b/jupyterhub/public-config.yaml @@ -14,6 +14,7 @@ proxy: type: NodePort singleuser: storage: + capacity: 60Gi extraVolumeMounts: - name: "volume-{username}{servername}" mountPath: /home/rstudio @@ -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 @@ -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 diff --git a/nvidia/nvidia-device-plugin.sh b/nvidia/nvidia-device-plugin.sh index fb11adf..3d0ad1b 100755 --- a/nvidia/nvidia-device-plugin.sh +++ b/nvidia/nvidia-device-plugin.sh @@ -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