Skip to content

Commit 2178492

Browse files
committed
Merge branch 'main' of https://github.com/opencadc/deployments into portal-resource-slider
2 parents d063834 + 7cd1f97 commit 2178492

File tree

111 files changed

+1409
-1007
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+1409
-1007
lines changed

.github/workflows/pre-commit.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,37 +43,37 @@ jobs:
4343
continue-on-error: true
4444
run: uv run pre-commit run -a
4545

46-
- name: Verify latest commit message format
47-
id: commitizen
48-
if: ${{ github.event_name == 'pull_request' }}
49-
continue-on-error: true
50-
run: |
51-
latest="$(git log -1 --pretty=%B)"
52-
printf 'Checking latest commit message:\n%s\n' "$latest"
53-
uv run cz check --message "$latest"
54-
5546
- name: Share pre-commit guidance
56-
if: ${{ github.event_name == 'pull_request' && (steps.precommit.outcome == 'failure' || steps.commitizen.outcome == 'failure') }}
47+
if: ${{ github.event_name == 'pull_request' && (steps.precommit.outcome == 'failure') }}
5748
uses: marocchino/sticky-pull-request-comment@v2
5849
with:
5950
message: |
60-
### ⚠️ Pre-commit checks failed
51+
### ⚠️ Pre-commit Checks Failed
6152
6253
${{ steps.precommit.outcome == 'failure' && '- Run `uv run pre-commit run -a` locally to reproduce the issues.' || '' }}
63-
${{ steps.commitizen.outcome == 'failure' && '- Ensure your latest commit message follows the Commitizen format (e.g. `feat: add awesome thing`).' || '' }}
64-
${{ steps.commitizen.outcome == 'failure' && ' Validate it locally with `uv run cz check --message "<type>: <description>"`.' || '' }}
6554
66-
Fix the issues locally with:
55+
To reproduce the issues locally, run the following commands:
6756
6857
```bash
69-
uv sync
58+
git clone ${{ github.event.pull_request.head.repo.clone_url }}
59+
git checkout -b ${{ github.event.pull_request.head.ref }}
7060
uv run pre-commit run -a
7161
```
7262
73-
Need help? Run `uv run pre-commit install` once to enable these checks before every commit.
63+
To always run pre-commit checks locally before pushing changes, simple run the following command once:
64+
65+
```bash
66+
uv run pre-commit install
67+
```
68+
69+
#### Resources
70+
- [Documentation to install `uv`](https://docs.astral.sh/uv/getting-started/installation/)
71+
- [Conventional Commits](https://www.conventionalcommits.org/) standards for writing commit messages
72+
- [Commitizen](https://commitizen-tools.github.io/commitizen/) CLI tool for writing commit messages
73+
- [pre-commit](https://pre-commit.com/) CLI tool for running pre-commit hooks
7474
7575
- name: Celebrate spotless PR
76-
if: ${{ github.event_name == 'pull_request' && steps.precommit.outcome == 'success' && steps.commitizen.outcome == 'success' }}
76+
if: ${{ github.event_name == 'pull_request' && steps.precommit.outcome == 'success' }}
7777
uses: marocchino/sticky-pull-request-comment@v2
7878
with:
7979
message: |
@@ -82,5 +82,5 @@ jobs:
8282
Thanks for keeping the repo tidy! ✨
8383
8484
- name: Fail if checks failed
85-
if: ${{ steps.precommit.outcome == 'failure' || steps.commitizen.outcome == 'failure' }}
85+
if: ${{ steps.precommit.outcome == 'failure' }}
8686
run: exit 1

.pre-commit-config.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,20 @@ exclude: ^deployment/
44
repos:
55
- repo: local
66
hooks:
7-
- id: update-helm-maintainers
7+
- id: helm-maintainers
88
name: Update Helm maintainers
99
entry: uv run python -m deployments.maintainers
1010
language: system
1111
pass_filenames: false
12-
stages: [pre-commit]
12+
stages: [pre-commit, post-commit]
1313
always_run: true
14-
env:
15-
UV_CACHE_DIR: .uv-cache
16-
- id: refresh-chart-inventory
14+
- id: helm-inventory
1715
name: Refresh chart inventory
1816
entry: uv run python -m deployments.inventory
1917
language: system
2018
pass_filenames: false
21-
stages: [pre-commit]
19+
stages: [pre-commit, post-commit]
2220
always_run: true
23-
env:
24-
UV_CACHE_DIR: .uv-cache
2521
# Commitizen Configuration
2622
# This configuration will add commitizen to your pre-commit hooks and will run it on commit-msg stage
2723
# of the git commit process.
@@ -51,7 +47,8 @@ repos:
5147
- id: check-toml
5248
# Attempts to load all yaml files to verify syntax.
5349
- id: check-yaml
54-
exclude: ^skaha/src/test/resources/
50+
exclude: ^helm/
51+
args: [--allow-multiple-documents, --unsafe]
5552
# Attempts to load all xml files to verify syntax.
5653
- id: check-xml
5754
# Check for debugger imports and py37+ breakpoint() calls in python source.

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ This section is automatically generated. Do not edit manually.
88

99
| Chart | Version | App Version | Owners | Dependencies |
1010
| --- | --- | --- | --- | --- |
11-
| [base](helm/applications/base) | 0.4.1 | 0.1.4 | Dustin Jenkins | traefik 26.1.0 |
11+
| [base](helm/applications/base) | 0.4.1 | 0.1.4 | Shiny Brar, Dustin Jenkins | traefik 26.1.0 |
1212
| [cavern](helm/applications/cavern) | 0.7.1 | 0.9.0 | Dustin Jenkins | utils ^0.1.0 |
1313
| [posixmapper](helm/applications/posix-mapper) | 0.5.0 | 0.3.2 | Dustin Jenkins ||
1414
| [scienceportal](helm/applications/science-portal) | 1.0.0 | 1.0.1 | Dustin Jenkins | redis ^18.19.0, utils ^0.1.0 |
15-
| [skaha](helm/applications/skaha) | 1.0.4 | 1.0.3 | Dustin Jenkins, Shiny Brar | redis ^18.19.0, utils ^0.1.0 |
16-
| [sshd](helm/applications/sshd) | 1.0.1 | 1.0.0 | Dustin Jenkins | common ^1.0.0 |
17-
| [storageui](helm/applications/storage-ui) | 0.7.0 | 1.4.1 | Dustin Jenkins, Dustin | redis ^18.4.0, utils ^0.1.0 |
18-
| [utils](helm/applications/utils) | 0.1.0 | 1.0.0 | Dustin Jenkins ||
19-
| [common](helm/common) | 1.0.0 | 1.0.0 | Dustin Jenkins ||
15+
| [skaha](helm/applications/skaha) | 1.1.0 | 1.1.0 | Dustin Jenkins, Shiny Brar | redis ^18.19.0, utils ^0.1.0 |
16+
| [sshd](helm/applications/sshd) | 1.0.1 | 1.0.0 | Dustin Jenkins, Shiny Brar | common ^1.0.0 |
17+
| [storageui](helm/applications/storage-ui) | 0.7.0 | 1.4.1 | Dustin Jenkins, Shiny Brar | redis ^18.4.0, utils ^0.1.0 |
18+
| [utils](helm/applications/utils) | 0.1.0 | 1.0.0 | Shiny Brar, Dustin Jenkins ||
19+
| [common](helm/common) | 1.0.0 | 1.0.0 | Shiny Brar, Dustin Jenkins ||
2020
<!-- CHART-INVENTORY:END -->

docs/helm/base.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Helm Chart for base objects of the CANFAR Science Platform
2+
3+
## Install
4+
5+
### Dependencies
6+
7+
Kubernetes 1.27 and up are supported.
8+
9+
### From source
10+
11+
Installation depends on a working Kubernetes cluster version 1.23 or greater.
12+
13+
The base install also installs the Traefik proxy, which is needed by the Ingress when the Science Platform services are installed.
14+
15+
```sh
16+
$ git clone https://github.com/opencadc/science-platform.git
17+
$ cd science-platform/deployment/helm
18+
$ helm install --dependency-update --values ./base/values.yaml <name> ./base
19+
```
20+
21+
Where `<name>` is the name of this installation. Example:
22+
```sh
23+
$ helm install --dependency-update --values ./base/values.yaml base ./base
24+
```
25+
This will create the core namespace (`skaha-system`), and install the Traefik proxy dependency. Expected output:
26+
```
27+
NAME: base
28+
LAST DEPLOYED: <Timestamp e.g. Fri Jun 30 10:39:04 2023>
29+
NAMESPACE: skaha-system
30+
STATUS: deployed
31+
REVISION: 1
32+
TEST SUITE: None
33+
```
34+
35+
### From the CANFAR repository
36+
37+
The Helm repository contains the current stable version as well.
38+
39+
```sh
40+
$ helm repo add canfar-skaha-system https://images.canfar.net/chartrepo/skaha-system
41+
$ helm repo update
42+
$ helm install --dependency-update --values canfar-skaha-system/base/values.yaml canfar-science-platform-base canfar-skaha-system/base
43+
```
44+
45+
## Verification
46+
47+
After the install, there should exist the necessary Namespaces and Objects. See the Namespaces:
48+
49+
```sh
50+
$ kubectl get namespaces
51+
NAME STATUS AGE
52+
...
53+
skaha-system Active 28m
54+
skaha-workload Active 28m
55+
```
56+
57+
## Proxy using Traefik
58+
59+
The [Traefik](https://traefik.io/traefik/) proxy server is also installed as a dependency, which handles SSL termination. Helm options are under the `traefik` key in the `values.yaml` file.
60+
61+
You can create your own secrets to contain your self-signed server certificates to be used by
62+
the SSL termination. See the `values.yaml` file for more, and don't forget to `base64` encode
63+
the values.
64+
65+
## Shared Storage
66+
67+
Shared Storage is handled by the `local` Persistent Volume types.
68+
69+
```yaml
70+
...
71+
volumeMode: Filesystem
72+
accessModes:
73+
- ReadWriteMany
74+
persistentVolumeReclaimPolicy: Delete
75+
storageClassName: local-storage
76+
local:
77+
path: /data/skaha-storage
78+
...
79+
```
80+
81+
### DNS on macOS
82+
83+
The Docker VM on macOS cannot mount the NFS by default as it cannot do name resolution in the cluster. It first needs to know about the `kube-dns` IP. e.g.:
84+
85+
```sh
86+
$ kubectl -n kube-system get service kube-dns
87+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
88+
kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP,9153/TCP 4d23h
89+
```
90+
91+
The `ClusterIP` needs to be known to the Docker VM's name resolution. A simple way to do this is to mount the Docker VM root and modify it. It will take effect immediately:
92+
93+
```sh
94+
$ docker run --rm -it -v /:/vm-root alpine sh
95+
$ echo "nameserver 10.96.0.10" >> /vm-root/etc/resolv.conf
96+
$ cat /vm-root/etc/resolv.conf
97+
# DNS requests are forwarded to the host. DHCP DNS options are ignored.
98+
nameserver 192.168.65.7
99+
nameserver 10.96.0.10
100+
```

helm/applications/canfar/README.md renamed to docs/helm/canfar.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ REVISION: 1
8080
8181
### Persistent Volumes and Persistent Volume Claims
8282
83-
**Note**
83+
**Note**
8484
The `base` MUST be installed first as it creates the necessary Namespaces for the Persistent Volume Claims!
8585

8686
**Important**
@@ -361,7 +361,7 @@ deployment:
361361
maxCount: "3" # Max number of sessions per user.
362362
minEphemeralStorage: "20Gi" # The initial requested amount of ephemeral (local) storage. Does NOT apply to Desktop sessions.
363363
maxEphemeralStorage: "200Gi" # The maximum amount of ephemeral (local) storage to allow a Session to extend to. Does NOT apply to Desktop sessions.
364-
364+
365365
# Optionally setup a separate host for User Sessions for Skaha to redirect to. The HTTPS scheme is assumed. Defaults to the Skaha hostname (.Values.deployment.hostname).
366366
# Example:
367367
# hostname: myhost.example.org
@@ -370,7 +370,7 @@ deployment:
370370
# When set to 'true' this flag will enable GPU node scheduling. Don't forget to declare any related GPU configurations, if appropriate, in the nodeAffinity below!
371371
# gpuEnabled: false
372372
373-
# Set the YAML that will go into the "affinity.nodeAffinity" stanza for Pod Spec in User Sessions. This can be used to enable GPU scheduling, for example,
373+
# Set the YAML that will go into the "affinity.nodeAffinity" stanza for Pod Spec in User Sessions. This can be used to enable GPU scheduling, for example,
374374
# or to control how and where User Session Pods are scheduled. This can be potentially dangerous unless you know what you are doing.
375375
# See https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity
376376
# nodeAffinity: {}
@@ -388,7 +388,7 @@ deployment:
388388
mountPropagation: HostToContainer
389389
390390
# Kueue configurations for User Sessions
391-
kueue:
391+
kueue:
392392
default:
393393
# Ensure this name matches whatever was created as the LocalQueue in the workload namespace.
394394
queueName: canfar-science-platform-local-queue
@@ -408,9 +408,9 @@ deployment:
408408
409409
# Other data to be included in the main ConfigMap of this deployment.
410410
# Of note, files that end in .key are special and base64 decoded.
411-
#
411+
#
412412
# extraConfigData:
413-
413+
414414
# Resources provided to the Skaha service.
415415
# For units of storage, see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory.
416416
resources:
@@ -547,9 +547,9 @@ deployment:
547547

548548
# Other data to be included in the main ConfigMap of this deployment.
549549
# Of note, files that end in .key are special and base64 decoded.
550-
#
550+
#
551551
# extraConfigData:
552-
552+
553553
# Resources provided to the Science Portal service.
554554
resources:
555555
requests:
@@ -634,13 +634,13 @@ deployment:
634634
# the rootOwner MUST be an object with the following properties set.
635635
rootOwner:
636636
# The adminUsername is required to be set whomever has admin access over the filesystem.dataDir above.
637-
adminUsername:
637+
adminUsername:
638638

639639
# The username of the root owner.
640-
username:
640+
username:
641641

642642
# The UID of the root owner.
643-
uid:
643+
uid:
644644

645645
# The GID of the root owner.
646646
gid:
@@ -693,7 +693,7 @@ deployment:
693693
# extraVolumeMounts:
694694
# - mountPath: "/config/cacerts"
695695
# name: cacert-volume
696-
#
696+
#
697697
# extraVolumeMounts:
698698

699699
# Create the CA certificate volume to be mounted in extraVolumeMounts
@@ -708,9 +708,9 @@ deployment:
708708

709709
# Other data to be included in the main ConfigMap of this deployment.
710710
# Of note, files that end in .key are special and base64 decoded.
711-
#
711+
#
712712
# extraConfigData:
713-
713+
714714
# Resources provided to the Cavern service.
715715
resources:
716716
requests:
@@ -826,9 +826,9 @@ deployment:
826826
827827
# Other data to be included in the main ConfigMap of this deployment.
828828
# Of note, files that end in .key are special and base64 decoded.
829-
#
829+
#
830830
# extraConfigData:
831-
831+
832832
# Resources provided to the StorageUI service.
833833
resources:
834834
requests:

0 commit comments

Comments
 (0)