Skip to main content

A service to read files on dls_sw from a blueapi container

Project description

Frontend CI Backend CI Coverage PyPI License

DAQ Config Server

A service to read files on Diamond's filesystem from a BlueAPI container. Currently this service is only able to read files on /dls_sw/. Writing to configuration files will come in a future release.

Source https://github.com/DiamondLightSource/daq-config-server
Docker docker run ghcr.io/DiamondLightSource/daq-config-server:latest
Releases https://github.com/DiamondLightSource/daq-config-server/releases

Here is a minimal example to read a file from the centrally hosted service after installing this package

from daq_config_server.client import ConfigServer

config_server = ConfigServer("https://daq-config.diamond.ac.uk")

file_contents = config_server.get_file_contents({ABSOLUTE_PATH_TO_CONFIG_FILE}, desired_return_type=str)

The output will come out as a raw string - you should format it as required in your own code. You may also request that the file contents is returned as a dict or in bytes - this will raise an http exception if the file cannot be converted to that type. To be able to read a file, you must first add it to the whitelist.

Testing and deployment

To run unit tests, type tox -e unit_tests from within the dev container

There is a convenient script in ./deployment/build_and_push.sh which can be used to easily build and run the container locally for testing, and optionally push the container to ghcr. In general we should rely on the CI to be pushing new containers - it should only be done manually for urgent debugging.

To run system tests, start a local container by running ./deployment/build_and_push.sh -r -b. Then, in the dev container, forward port 8555. There are instructions on port forwarding within vscode here. Next, in a terminal in the devcontainer, run pytest . from the daq-config-server directory.

To test on argus, log in to argus in your namespace and run:

helm install daq-config ./helmchart/ --values dev-values.yaml

followed by:

kubectl port-forward service/daq-config-server-svc 8555

after which you should be able to access the API on http://localhost:8555/docs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

daq_config_server-1.0.0rc1.tar.gz (112.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

daq_config_server-1.0.0rc1-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file daq_config_server-1.0.0rc1.tar.gz.

File metadata

  • Download URL: daq_config_server-1.0.0rc1.tar.gz
  • Upload date:
  • Size: 112.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for daq_config_server-1.0.0rc1.tar.gz
Algorithm Hash digest
SHA256 511fd12baebfb2ee42e0272434c2d04abdb9cdd2b388aeb71d4a713dd0319e94
MD5 69158fc001130329c2425c0417ebba33
BLAKE2b-256 90c9935a5cd5d94e9c7bf440d38c498909f97efa1633a75046cbce16e850b7eb

See more details on using hashes here.

File details

Details for the file daq_config_server-1.0.0rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for daq_config_server-1.0.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 8218f369afe32472b0df22c7855034ffc8b737d6567575147d162670a0847b26
MD5 5ef12a9888ddf04d60b543d7f0624bf1
BLAKE2b-256 ee8a41e16aac4086e0a7f4be3fcef8a9b8daf2e632e3ef9af694b7692d0c1eb8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page