This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
mongoroc_doc [2020/01/08 10:11] acqilc [Structure des fichiers JSON] |
mongoroc_doc [2021/07/10 23:21] (current) |
||
---|---|---|---|
Line 14: | Line 14: | ||
=== Creation des utilisateurs === | === Creation des utilisateurs === | ||
- | Pour la base '''cool_db''' | ||
+ | Pour la base '''MaBase''' | ||
- | use cool_db | + | |
+ | use MaBase | ||
db.createUser({ | db.createUser({ | ||
- | user: 'ian', | + | user: 'monId', |
pwd: 'secretPassword', | pwd: 'secretPassword', | ||
- | roles: [{ role: 'readWrite', db:'cool_db'}] | + | roles: [{ role: 'readWrite', db:'MaBase'}] |
}) | }) | ||
Line 35: | Line 36: | ||
authorization: 'enabled' | authorization: 'enabled' | ||
- | On peut ainsi acceder a la base cool_db a distance | + | On peut ainsi acceder a la base MaBase a distance |
- | mongo -u ian -p secretPassword MONPC/cool_db | + | mongo -u monId -p secretPassword MONPC/MaBase |
=== Creation de la base === | === Creation de la base === | ||
Line 53: | Line 54: | ||
Les tables sont creees par insertion par le script python | Les tables sont creees par insertion par le script python | ||
- | ==== Client ==== | ||
- | Du cote client, seul l'acces au base mongodb est necessaire a travers des scripts python. Sur les distributions basees sur debian il suffit d'installer | + | ==== Backup ==== |
- | le paquet ''python-pymongo'' | + | |
- | sudo apt-get install python-pymongo | + | Pour sauvegAarder sur un PC distant |
- | ===== Acces et modification des configurations des ASICs ===== | + | mongodump --forceTableScan --host monPC --port 27017 --username monId --password monPwd --db MaBase --out /data/local/mgbackup17/ |
+ | |||
+ | |||
+ | Pour restaurer sur un autre monPC1 | ||
+ | * Installer mongodb sur monPC1 | ||
+ | * creer l'utilisateur monID | ||
+ | * copier le repertoire mgbackup17 | ||
+ | mongorestore mgbackup17/ | ||
- | ==== Representation des ASICs ==== | + | et c'est fini. |
- | Un state est un nom une version et une liste d'asic. En cas de modification d'un parametre, une nouvelle entree des asics modifies est faite. | + | |
- | La liste et le numero de version sont aussi aussi modifies | + | |
- | Chaque ASIC est identifie par son numero de DIF et son numero d'ASIC, un tag ''address'' peut egalement etre utilise. Les valeurs de chargement du slow control | ||
- | sont enumerees sou le tag ''slc''. Elles correspondent aux parametres decrits dans les documentations des deux chips. | ||
- | === PETIROC === | + | ==== Client ==== |
- | Le numero de DIF correspond a l'adresse IP: | + | Du cote client, seul l'acces au base mongodb est necessaire a travers des scripts python. Sur les distributions basees sur debian il suffit d'installer |
+ | le paquet ''python-pymongo'' en python2 | ||
- | 3594 = 0xe0a => 15.10 et l'adresse IP est 192.168.10.15 | + | sudo apt-get install python-pymongo |
+ | |||
+ | |||
+ | === Addendum === | ||
+ | L'access se fait maintenant par defaut avec python3 | ||
- | {"dif": 3594, "num": 1, | + | sudo apt-get install python3-pip |
- | "slc": | + | sudo pip3 install pymongo |
- | {"6bDac": [1, 1, 1, 1, 30, 28, 31, 30, 30, 25, 30, 38, 39, 30, 33, 41, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | + | |
- | "Cf0_1p25pF": 0, "Cf1_2p5pF": 0, "Cf2_200fF": 0, "Cf3_100fF": 0, "Choice_Trigger_Out": 0, "DIS_razchn_ext": 0, "DIS_razchn_int": 1, | + | |
- | "DIS_trig_mux": 1, "DIS_triggers": 0, "DacDelay": 31, "EN10bDac": 1, "EN_80M": 0, "EN_NOR32_charge": 0, "EN_NOR32_time": 1, "EN_adc": 0, | + | |
- | "EN_bias_6bit_dac": 1, "EN_bias_charge": 0, "EN_bias_dac_delay": 0, "EN_bias_discri": 1, "EN_bias_discri_adc_charge": 0, "EN_bias_discri_adc_time": 0, | + | |
- | "EN_bias_discri_charge": 0, "EN_bias_pa": 1, "EN_bias_ramp_delay": 0, "EN_bias_sca": 0, "EN_bias_tdc": 0, "EN_discri_delay": 0, "EN_dout_oc": 0, | + | |
- | "EN_fast_lvds_rec": 1, "EN_slow_lvds_rec": 1, "EN_temp_sensor": 0, "EN_transmit": 0, "EN_transmitter": 0, | + | |
- | "InputDac": [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], | + | |
- | "InputDacCommand": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | + | |
- | "MaskDiscriCharge": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | + | |
- | "MaskDiscriTime": [1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | + | |
- | "ON_OFF_1mA": 1, "ON_OFF_2mA": 1, "ON_OFF_input_dac": 1, "ON_OFF_otaQ": 0, "ON_OFF_ota_mux": 0, "ON_OFF_ota_probe": 0, "PA_ccomp_0": 1, "PA_ccomp_1": 1, "PA_ccomp_2": 1, "PA_ccomp_3": 1, | + | |
- | "PP10bDac": 0, "PP_adc": 0, "PP_bias_6bit_dac": 0, "PP_bias_charge": 0, "PP_bias_dac_delay": 0, "PP_bias_discri": 0, "PP_bias_discri_adc_charge": 0, "PP_bias_discri_adc_time": 0, | + | |
- | "PP_bias_discri_charge": 0, "PP_bias_pa": 0, "PP_bias_ramp_delay": 0, "PP_bias_sca": 0, "PP_bias_tdc": 0, "PP_discri_delay": 0, "PP_fast_lvds_rec": 0, "PP_slow_lvds_rec": 0, | + | |
- | "PP_temp_sensor": 0, "PP_transmitter": 0, "SEL_80M": 0, "VthDiscriCharge": 863, "VthTime": 515, "cmd_polarity": 0, "header": 1, "latch": 1, "sel_starb_ramp_adc_ext": 0, "usebcompensation": 0}} | + | |
- | === HARDROC 2 === | + | ===== Acces et modification des configurations des ASICs ===== |
- | == GRIC board == | ||
- | Cette fois ci l'adresse IP est specifiee, 4708=0x1264 ==> 18.100 | + | [[Representation_asic_json| Representation des ASICs]] |
- | + | ||
- | {"address": "192.168.100.18", "dif": 4708, "num": 1, | + | |
- | "slc": { | + | |
- | "B0": 145, "B1": 250, "B2": 250, "CLKMUX": 1, "CMDB0FSB1": 1, "CMDB0FSB2": 1, "CMDB0SS": 0, "CMDB1FSB1": 1, "CMDB1FSB2": 1, | + | |
- | "CMDB1SS": 0, "CMDB2FSB1": 0, "CMDB2FSB2": 0, "CMDB2SS": 0, "CMDB3FSB1": 1, "CMDB3FSB2": 1, "CMDB3SS": 0, | + | |
- | "CTEST": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | + | |
- | "DACSW": 1, "DISCRI0": 1, "DISCRI1": 1, "DISCRI2": 1, "DISCROROR": 1, "ENOCCHIPSATB": 1, "ENOCDOUT1B": 1, "ENOCDOUT2B": 0, | + | |
- | "ENOCTRANSMITON1B": 1, "ENOCTRANSMITON2B": 0, "ENTRIGOUT": 1, "EN_OTAQ": 1, "HEADER": 1, | + | |
- | "MASK0": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | + | |
- | "MASK1": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | + | |
- | "MASK2": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | + | |
- | "OTABGSW": 1, "OTAQ_PWRADC": 1, | + | |
- | "PAGAIN": [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, | + | |
- | 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], | + | |
- | "PWRONBUFF": 1, "PWRONFSB0": 1, "PWRONFSB1": 1, "PWRONFSB2": 1, "PWRONPA": 1, "PWRONSS": 0, "PWRONW": 1, "QSCSROUTSC": 1, "RAZCHNEXTVAL": 0, "RAZCHNINTVAL": 1, | + | |
- | "RS_OR_DISCRI": 1, "SCON": 1, "SEL0": 1, "SEL1": 0, "SELENDREADOUT": 1, "SELSTARTREADOUT": 1, "SMALLDAC": 0, | + | |
- | "SW100F0": 1, "SW100F1": 1, "SW100F2": 1, "SW100K0": 1, "SW100K1": 1, "SW100K2": 1, "SW50F0": 1, "SW50F1": 1, "SW50F2": 1, | + | |
- | "SW50K0": 1, "SW50K1": 1, "SW50K2": 1, "SWSSC": 7, "TRIG0B": 1, "TRIG1B": 0, "TRIG2B": 0, "TRIGEXTVAL": 0}} | + | |
- | + | ||
- | == DIF board == | + | |
- | + | ||
- | Un tag ''address'' est defini pour avoir une approche unifiee: 0.0.0.#dif | + | |
- | + | ||
- | { | + | |
- | "address": "0.0.0.5", "dif": 5, "num": 1, | + | |
- | "slc": | + | |
- | {"B0": 170, "B1": 250, "B2": 250, "CLKMUX": 1, "CMDB0FSB1": 1, "CMDB0FSB2": 1, "CMDB0SS": 0, "CMDB1FSB1": 1, "CMDB1FSB2": 1, | + | |
- | "CMDB1SS": 0, "CMDB2FSB1": 0, "CMDB2FSB2": 0, "CMDB2SS": 0, "CMDB3FSB1": 1, "CMDB3FSB2": 1, "CMDB3SS": 0, | + | |
- | "CTEST": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | + | |
- | "DACSW": 1, "DISCRI0": 1, "DISCRI1": 1, "DISCRI2": 1, "DISCROROR": 1, "ENABLED": 1, "ENOCCHIPSATB": 1, "ENOCDOUT1B": 1, "ENOCDOUT2B": 0, "ENOCTRANSMITON1B": 1, "ENOCTRANSMITON2B": 0, "ENTRIGOUT": 1, "EN_OTAQ": 1, "HEADER": 1, | + | |
- | "MASK0": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | + | |
- | "MASK1": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | + | |
- | "MASK2": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | + | |
- | "OTABGSW": 1, "OTAQ_PWRADC": 1, | + | |
- | "PAGAIN": [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, | + | |
- | 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], | + | |
- | "PWRONBUFF": 1, "PWRONFSB0": 1, "PWRONFSB1": 1, "PWRONFSB2": 1, "PWRONPA": 1, "PWRONSS": 0, "PWRONW": 1, "QSCSROUTSC": 1, "RAZCHNEXTVAL": 0, "RAZCHNINTVAL": 1, | + | |
- | "RS_OR_DISCRI": 1, "SCON": 1, "SEL0": 1, "SEL1": 0, "SELENDREADOUT": 1, "SELSTARTREADOUT": 1, "SMALLDAC": 0, "SW100F0": 1, "SW100F1": 1, "SW100F2": 1, "SW100K0": 1, "SW100K1": 1, "SW100K2": 1, "SW50F0": 1, "SW50F1": 1, "SW50F2": 1, | + | |
- | "SW50K0": 1, "SW50K1": 1, "SW50K2": 1, "SWSSC": 7, "TRIG0B": 1, "TRIG1B": 0, "TRIG2B": 0, "TRIGEXTVAL": 0}} | + | |
==== MongoRoc object ==== | ==== MongoRoc object ==== | ||
Line 283: | Line 237: | ||
- PARAMETER, un objet JSON pour acceder aux parametres de l'application (format libre) | - PARAMETER, un objet JSON pour acceder aux parametres de l'application (format libre) | ||
- | === Liste des processus === | + | La description JSON des differents processus se trouve dans [[Liste_processus_json| Liste des descriptions de processus]] |
- | == SDCC == | + | ==== La classe MongoJob ==== |
- | { | + | La classe //MongoJob// est decrite dans le fichier {{ :pdf:mongojob.pdf |}} |
- | "ARGS": [], | + | |
- | "ENV": [ | + | Un objet //MongoJob// permet l'acces a la base MongoDB par le meme mecanisme de varaible d'environnement MGDBLOGIN. Il permet en outre |
- | "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", | + | |
- | "LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/opt/dhcal/lib:$LD_LIBRARY_PATH", | + | * d'inserer une fichier de configuration associe a un nom et une version |
- | "WEBPORT=41000" | + | * de lister les configurations enregistrees |
- | ], | + | * de telecharger dans // /dev/shm/mgjob/ // une configuration |
- | "NAME": "CCCSERVER", | + | * de reccuperer un nouveau numero de run pour un setup de prise de donnee et de commenter ce run |
- | "PARAMETER": { | + | * de lister l'ensemble des runs effectues |
- | "device": "DCCCCC01" <=== FTDI name | + | |
- | }, | + | ==== Le script mgjob ==== |
- | "PROGRAM": "/opt/dhcal/bin/lydaq_daemon_Sdcc" | + | |
- | } | + | Le script est une interface en ligne de commande du module //MongoJob// |
+ | |||
+ | usage: mgjob [-h] | ||
+ | [--upload-config | --configurations | --download | --runs | --new-run] | ||
+ | [--version VERSION] [--name NAME] [--comment COMMENT] | ||
+ | [--location LOCATION] [--file FILE] | ||
+ | optional arguments: | ||
+ | -h, --help show this help message and exit | ||
+ | --upload-config Upload new config with --name=NAME --file=FILE and | ||
+ | optional --comment=xxx and --version=num | ||
+ | --configurations List all the available configurations | ||
+ | --download download the configuration specified in --name=config | ||
+ | name --version=version | ||
+ | --runs List all the taken runs | ||
+ | --new-run Find last run of a given setup (--location setup) and | ||
+ | fill the lastrun.sjon with the next runid Optional: | ||
+ | --comment=xxxx | ||
+ | --version VERSION DB configuration version | ||
+ | --name NAME Configuration name | ||
+ | --comment COMMENT Comment | ||
+ | --location LOCATION Setup name | ||
+ | --file FILE Configuration file | ||
- | == DIFManager == | ||
- | { | ||
- | "ARGS": [], | ||
- | "ENV": [ | ||
- | "PATH=/opt/dhcal/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", | ||
- | "LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/opt/dhcal/lib:$LD_LIBRARY_PATH", | ||
- | "PYTHONPATH=/opt/dhcal/script/:$PYTHONPATH", | ||
- | "CONFDB_WEB=cmsLyon/RPC_2008@ilcconfdb.ipnl.in2p3.fr", | ||
- | "WEBPORT=40000", | ||
- | "INSTANCE=0" | ||
- | ], | ||
- | "NAME": "DIFMANAGER", | ||
- | "PARAMETER": { | ||
- | "detectorId": 100, <== Event builder detector id | ||
- | "dif": { | ||
- | "db": { <== DB access description | ||
- | "mode": "mongo", | ||
- | "state": "DIFTEST_DOME", | ||
- | "version": 3 | ||
- | } | ||
- | }, | ||
- | "publish": "tcp://lyosdhcal9:5556" <== data publication port | ||
- | }, | ||
- | "PROGRAM": "/opt/dhcal/bin/lydaq_daemon_DIF" | ||
- | } | ||
- | | ||
- | == DAQ control == | ||
- | |||
- | { | ||
- | "ARGS": [], | ||
- | "ENV": [ | ||
- | "LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/opt/dhcal/lib:$LD_LIBRARY_PATH", | ||
- | "WEBPORT=45000" | ||
- | ], | ||
- | "NAME": "FDAQ", | ||
- | "PARAMETER": { <== Slow control publication information | ||
- | "TCPPort": 5500, | ||
- | "location": "DOME_ALGECO_FEB2019", <== Compulsary for run start | ||
- | "period": 30, | ||
- | "s_ctrlreg": "0x815A1B00" | ||
- | }, | ||
- | "PROGRAM": "/opt/dhcal/bin/lydaq_daemon_Control" | ||
- | } | ||
- | |||
- | == Event Builder == | ||
- | { | ||
- | "ARGS": [], | ||
- | "ENV": [ | ||
- | "LD_LIBRARY_PATH=/opt/dhcal/root/lib:/usr/lib:/usr/local/lib:/opt/dhcal/lib:$LD_LIBRARY_PATH", | ||
- | "WEBPORT=46000" | ||
- | ], | ||
- | "NAME": "WRITER", | ||
- | "PARAMETER": { | ||
- | "dif": 1, | ||
- | "directory": "/data/NAS/TEST_BAKELITE", <== data writing directory | ||
- | "processor": [ <== List of data processor | ||
- | "binarywriter", | ||
- | "lydaq_pluggins_monitor", | ||
- | "lydaq_pluggins_rootwriter", | ||
- | "lydaq_pluggins_lciowriter" | ||
- | ], | ||
- | "shmpath": "/dev/shm/monitor", <== Monitoring storage directory | ||
- | "stream": [ <== Liste of listening ports | ||
- | "tcp://*:5556" | ||
- | ] | ||
- | }, | ||
- | "PROGRAM": "/opt/dhcal/bin/lydaq_daemon_Builder" | ||
- | } | ||