Closed prjemian closed 8 months ago
At least two options for MongoDB server action:
Code examples from both show the same action:
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.10.0
with:
mongodb-version: ${{ matrix.mongodb-version }}
The second one has gone EOL. So only one action now...
Run tiled server in docker container.
docker pull ghcr.io/bluesky/tiled:main
Good advice:
Some of the examples below set an environment variable
TILED_SINGLE_USER_API_KEY
tosecret
, as a placeholder. For actual use, use a difficult-to-guess secret. Two equally good ways to generate a secure secret...With
openssl
:openssl rand -hex 32
With
python
:python -c "import secrets; print(secrets.token_hex(32))"
Start tiled server:
docker run \
-p 8000:8000 \
-e TILED_SINGLE_USER_API_KEY=secret \
ghcr.io/bluesky/tiled:latest
The tests are the first items to reconfigure:
(bluesky_2023_3) prjemian@arf:~/.../Bluesky/hklpy$ git grep insert | grep subscribe
docs/source/examples/notebooks/geo_e4cv.ipynb: "RE.subscribe(db.insert)\n",
docs/source/examples/notebooks/geo_e6c.ipynb: "RE.subscribe(db.insert)\n",
docs/source/examples/notebooks/geo_k4cv.ipynb: "RE.subscribe(db.insert)\n",
docs/source/examples/notebooks/tst_UB_in_descriptor_document.ipynb: "RE.subscribe(cat.v1.insert)\n",
docs/source/examples/notebooks/tst_UB_in_stream.ipynb: "RE.subscribe(cat.v1.insert)\n",
hkl/tests/test_save_restore_UB.py: engine.subscribe(cat.v1.insert)
hkl/tests/test_util.py: engine.subscribe(cat.v1.insert)
Interestingly, tests run successfully without making a change to subscribe()
with databroker v2.0.0b30
.
Not necessary for PR #284.
Still need to run a tiled server in the testing workflow, then refactor to databroker v2. So this PR is in draft mode ATM.
Originally posted by @prjemian in https://github.com/bluesky/hklpy/issues/284#issuecomment-1791026416
Tasks
RE.subscribe()