Skip to content

Commit b2ed3e7

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 as an alpha chart before release
1 parent 6452029 commit b2ed3e7

File tree

5 files changed

+77
-4
lines changed

5 files changed

+77
-4
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" />

0 commit comments

Comments
 (0)