Run a full DiracX demo
For the majority of developments it is not necessary to run a full DiracX instance locally. It's also strongly discouraged as it requires:
- Moderately powerful hardware and good network access.
- A good understanding of how to administer a DiracX installation.
- Much more time than simply running the tests (several minutes vs several seconds).
That said, DiracX is designed to make it as easy as possible to run a full instance locally if you desire and it can be an invaluable tool and this set up is known as "the demo".
Prerequisites
Before starting the demo requires:
- An Unix-like operating system: The DiracX tests are only officially supported on Unix-like operating systems like macOS and Linux. If you're running Windows we would suggest using the Windows Subsystem for Linux.
- Docker: On Linux we recommend Docker Engine installation instructions. On macOS we recommend Docker Desktop. (1)
- Commercial use of Docker Desktop is subject to restrictions, if this is a problem for you we would be happy to accept contributions to adapt the demo to support alternate container runtimes. Please open an issue.
Tip
If you're not interested in developing DiracX, check out the administrator guide.
Getting the code
First clone your fork of the diracx
and diracx-charts
repos:
First make a fork on the GitHub web interface and then run:
-
The GitHub CLI can be installed as a
pixi global
tool using:
First make a fork on the GitHub web interface and then run:
Starting the demo
- Other repositories can also be included here (DIRAC, diracx-web, extensions, ...) which will result in the code be injected into the local instance.
Once the demo has started (~5 minutes) it will print information about how to interact with it:
NOTES:
đ§ 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=/home/chaen/dirac/diracx-project/diracx-charts/.demo/kube.conf
export HELM_DATA_HOME=/home/chaen/dirac/diracx-project/diracx-charts/.demo/helm_data
export PATH=${PATH}:/home/chaen/dirac/diracx-project/diracx-charts/.demo
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=https://172.18.0.1.nip.io:8000
export DIRACX_CA_PATH=/home/chaen/dirac/diracx-project/diracx-charts/.demo/demo-ca.pem
âšī¸ To use the demo with a DiracX client without local installation:
kubectl exec -it deployment/diracx-demo-cli -- bash
âšī¸ To access the web application visit:
https://172.18.0.1.nip.io:8000
âšī¸ To access the interactive API documentation visit:
https://172.18.0.1.nip.io:8000/api/docs
âšī¸ When prompted to login the credentials are:
Username: admin@example.com
Password: password
âšī¸ Grafana dashboard for telemetry (if enabled)
https://172.18.0.1.nip.io:32004
Username: admin
Password: run ``kubectl get secrets diracx-demo-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo``
đĻ Waiting for installation to finish...
pod/diracx-demo-7fd5c47cd6-mq8s7 condition met
đ đ đ Pods are ready! đ đ đ
đĻ Creating initial CS content ...
Writing back configuration to /cs_store/initialRepo/default.yml
Successfully added vo to git+file:///cs_store/initialRepo
Writing back configuration to /cs_store/initialRepo/default.yml
Successfully added user to git+file:///cs_store/initialRepo
âšī¸ Press Ctrl+C to clean up and exit
The code changes will be reflected in the demo, in most cases the code will be "hot-reloaded" when changes are made to the local clone's of the DiracX source code.
Using the demo
Running the integration tests
Using the CLI
Using the web app
Using swagger to interact with the API
To login, click the authorize button
Connect using the authorization code flow, ticking the "vo:diracAdmin" scope
And enter the credentials prompted by the run_demo.sh
script in the Dex
interface