Skip to content

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:

  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:

git clone git@github.com:<GitHub username>/diracx.git
cd diracx
git remote add upstream git@github.com:DIRACGrid/diracx.git
cd ..
git clone git@github.com:<GitHub username>/diracx-charts.git
cd diracx-charts
git remote add upstream git@github.com:DIRACGrid/diracx-charts.git
gh repo fork DIRACGrid/diracx # (1)!
gh repo fork DIRACGrid/diracx-charts
  1. The GitHub CLI can be installed as a pixi global tool using:

    pixi global install gh
    

First make a fork on the GitHub web interface and then run:

git clone https://github.com/<GitHub username>/diracx.git
cd diracx
git remote add upstream https://github.com/DIRACGrid/diracx.git
cd ..
git clone https://github.com/<GitHub username>/diracx-charts.git
cd diracx-charts
git remote add upstream https://github.com/DIRACGrid/diracx-charts.git

Starting the demo

$ cd diracx-charts/
$ ./run_demo.sh ../diracx # (1)!
  1. 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

authorize

Connect using the authorization code flow, ticking the "vo:diracAdmin" scope

codeflow

And enter the credentials prompted by the run_demo.sh script in the Dex interface

Dexlogin