Skip to content

Update CI#24

Merged
tacaswell merged 10 commits intomasterfrom
update-ci
Mar 19, 2021
Merged

Update CI#24
tacaswell merged 10 commits intomasterfrom
update-ci

Conversation

@AbbyGi
Copy link

@AbbyGi AbbyGi commented Mar 2, 2021

Updating to test latest environment

@mrakitin
Copy link
Contributor

mrakitin commented Mar 3, 2021

Power-cycled the PR to pick up the new version of xpdconf with the fix for the missing examples/*.yaml files (nsls-ii-forge/xpdconf-feedstock#5).

@AbbyGi AbbyGi changed the base branch from master to mnt_prep_for_demo March 9, 2021 16:12
@AbbyGi
Copy link
Author

AbbyGi commented Mar 9, 2021

@tacaswell, we're trying to update the CI at PDF and we came across this error:

[E 2021-03-09 16:18:44,840.840 nslsii.ipython  logutils:56] could not determine a constructor for the tag 'tag:yaml.org,2002:python/object/apply:numpy.core.multiarray.scalar'
  in "/home/vsts/.config/acq/glbl.yml", line 15, column 13
Traceback (most recent call last):
  File "/home/vsts/miniconda/envs/collection-2021-1.0/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3418, in run_code
    return self.construct_document(node)
  File "/home/vsts/miniconda/envs/collection-2021-1.0/lib/python3.7/site-packages/yaml/constructor.py", line 60, in construct_document
    for dummy in generator:
  File "/home/vsts/miniconda/envs/collection-2021-1.0/lib/python3.7/site-packages/yaml/constructor.py", line 413, in construct_yaml_map
    value = self.construct_mapping(node)
  File "/home/vsts/miniconda/envs/collection-2021-1.0/lib/python3.7/site-packages/yaml/constructor.py", line 218, in construct_mapping
    return super().construct_mapping(node, deep=deep)
  File "/home/vsts/miniconda/envs/collection-2021-1.0/lib/python3.7/site-packages/yaml/constructor.py", line 143, in construct_mapping
    value = self.construct_object(value_node, deep=deep)
  File "/home/vsts/miniconda/envs/collection-2021-1.0/lib/python3.7/site-packages/yaml/constructor.py", line 100, in construct_object
    data = constructor(self, node)
  File "/home/vsts/miniconda/envs/collection-2021-1.0/lib/python3.7/site-packages/yaml/constructor.py", line 429, in construct_undefined
    node.start_mark)
yaml.constructor.ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/object/apply:numpy.core.multiarray.scalar'
  in "/home/vsts/.config/acq/glbl.yml", line 15, column 13

We were able to reproduce the error locally by copying the pdf.yml and glbl.yml files from your comment (#23 (comment)) and then importing

from xpdacq.xpdacq_conf import (glbl_dict, configure_device,
                                _reload_glbl, _set_glbl,
                                _load_beamline_config)

from https://github.com/NSLS-II-PDF/profile_collection/blob/mnt_prep_for_demo/startup/94-load.py#L19-L21

ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/object/apply:numpy.core.multiarray.scalar' 
  in "/Users/abigailgiles/.config/acq/glbl.yml", line 15, column 13  

cc @st3107

@st3107
Copy link

st3107 commented Mar 9, 2021 via email

@mrakitin
Copy link
Contributor

mrakitin commented Mar 9, 2021

I will look into this.

Thanks, @st3107. I think we are using glbl.yml in the wrong location. @AbbyGi and I are trying to move it to a different place.

Are there any instructions on how to deal with the xpdAcq configuration? It looks like a very complicated system, so good guidance may be needed.

@AbbyGi
Copy link
Author

AbbyGi commented Mar 9, 2021

TODO next:
Address this error:

[E 2021-03-09 17:12:57,318.318 nslsii.ipython  logutils:56] [Errno 2] No such file or directory: '/mnt/data/bnl/xpdacq_special/data/xpdConfig/xpd_beamline_config.yml'

@st3107
Copy link

st3107 commented Mar 12, 2021

I just figured out the xpdAcq configuration system. In total, the configuration requires two files: (a) a basic configuration yaml file for the software (b) a xpd_beamline_config.yaml for the metadata of the beamline.

How the configuration are loaded:

  1. First, the software will search the yaml file in the following places:

~/.config/acq
python/etc/acq
/etc/acq

If it finds one, load it to dictionary, else use default simulation configuration dictionary. Then, it will process the data in the dictionary and generate more key value pairs (detail in xpdConf package). This dicionary is the glbl used in the ipython session. It contains info like where to save the data and how long time the dark window is.

  1. When the beamtime is started, another yaml file xpd_beamline_config.yaml will be loaded. This file should be allocated at glbl[BASE_DIR]/glbl[BLCONFIG_DIR_NAME]/glbl[BLCONFIG_NAME]. Here, glbl is the directory from step 1. This file should contain a message like this:
Verification time: '2021-01-09 17:45:59'
Verified by: AUTO VERIFIED IN TEST
hadtoedit: false
is_pytest: false

@st3107
Copy link

st3107 commented Mar 12, 2021

Thus, the solution to the error is that we can add a command in CI to create a yaml file with the content shown below at the location glbl[ARCHIVE_ROOT_DIR]/glbl[BLCONFIG_DIR_NAME]/glbl[BLCONFIG_NAME]. Or we can add the command in ipython startup to create this file.

Verification time: '2021-01-09 17:45:59'
Verified by: AUTO VERIFIED IN TEST
hadtoedit: false
is_pytest: false

@mrakitin
Copy link
Contributor

Hi @st3107, thanks for the extra details! We will try it with @AbbyGi next week.

Why are there repeating lines in the following block?

~/.config/acq
/etc/acq
/etc/acq

Is the last /etc/acq record supposed to be something else?

@st3107
Copy link

st3107 commented Mar 12, 2021

Sorry for the typos. It should be like this:

~/.config/acq
python/etc/acq
/etc/acq

Also, the path to xpd_beamline_config.yaml should be glbl[BASE_DIR]/glbl[BLCONFIG_DIR_NAME]/glbl[BLCONFIG_NAME]. I corrected them in my last comment.

@AbbyGi AbbyGi changed the base branch from mnt_prep_for_demo to master March 17, 2021 19:32
@AbbyGi AbbyGi marked this pull request as ready for review March 17, 2021 20:43
@AbbyGi AbbyGi requested review from DanOlds, dmgav and tacaswell March 17, 2021 20:44
Copy link
Contributor

@mrakitin mrakitin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We worked on it together with @AbbyGi, so it looks great!

@tacaswell tacaswell merged commit 97ea48b into master Mar 19, 2021
@tacaswell tacaswell deleted the update-ci branch March 19, 2021 14:05
@tacaswell tacaswell mentioned this pull request Mar 19, 2021
@mrakitin
Copy link
Contributor

Thanks, @tacaswell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants