Skip to content

Commit 1616993

Browse files
authored
Merge pull request #126 from chaen/doc_prod_deployment
Doc prod deployment
2 parents 5ad1b79 + d7ad70a commit 1616993

File tree

15 files changed

+518
-143
lines changed

15 files changed

+518
-143
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ repos:
1616
- id: helm-docs
1717
name: helm-docs
1818
language: docker_image
19-
entry: jnorwood/helm-docs:v1.11.2 --chart-search-root=diracx --output-file=../docs/admin/reference/values.md --template-files=../docs/admin/reference/values.md.gotmpl --chart-to-generate=diracx
19+
entry: jnorwood/helm-docs:v1.14.2 --chart-search-root=diracx --output-file=../docs/admin/reference/values.md --template-files=../docs/admin/reference/values.md.gotmpl --chart-to-generate=diracx
2020
always_run: true
2121
pass_filenames: false
2222

2323
- id: helm-lint
2424
name: helm-lint
2525
language: docker_image
26-
entry: alpine/helm:3.11.1 lint diracx/ --set diracx.hostname=diracx.invalid
26+
entry: alpine/helm:3.17.0 lint diracx/ --set diracx.hostname=diracx.invalid
2727
always_run: true
2828
pass_filenames: false
2929

3030
- repo: https://github.com/koalaman/shellcheck-precommit
31-
rev: v0.9.0
31+
rev: v0.10.0
3232
hooks:
3333
- id: shellcheck
3434
# TODO: Render demo in CI and run the scripts through shell-check

README.md.gotmpl

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -169,39 +169,26 @@ helm diff upgrade diracx-demo ./diracx --values .demo/values.yaml --set rabbitm
169169

170170
# Actually run "helm upgrade" to apply changes
171171
helm upgrade diracx-demo ./diracx --values .demo/values.yaml
172+
173+
# Retrieve the values.yaml that was used
174+
175+
helm get values diracx-demo
172176
```
173177

174178
See [here](./docs/RUN_DEMO.md) for more details on what you can do to alter the behavior of the local installation.
175179

176180

177181
## Deploying in production
178182

183+
See [docs](./docs/RUN_DEMO.md)
179184

180-
TODO: Link to k3s
181-
182-
TODO: Explain how to download the values from helm
183185

184-
TODO: add info about diracx-web
186+
### Deploying a custom branch
185187

188+
This can be useful when debugging a problem, or running a specific version of the code which is not the one in the image.
186189

187-
### Deploying a custom branch to DIRAC certification
190+
See [docs](./docs/DEBUGGING.md)
188191

189-
Apply the following on top of the standard `values.yaml` file, replacing `USERNAME` and `BRANCH_NAME` with the appropriate values.
190-
191-
```yaml
192-
global:
193-
images:
194-
tag: "dev"
195-
# TODO: We should use the base images here but pythonModulesToInstall would need to be split
196-
services: ghcr.io/diracgrid/diracx/services
197-
client: ghcr.io/diracgrid/diracx/client
198-
199-
diracx:
200-
pythonModulesToInstall:
201-
- "git+https://github.com/USERNAME/diracx.git@BRANCH_NAME#egg=diracx_core&subdirectory=diracx-core"
202-
- "git+https://github.com/USERNAME/diracx.git@BRANCH_NAME#egg=diracx_db&subdirectory=diracx-db"
203-
- "git+https://github.com/USERNAME/diracx.git@BRANCH_NAME#egg=diracx_routers&subdirectory=diracx-routers"yaml
204-
```
205192

206193
## OpenTelemetry
207194

demo/values.tpl.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ global:
66
batchJobTTL: 3600
77

88
developer:
9+
enabled: true
910
urls:
1011
diracx: https://{{ hostname }}:8000
1112
minio: http://{{ hostname }}:32000
@@ -22,6 +23,7 @@ diracx:
2223
hostname: {{ hostname }}
2324
settings:
2425
DIRACX_SERVICE_AUTH_TOKEN_ISSUER: "https://{{ hostname }}:8000"
26+
DIRACX_CONFIG_BACKEND_URL: "git+file:///cs_store/initialRepo"
2527
DIRACX_SERVICE_AUTH_ALLOWED_REDIRECTS: '["https://{{ hostname }}:8000/api/docs/oauth2-redirect", "https://{{ hostname }}:8000/#authentication-callback"]'
2628
DIRACX_SANDBOX_STORE_BUCKET_NAME: demo-sandboxes
2729
DIRACX_SANDBOX_STORE_S3_CLIENT_KWARGS: '{"endpoint_url": "http://{{ hostname }}:32000", "aws_access_key_id": "console", "aws_secret_access_key": "console123"}'
@@ -53,7 +55,7 @@ dex:
5355
issuer: http://{{ hostname }}:32002
5456

5557
staticClients:
56-
- id: d396912e-2f04-439b-8ae7-d8c585a34790
58+
- id: {{ dex_client_uuid }}
5759
public: true
5860
name: "CLI app"
5961
redirectURIs:
@@ -62,8 +64,11 @@ dex:
6264

6365
staticPasswords:
6466
- email: "[email protected]"
67+
# bcrypt hash of the string "password"
68+
# htpasswd -bnBC 10 "" "password" | tr -d ':\n'
6569
hash: "$2a$10$2b2cU8CPhOTaGrs1HRQuAueS7JTT5ZHsHSzYiFPm1leZck7Mc8T4W"
6670
username: "admin"
71+
userID: {{ dex_admin_uuid }}
6772

6873
indigoiam:
6974
config:

diracx/templates/diracx/init-secrets/_init-secrets.sh.tpl

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,6 @@ generate_secret_if_needed diracx-sql-root-connection-urls \
132132

133133

134134

135-
136-
137-
138-
139-
140-
141-
142-
143-
144-
145-
146-
147135
{{- if .Values.initOs.enabled }}
148136
# If we deploy opensearch ourselves
149137
{{- if .Values.opensearch.enabled }}

diracx/templates/diracx/tests/test-connection.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

diracx/values.yaml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ initKeyStore:
8989
enabled: true
9090

9191
developer:
92-
enabled: true
92+
enabled: false
9393
# -- Make it possible to launch the demo without having an internet connection
9494
offline: false
9595
# -- URLs which can be used to access various components of the demo (diracx, minio, dex, etc).
@@ -126,22 +126,48 @@ diracx:
126126
settings:
127127
# -- This corresponds to the basic dirac.cfg
128128
# which must be present on all the servers
129-
#TODO: autogenerate all of these
130-
DIRACX_CONFIG_BACKEND_URL: "git+file:///cs_store/initialRepo"
129+
# -- URL to get the diracx config
130+
DIRACX_CONFIG_BACKEND_URL: "git+https://gitlab.invalid/myvo/diracx-config"
131+
132+
### AuthSettings https://github.com/DIRACGrid/diracx/blob/main/diracx-routers/src/diracx/routers/utils/users.py
133+
# -- path storing the token key
131134
DIRACX_SERVICE_AUTH_TOKEN_KEYSTORE: "file:///keystore/jwks.json"
132135
DIRACX_SERVICE_AUTH_ALLOWED_REDIRECTS: '["http://anything:8000/docs/oauth2-redirect"]'
133136

137+
# -- legacy exchange key for DIRAC legacy (see https://github.com/DIRACGrid/diracx/blob/7f766158a674fde0eed011cd2745d359e507f846/diracx-routers/src/diracx/routers/auth/token.py#L264)
138+
# -- DIRACX_LEGACY_EXCHANGE_HASHED_API_KEY: <sha256>
139+
140+
# -- Sandbox settings See https://github.com/DIRACGrid/diracx/blob/7f766158a674fde0eed011cd2745d359e507f846/diracx-routers/src/diracx/routers/jobs/sandboxes.py#L46
141+
142+
# -- Name of the bucket for the sandbox
143+
DIRACX_SANDBOX_STORE_BUCKET_NAME: sandboxes-store
144+
DIRACX_SANDBOX_STORE_S3_CLIENT_KWARGS: '{"endpoint_url": "http://minio.invalid:32000", "aws_access_key_id": "my-access-key", "aws_secret_access_key": "my-secret-key-123"}'
145+
DIRACX_SANDBOX_STORE_AUTO_CREATE_BUCKET: "true"
146+
147+
###
148+
149+
### Open Telemetry settings (experimental)
150+
151+
DIRACX_OTEL_ENABLED: false
152+
DIRACX_OTEL_GRPC_ENDPOINT: "diracx-demo-opentelemetry-collector:4317"
153+
DIRACX_OTEL_GRPC_INSECURE: "true"
154+
134155
# If mysql is enabled, you are not allowed
135156
# to set the username passwords
136157
sqlDbs:
158+
# -- default credentials
137159
default:
138160
# rootUser: admin
139161
# rootPassword: hunter123
140162
# user: dirac
141163
# password: password123
142164
# host: sqlHost:123
165+
143166
# -- Which DiracX MySQL DBs are used?
144167
dbs:
168+
# All DBs used should be configured here.
169+
# If they use the default configuration
170+
# they should have a null value
145171
# AuthDB:
146172
# internalName: DiracXAuthDB
147173
# JobDB:
@@ -289,7 +315,7 @@ dex:
289315
enabled: true
290316
https.enabled: false
291317
image:
292-
tag: v2.37.0
318+
tag: v2.41.1
293319

294320
service:
295321
type: NodePort
@@ -303,12 +329,10 @@ dex:
303329

304330
config:
305331
issuer: http://anything:32002
306-
307332
storage:
308333
type: sqlite3
309334
config:
310335
file: /tmp/dex.db
311-
312336
web:
313337
http: 8000
314338

0 commit comments

Comments
 (0)