diff --git a/README.md b/README.md index 3db1691..d90777f 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ TODO | developer.enabled | bool | `true` | | | developer.modulesToInstall | list | `[]` | | | developer.sourcePath | string | `"/diracx_source"` | | +| developer.urls | object | `{}` | | | dex."https.enabled" | bool | `false` | | | dex.config.enablePasswordDB | bool | `true` | | | dex.config.expiry.authRequests | string | `"24h"` | | diff --git a/demo/values.tpl.yaml b/demo/values.tpl.yaml index f074b63..53e9ce3 100644 --- a/demo/values.tpl.yaml +++ b/demo/values.tpl.yaml @@ -1,9 +1,17 @@ developer: + urls: + diracx: http://{{ hostname }}:8000 + minio: http://{{ hostname }}:32000 + dex: http://{{ hostname }}:32002 + demoDir: {{ demo_dir }} modulesToInstall: {{ modules_to_mount }} diracx: settings: DIRACX_SERVICE_AUTH_ALLOWED_REDIRECTS: '["http://{{ hostname }}:8000/docs/oauth2-redirect"]' + DIRACX_SANDBOX_STORE_BUCKET_NAME: demo-sandboxes + DIRACX_SANDBOX_STORE_S3_CLIENT_KWARGS: '{"endpoint_url": "http://{{ hostname }}:32000", "aws_access_key_id": "console", "aws_secret_access_key": "console123"}' + DIRACX_SANDBOX_STORE_AUTO_CREATE_BUCKET: "true" minio: environment: diff --git a/diracx/templates/NOTES.txt b/diracx/templates/NOTES.txt index 93769ab..72a232f 100644 --- a/diracx/templates/NOTES.txt +++ b/diracx/templates/NOTES.txt @@ -1,22 +1,33 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "diracx.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "diracx.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "diracx.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "diracx.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} +{{- if .Values.developer.enabled }} + +🚧 Chart has been installed in developer mode. + +ℹ️ To interact with the cluster directly using kubectl/helm you'll need to set the +first following environment variables: + + export KUBECONFIG={{ .Values.developer.demoDir }}/kube.conf + export HELM_DATA_HOME={{ .Values.developer.demoDir }}/helm_data + export PATH=\${PATH}:{{ .Values.developer.demoDir }} + +Then see the chart README for more information on how to use kubectl/helm. + +ℹ️ To use the demo with the DiracX client set: + + export DIRACX_URL={{ .Values.developer.urls.diracx }} + +ℹ️ To access the interactive API documentation visit: + + {{ .Values.developer.urls.diracx }}/docs + +ℹ️ When prompted to login the credentials are: + + Username: admin@example.com + Password: password + +{{ else }} + +Installed in chart production mode. + +TODO: Add notes... + +{{ end -}} diff --git a/diracx/values.yaml b/diracx/values.yaml index bc79394..1cc9f01 100644 --- a/diracx/values.yaml +++ b/diracx/values.yaml @@ -51,6 +51,8 @@ securityContext: {} developer: enabled: true + # URLs which can be used to access various components of the demo + urls: {} # Path from which to mount source of DIRACX sourcePath: /diracx_source modulesToInstall: [] diff --git a/run_demo.sh b/run_demo.sh index 207448c..79bd27d 100755 --- a/run_demo.sh +++ b/run_demo.sh @@ -234,6 +234,8 @@ fi printf "%b Generating Helm templates\n" ${UNICORN_EMOJI} sed "s/{{ hostname }}/${machine_hostname}/g" "${script_dir}/demo/values.tpl.yaml" > "${demo_dir}/values.yaml" mv "${demo_dir}/values.yaml" "${demo_dir}/values.yaml.bak" +sed "s@{{ demo_dir }}@${demo_dir}@g" "${demo_dir}/values.yaml.bak" > "${demo_dir}/values.yaml" +mv "${demo_dir}/values.yaml" "${demo_dir}/values.yaml.bak" json="[" if [ ${#pkg_names[@]} -gt 0 ]; then for pkg_name in "${pkg_names[@]}"; do @@ -275,18 +277,6 @@ else if "${demo_dir}/kubectl" wait --for=condition=ready pod --selector=app.kubernetes.io/name=diracx --timeout=300s; then printf "%b %b %b Pods are ready! %b %b %b\n" "${PARTY_EMOJI}" "${PARTY_EMOJI}" "${PARTY_EMOJI}" "${PARTY_EMOJI}" "${PARTY_EMOJI}" "${PARTY_EMOJI}" touch "${demo_dir}/.success" - - echo "" - printf "%b To interact with the cluster:\n" "${INFO_EMOJI}" - echo "export KUBECONFIG=${KUBECONFIG}" - echo "export HELM_DATA_HOME=${HELM_DATA_HOME}" - echo "export PATH=\${PATH}:${demo_dir}" - echo "" - printf "%b You can access swagger at http://%s:8000/docs\n" "${INFO_EMOJI}" "${machine_hostname}" - echo "To login, use the OAuth Authroization Code flow, and enter the following credentials" - echo "in the DEX web interface" - echo "Username: admin@example.com" - echo "Password: password" else printf "%b Installation did not start sucessfully!\n" ${WARN_EMOJI} echo "Installation did not start sucessfully!" >> "${demo_dir}/.failed"