Skip to content

Commit

Permalink
Merge pull request #44 from chrisburr/update-notes
Browse files Browse the repository at this point in the history
Update NOTES
  • Loading branch information
chaen authored Oct 2, 2023
2 parents 2fe07d5 + 7682de0 commit 7417a6d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 34 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"` | |
Expand Down
8 changes: 8 additions & 0 deletions demo/values.tpl.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
55 changes: 33 additions & 22 deletions diracx/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -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: [email protected]
Password: password

{{ else }}

Installed in chart production mode.

TODO: Add notes...

{{ end -}}
2 changes: 2 additions & 0 deletions diracx/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down
14 changes: 2 additions & 12 deletions run_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: [email protected]"
echo "Password: password"
else
printf "%b Installation did not start sucessfully!\n" ${WARN_EMOJI}
echo "Installation did not start sucessfully!" >> "${demo_dir}/.failed"
Expand Down

0 comments on commit 7417a6d

Please sign in to comment.