Skip to content

Commit ea67455

Browse files
add clf-vepac tools to materials-galaxy
alter chart to allow reading galaxy tool from private repo. Uses a github deploy key to setup connection Needs testing - hence creating an alpha chart
1 parent 6452029 commit ea67455

File tree

10 files changed

+172
-86
lines changed

10 files changed

+172
-86
lines changed

charts/materials-galaxy/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: materials-galaxy
3-
version: 1.0.0
3+
version: 1.1.0
44
dependencies:
55
# https://github.com/galaxyproject/galaxy-helm
66
- repository: https://raw.githubusercontent.com/CloudVE/helm-charts/master/

charts/materials-galaxy/README.md

+36-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,42 @@ Then edit `galaxy.configs.tool_conf.xml` to make it available to users - add a x
8282
```xml
8383
<tool file="{{.Values.persistence.mountPath}}/my-tools/my-tool-1/my-tool-1.xml>
8484
```
85-
where `file` is a filepath to the galaxy tool config you want to make available
85+
where `file` is a filepath to the galaxy tool config you want to make available
86+
87+
### Private repos
88+
89+
To deploy tools from a private repo - you need to create a git deploy key for that repo so that we can access it
90+
more about deploy keys here - https://docs.github.com/en/authentication/connecting-to-github-with-ssh/managing-deploy-keys#deploy-keys
91+
Deploy keys are useful as they only grant access to a single repository, limiting attack vectors, additionally, we can set them to be read-only which is recommended for this use-case.
92+
93+
Once you create a deploy key, you need to add it to the secrets file under - be careful not to publish this as plaintext
94+
```
95+
gitRepos:
96+
- name: repo-name
97+
deployKey: |-
98+
-----BEGIN OPENSSH PRIVATE KEY-----
99+
... private key content for repo1 ...
100+
-----END OPENSSH PRIVATE KEY-----
101+
```
102+
103+
then you'll need to create a container image to install from private repo like so:
104+
```
105+
- name: repo-name-tools
106+
applyToJob: false
107+
applyToWeb: true
108+
applyToWorkflow: false
109+
image: "alpine/git:latest"
110+
env:
111+
- name: SSH_PRIVATE_KEY
112+
valueFrom:
113+
secretKeyRef:
114+
name: git-deploy-keys
115+
key: repo-name
116+
command: ['sh', '-c', 'mkdir -p /root/.ssh && echo "${SSH_PRIVATE_KEY}" > /root/.ssh/id_rsa && chmod 600 /root/.ssh/id_rsa && ssh-keyscan github.com >> /root/.ssh/known_hosts && git clone [email protected]:my-org/my-repo.git --depth 1 --branch main {{.Values.persistence.mountPath}}/my-repo-tools || true']
117+
volumeMounts:
118+
- name: galaxy-data
119+
mountPath: "{{.Values.persistence.mountPath}}"
120+
```
86121
87122
## Configuring main page
88123

charts/materials-galaxy/secret-values.yaml.template

+7-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,10 @@ galaxy:
3333
# comma spaced list of admin emails
3434
3535

36-
36+
# any git repo deploy keys - to access private repos
37+
gitRepos:
38+
- name: first-repo
39+
deployKey: |-
40+
-----BEGIN OPENSSH PRIVATE KEY-----
41+
... private key content for repo1 ...
42+
-----END OPENSSH PRIVATE KEY-----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: git-deploy-keys
6+
namespace: {{ .Release.Namespace }}
7+
type: Opaque
8+
data:
9+
{{- range $index, $repo := .Values.repos }}
10+
{{ $repo.name }}-key: {{ $repo.deployKey | b64enc }}
11+
{{- end }}

charts/materials-galaxy/values.yaml

+22-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,22 @@ galaxy:
4141
volumeMounts:
4242
- name: galaxy-data
4343
mountPath: "{{.Values.persistence.mountPath}}"
44-
44+
- name: clf-vepac-tools
45+
applyToJob: false
46+
applyToWeb: true
47+
applyToWorkflow: false
48+
image: "alpine/git:latest"
49+
env:
50+
- name: SSH_PRIVATE_KEY
51+
valueFrom:
52+
secretKeyRef:
53+
name: git-deploy-keys
54+
key: clf-vepac-key
55+
command: ['sh', '-c', 'mkdir -p /root/.ssh && echo "${SSH_PRIVATE_KEY}" > /root/.ssh/id_rsa && chmod 600 /root/.ssh/id_rsa && ssh-keyscan github.com >> /root/.ssh/known_hosts && git clone [email protected]:CLF-vEPAC/Galaxy-tools.git --depth 1 --branch main {{.Values.persistence.mountPath}}/clf-vepac-tools || true']
56+
volumeMounts:
57+
- name: galaxy-data
58+
mountPath: "{{.Values.persistence.mountPath}}"
59+
4560
ingress:
4661
# used in galaxy configuration
4762
path: "/"
@@ -123,6 +138,8 @@ galaxy:
123138
</section>
124139
<section id="muon_other" name="Other Muon Tools">
125140
</section>
141+
<section id="clf_vpac" name="CLF vEPAC Tools">
142+
</section>
126143
<label id="xas_label" text="xas" />
127144
<label id="other_tools" text="Other Tools" />
128145
<section id="file_conversion" name="File Conversion">
@@ -154,6 +171,10 @@ galaxy:
154171
<tool file="{{.Values.persistence.mountPath}}/muon-galaxy-tools/pm_asephonons/pm_asephonons.xml"/>
155172
<tool file="{{.Values.persistence.mountPath}}/muon-galaxy-tools/pm_nq/pm_nq.xml"/>
156173
</section>
174+
<section id="clf_vepac" name="CLF vEPAC Tools">
175+
<tool file="{{.Values.persistence.mountPath}}/clf-vepac-tools/geant4-plot/geant4_plot.xml"/>
176+
<tool file="{{.Values.persistence.mountPath}}/clf-vepac-tools/geant4-sim/geant4_particles.xml"/>
177+
</section>
157178
<label id="xas_label" text="xas" />
158179
<tool file="{{.Values.persistence.mountPath}}/larch-tools/larch_select_paths/larch_select_paths.xml" />
159180
<tool file="{{.Values.persistence.mountPath}}/larch-tools/larch_plot/larch_plot.xml" />

charts/stfc-cloud-openstack-cluster/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This will create a `/tmp/capi/secret-values.yaml` file with your cluster secrets
2525

2626
```bash
2727
export CLUSTER_NAME="demo-cluster" # or your cluster name
28-
helm upgrade $CLUSTER_NAME cloud-charts/stfc-cloud-openstack-cluster --install -f values.yaml -f user-values.yaml -f flavors.yaml -f /tmp/capi/secret-values -n clusters
28+
helm upgrade $CLUSTER_NAME cloud-charts/stfc-cloud-openstack-cluster --install -f values.yaml -f nodes.yaml -f addons.yaml -f /tmp/capi/secret-values -n clusters
2929
```
3030
5. Perform move to self-managed cluster
3131

charts/stfc-cloud-openstack-cluster/user-values.yaml renamed to charts/stfc-cloud-openstack-cluster/addons.yaml

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
21
openstack-cluster:
32
# List of comma separated additional packages to install on cluster nodes
43
additionalPackages: []
5-
6-
controlPlane:
7-
# The number of control plane machines to deploy
8-
# For high-availability, this should be greater than 1
9-
# For etcd quorum, it should be odd - usually 3, or 5 for very large clusters
10-
machineCount: 5
11-
# The flavor to use for control plane machines
12-
machineFlavor: l3.nano
13-
14-
# defaults cause OutofSync issues in argocd
15-
remediationStrategy:
16-
retryPeriod: 20m0s
17-
minHealthyPeriod: 1h0m0s
18-
4+
195
addons:
206
# Monitoring sets up kube-prometheus-stack and loki-stack.
7+
# For configuration values
218
monitoring:
229
enabled: false
10+
11+
loki-stack:
12+
enabled: false
13+
release:
14+
values:
15+
# for values see - https://github.com/grafana/helm-charts/tree/main/charts/loki-stack
16+
17+
kubePrometheusStack:
18+
enabled: false
19+
release:
20+
values:
21+
# for values see - https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack
22+
2323

2424
# Ingress is preferred, as it allows you to use DNS to locate multiple
2525
# services behind a single FIP, and makes TLS trivial

charts/stfc-cloud-openstack-cluster/flavors.yaml

-66
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
openstack-cluster:
2+
# The control plane for the cluster
3+
controlPlane:
4+
# The number of control plane machines to deploy
5+
# For high-availability, this should be greater than 1
6+
# For etcd quorum, it should be odd - usually 3, or 5 for very large clusters
7+
machineCount: 5
8+
# The flavor to use for control plane machines
9+
machineFlavor: l3.nano
10+
11+
# for configuration values see here
12+
# https://github.com/azimuth-cloud/capi-helm-charts/blob/main/charts/openstack-cluster/values.yaml#L217
13+
14+
# The worker node groups for the cluster
15+
nodeGroups:
16+
# This group uses details found in nodeGroupDefault below
17+
# and is enabled by default
18+
- name: default-md-0
19+
# The number of machines in the node group if autoscale is false
20+
machineCount: 2
21+
22+
# The following node groups are optional and can be enabled by uncommenting them
23+
# For values you can configure separately for each set of nodegroups can be seen here
24+
# https://github.com/azimuth-cloud/capi-helm-charts/blob/main/charts/openstack-cluster/values.yaml#L357
25+
26+
# - name: md-l3-small
27+
# machineFlavor: l3.small
28+
# machineCount: 1
29+
# - name: md-rtx4000
30+
# machineFlavor: g-rtx4000.x1
31+
# machineCount: 1

charts/stfc-cloud-openstack-cluster/values.yaml

+48
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ openstack-cluster:
134134
# The name of the cloud to use from the specified clouds.yaml
135135
cloudName: openstack
136136

137+
# The Kubernetes version of the cluster
138+
# This should match the version of kubelet and kubeadm in the image
139+
# and will be automatically updated by us
140+
# we aim to keep n-1 of latest K8s version
141+
kubernetesVersion: "1.31.4"
142+
# The name of the image to use for cluster machines
143+
machineImage: "capi-ubuntu-2204-kube-v1.31.4-2025-01-24"
144+
137145
# Values for the Kubernetes cluster network
138146
kubeNetwork:
139147
# By default, use the private network range 10.0.0.0/12 for the cluster network
@@ -164,6 +172,46 @@ openstack-cluster:
164172
# The port to use for the API server
165173
port: 6443
166174

175+
# Defaults for node groups
176+
nodeGroupDefaults:
177+
# Indicates if the node group should be autoscaled
178+
autoscale: false
179+
# The flavor to use for machines in the node group
180+
machineFlavor: l3.micro
181+
182+
rolloutStrategy:
183+
type: RollingUpdate
184+
rollingUpdate:
185+
# The maximum number of node group machines that can be unavailable during the update
186+
# Can be an absolute number or a percentage of the desired count
187+
maxUnavailable: 0
188+
# The maximum number of machines that can be scheduled above the desired count for
189+
# the group during an update
190+
# Can be an absolute number or a percentage of the desired count
191+
maxSurge: 1
192+
# One of Random, Newest, Oldest
193+
deletePolicy: Random
194+
195+
healthCheck:
196+
# Indicates if the machine health check should be enabled
197+
enabled: true
198+
# The spec for the health check
199+
spec:
200+
# By default, 20% unhealthy worker nodes remediated at a time
201+
# https://cluster-api.sigs.k8s.io/tasks/automated-machine-management/healthchecking#max-unhealthy
202+
maxUnhealthy: 20%
203+
# If a node takes longer than 10 mins to startup, remediate it
204+
nodeStartupTimeout: 10m0s
205+
# By default, consider a worker node that has not been Ready for
206+
# more than 5 mins unhealthy
207+
unhealthyConditions:
208+
- type: Ready
209+
status: Unknown
210+
timeout: 10m0s
211+
- type: Ready
212+
status: "False"
213+
timeout: 10m0s
214+
167215
addons:
168216
# Enable monitoring by default, this deploys
169217
# https://github.com/stackhpc/capi-helm-charts/blob/main/charts/cluster-addons/README.md#monitoring-and-logging

0 commit comments

Comments
 (0)