Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions .github/workflows/backend_ci.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
name: backend CI
name: CI

on:
push:
paths:
- pyproject.toml
- src/**
- tests/**
pull_request:
paths:
- pyproject.toml
- src/**
- tests/**

jobs:
check:
Expand All @@ -29,7 +21,7 @@ jobs:
strategy:
matrix:
runs-on: ["ubuntu-latest"] # can add windows-latest, macos-latest
python-version: ["3.11"] # Should run with 3.12 once not dependent on Dodal for constants
python-version: ["3.11", "3.12"]
include:
# Include one that runs in the dev environment
- runs-on: "ubuntu-latest"
Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/gui_ci.yml

This file was deleted.

39 changes: 14 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
[![Frontend CI](https://github.com/DiamondLightSource/daq-config-server/actions/workflows/gui_ci.yml/badge.svg)](https://github.com/DiamondLightSource/daq-config-server/actions/workflows/gui_ci.yml)
[![Backend CI](https://github.com/DiamondLightSource/daq-config-server/actions/workflows/backend_ci.yml/badge.svg)](https://github.com/DiamondLightSource/daq-config-server/actions/workflows/backend_ci.yml)
[![Backend CI](https://github.com/DiamondLightSource/daq-config-server/actions/workflows/ci.yml/badge.svg)](https://github.com/DiamondLightSource/daq-config-server/actions/workflows/backend_ci.yml)
[![Coverage](https://codecov.io/gh/DiamondLightSource/daq-config-server/branch/main/graph/badge.svg)](https://codecov.io/gh/DiamondLightSource/daq-config-server)
[![PyPI](https://img.shields.io/pypi/v/daq-config-server.svg)](https://pypi.org/project/daq-config-server)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

# DAQ Config Server

A service to put and get your config values from.
IMPORTANT: This repository is currently under a rework, none of the features are production-ready yet.

Comprises a FastAPI backend with a valkey database to C/R/U/D config values, and a Chakra/React frontend for easier management.
A service to read files on Diamond's filesystem from a BlueAPI container.

Currently the scope is JUST storing and retrieving feature flags for Hyperion/I03 UDC but we hope to expand this to replace all DAQ config files.
Comprises a FastAPI backend

Currently the scope is JUST reading files on /dls_sw/

| 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> |

A simple app for storing and fetching values. Has a Valkey (Redis) instance as well as options for file-backed legacy
values (e.g. `beamlineParameters`...)

Currently the server application always needs to be run with the `--dev` flag, as it cannot yet look at the DLS
filesystem to find the real beamline parameter files.

Expand All @@ -34,32 +33,22 @@ use_stub_offsets: bool = config_server.best_effort_get_feature_flag("use_stub_of

```

To work on the GUI you will probably need to run:

```bash
module load node
npm install
```

in the gui directory to setup the environment.

## Testing and deployment

There is a convenient script in `./deployment/build_and_push_all.sh` to build all the containers, which takes
There is a convenient script in `./deployment/build_and_push_.sh`, which takes
a `--dev` option to push containers with `-dev` appended to their names and a `--no-push` option for local
development. This ensures that environment variables for dev or prod builds are included in the built container,
such as the GUI pointing at the subdomain URL vs. localhost, and the `root_path` of the FastAPI app. To push to
development. This ensures that environment variables for dev or prod builds are included in the built container. To push to
the registry you must have identified to gcloud by having loaded a kubernetes module and running `gcloud auth login.`

To deploy a live version, you can run the above script with no arguments and then while logged in to
argus, in the `daq-config-server` namespace, run `kubectl rollout restart deployment`. If it is not
currently deploy it you can deploy it with `helm install daq-config ./helmchart`.
currently deployed it you can deploy it with `helm install daq-config ./helmchart`.

To test locally, you can build everything with `./deployment/build_and_push_all.sh --dev --no-push` and then
run the containers `daq-config-server-dev` (with the command `daq-config-server --dev`), `daq-config-server-db-dev`,
To test locally, you can build with `./deployment/build_and_push_all.sh --dev --no-push` and then
run the container `daq-config-server-dev` (with the command `daq-config-server --dev`), `daq-config-server-db-dev`,
and `daq-config-server-gui-dev`, all with the `--net host` option.

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

```bash
helm install daq-config ./helmchart/ --values dev-values.yaml
Expand All @@ -68,7 +57,7 @@ helm install daq-config ./helmchart/ --values dev-values.yaml
followed by:

```bash
kubectl port-forward service/daq-config-server-svc 8080 8555
kubectl port-forward service/daq-config-server-svc 8555
```

after which you should be able to access the frontend on `http://localhost:8080` and the API on `http://localhost:8555`
after which you should be able to access the API on `http://localhost:8555/docs`
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ for option in "$@"; do
echo "Build and push the current repository state into containers and publish them to"
echo "gcr.io/diamond-privreg/daq-config-server/<container-name> ready for deployment."
echo " "
echo " -d, --dev Creates -dev:latest tagged containers for testing on pollux."
echo " -d, --dev Creates -dev:latest tagged containers for testing on argus."
echo " -n, --no-push Don't push containers to GCR."
echo " "
exit 0
Expand All @@ -33,19 +33,13 @@ BASE_REPO_ADDR="gcr.io/diamond-privreg/daq-config-server/"
if [ $DEV -gt 0 ]; then
echo "Building dev-mode containers..."
MAIN_CONTAINER_NAME="${BASE_CONTAINER_NAME}-dev"
GUI_CONTAINER_NAME="${BASE_CONTAINER_NAME}-gui-dev"
DB_CONTAINER_NAME="${BASE_CONTAINER_NAME}-db-dev"
else
echo "Building prod-mode containers..."
MAIN_CONTAINER_NAME="${BASE_CONTAINER_NAME}"
GUI_CONTAINER_NAME="${BASE_CONTAINER_NAME}-gui"
DB_CONTAINER_NAME="${BASE_CONTAINER_NAME}-db"
fi
echo " "

MAIN_CONTAINER_TAG="${BASE_REPO_ADDR}${MAIN_CONTAINER_NAME}"
GUI_CONTAINER_TAG="${BASE_REPO_ADDR}${GUI_CONTAINER_NAME}"
DB_CONTAINER_TAG="${BASE_REPO_ADDR}${DB_CONTAINER_NAME}"

# set env vars which will be used by build process:
if [ $DEV -gt 0 ]; then
Expand All @@ -67,41 +61,4 @@ podman build --build-arg RUN_APP_IN_DEV_MODE=$MAIN_APP_DEV_MODE -t $MAIN_CONTAIN
if [ $PUSH -gt 0 ]; then
podman tag $MAIN_CONTAINER_NAME $MAIN_CONTAINER_TAG
podman push $MAIN_CONTAINER_NAME $MAIN_CONTAINER_TAG
fi

cd gui/config-server-gui

echo " "
echo "========================"
echo "==== Building GUI ===="
echo "========================"
module load node
npm run build

echo " "
echo "=============================================="
echo "==== Building and pushing GUI container ===="
echo "=============================================="
echo " "
echo "Building ${GUI_CONTAINER_NAME}"
echo " "
podman build -t $GUI_CONTAINER_NAME .
if [ $PUSH -gt 0 ]; then
podman tag $GUI_CONTAINER_NAME $GUI_CONTAINER_TAG
podman push $GUI_CONTAINER_NAME $GUI_CONTAINER_TAG
fi

cd ../../valkey

echo " "
echo "============================================="
echo "==== Building and pushing DB container ===="
echo "============================================="
echo " "
echo "Building ${DB_CONTAINER_NAME}"
echo " "
podman build -t $DB_CONTAINER_NAME .
if [ $PUSH -gt 0 ]; then
podman tag $DB_CONTAINER_NAME $DB_CONTAINER_TAG
podman push $DB_CONTAINER_NAME $DB_CONTAINER_TAG
fi
23 changes: 0 additions & 23 deletions gui/config-server-gui/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions gui/config-server-gui/Dockerfile

This file was deleted.

59 changes: 0 additions & 59 deletions gui/config-server-gui/README.md

This file was deleted.

6 changes: 0 additions & 6 deletions gui/config-server-gui/build_container.sh

This file was deleted.

55 changes: 0 additions & 55 deletions gui/config-server-gui/package.json

This file was deleted.

Binary file removed gui/config-server-gui/public/favicon.ico
Binary file not shown.
40 changes: 0 additions & 40 deletions gui/config-server-gui/public/index.html

This file was deleted.

Binary file removed gui/config-server-gui/public/logo192.png
Binary file not shown.
Binary file removed gui/config-server-gui/public/logo512.png
Binary file not shown.
Loading
Loading