An example how to upload a stave config from Python
Adding an option to create a runkey Stave node from a dictionary which contains an "unpacked" YARR connectivity file: connectivity and chip configs in one file as:
$ head examples/sr1-barrel-st-4staves/CERNSR1_stave2_testing_setup_full.json
{
"chipType": "Star_vH1A1",
"chips": [
{
"config": {
"name": "Stave2_PPB_hcc0",
"HCC": {
"ID": 2,
"fuse_id": "400949",
"regs": {
...
You can build a stave node from such a dictionary:
import functions_configDB as fxt
a_stave_runkey = fxt.build_stave_node_from_dict(stave_name, stave_cfg)
And then a standard upload procedure follows:
scripts/test_upload_a_stave.py
The upload should be simplified.
modified: .gitlab-ci.yml
new file: examples/sr1-barrel-st-4staves/CERNSR1_stave2_testing_setup_full.json
new file: scripts/test_upload_a_stave.py
Merge request reports
Activity
added 1 commit
- 18945e65 - Getting around to get the itsdaq number from HCC config
added 1 commit
- 4717c684 - UP uploading runkey_root instead of the full runkey
added 1 commit
- fdd46e78 - Upload a blank template as a starting point for CI
added 1 commit
- 2166b23f - Fix the options that create their own runkey
There is a problem because you cannot re-upload to ConfigDB a recently downloaded runkey. The downloaded runkey contains more fields than what we typically upload. And it is simply not uploadable. It fails on some random stuff, with errors like "missing required field".
Which is crucial in this exercise: we download a runkey, modify it, and re-upload.
In the basic SR1 example, we just dump the runkey into files, and build a new one from the files, which results in an uploadable dictionary. But currently we cannot dump a temporary runkey into files. Because the SR1 procedure is hard-coded. The SR1 connectivity and stave names are hardcoded. And we have not broken it up into elementary procedures.
So, in
--upload-stave
I just create a blank runkey from a template, add a new stave node to it, and upload that.We need both things fixed:
- ConfigDB must be able to receive a just downloaded runkey
- we should break up the SR1 example into elementary procedures
mentioned in commit fa9ee04b