Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: get_info s3df compatibility #179

Merged
merged 3 commits into from
Apr 10, 2024

Conversation

ZLLentz
Copy link
Member

@ZLLentz ZLLentz commented Apr 10, 2024

Description

  • rename get_info to get_info.py and wrap in a get_info bash script
  • use the bash script to select a python environment based on which is available
  • do not activate the full environment for speed, this is sufficient for get_info

Motivation and Context

  • User group wants to use these utilities in s3df
  • In general, this is a helpful thing to have
  • https://jira.slac.stanford.edu/browse/ECS-5069
  • It seems wrong to rebuild the entire controls conda env on s3df, a system without controls

How Has This Been Tested?

I set my PATH to my clone of engineering tools and removed the previous tagged engineering tools from my PATH. Then I verified functionality and failure modes on both systems:

Basic functionality (using get_lastRun): It's the same results in each system which is a good sign.

zlentz@psbuild-rhel7-02:~/.../engineering_tools/scripts(mnt_get_info_s3df -)$ ./get_lastRun -H xpp
5
zlentz@psbuild-rhel7-02:~/.../engineering_tools/scripts(mnt_get_info_s3df -)$ ./get_lastRun -H tmo
131
zlentz@psbuild-rhel7-02:~/.../engineering_tools/scripts(mnt_get_info_s3df -)$ ./get_lastRun -H cxi
18
[zlentz@sdfiana008 scripts]$ ./get_lastRun -H xpp
5
[zlentz@sdfiana008 scripts]$ ./get_lastRun -H tmo
131
[zlentz@sdfiana008 scripts]$ ./get_lastRun -H cxi
18

Basic functionality using the script directly seems to work too:

zlentz@psbuild-rhel7-02:~/.../engineering_tools/scripts(mnt_get_info_s3df -)$ ./get_info --exp --hutch XPP
xppl1026722
[zlentz@sdfiana008 scripts]$ ./get_info --exp --hutch XPP
xppl1026722

Error state if the python interpreters are both not found (by modifying the script to look for the wrong ones): It tells you why it isn't running and what it tried to use.

zlentz@psbuild-rhel7-02:~/.../engineering_tools/scripts(master +)$ ./get_lastRun -H xpp
No known python executable is available! Tried all of /cds/group/pcds/pyps/conda/py36/envs/pcds-3.4.0/bin/pythonasfd /sdf/group/lcls/ds/ana/sw/conda1/inst/envs/ana-4.0.60-py3/bin/python
[zlentz@sdfiana008 scripts]$ ./get_lastRun -H xpp
No known python executable is available! Tried all of /cds/group/pcds/pyps/conda/py36/envs/pcds-3.4.0/bin/python /sdf/group/lcls/ds/ana/sw/conda1/inst/envs/ana-4.0.60-py3/bin/pythonasdfasd

Error codes from get_info.py are properly passed to get_info:

zlentz@psbuild-rhel7-02:~/.../engineering_tools/scripts(mnt_get_info_s3df -)$ ./get_info asefasfe
usage: get_info.py [-h] [--run] [--exp] [--live] [--ended] [--hutch HUTCH]
                   [--station STATION] [--getHutch] [--gethutch]
                   [--getstation] [--getbase] [--getinstrument] [--getcnf]
                   [--files_for_run FILES_FOR_RUN]
                   [--nfiles_for_run NFILES_FOR_RUN] [--setExp SETEXP]
get_info.py: error: unrecognized arguments: asefasfe
zlentz@psbuild-rhel7-02:~/.../engineering_tools/scripts(mnt_get_info_s3df -)$ echo $?
2

Where Has This Been Documented?

Only here, in the release notes later, and in the jira ticket

Copy link
Contributor

@patoppermann patoppermann left a comment

Choose a reason for hiding this comment

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

exactly what we wanted. i will test it with the users.

@patoppermann patoppermann merged commit e0b4664 into pcdshub:master Apr 10, 2024
@ZLLentz ZLLentz deleted the mnt_get_info_s3df branch April 10, 2024 22:38
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.

2 participants