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

Add charliecloud module load to Beeflow #716

Merged
merged 6 commits into from
Sep 27, 2023
Merged

Add charliecloud module load to Beeflow #716

merged 6 commits into from
Sep 27, 2023

Conversation

rstyd
Copy link
Collaborator

@rstyd rstyd commented Aug 25, 2023

This PR addresses #580.

@rstyd rstyd requested review from pagrubel and jtronge August 25, 2023 20:26
beeflow/cli.py Outdated
@@ -218,14 +218,21 @@ def version_str(version):
"""Convert a version tuple to a string."""
return '.'.join([str(part) for part in version])

def load_charliecloud():
"""Load the charliecloud module if it exists."""
subprocess.run('module load charliecloud', shell=True, check=True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this affect the environment of the current process?

Copy link
Collaborator

Choose a reason for hiding this comment

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

What happens on a system with no charliecloud module.
Is this persistent?

Copy link
Collaborator Author

@rstyd rstyd Aug 28, 2023

Choose a reason for hiding this comment

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

  1. The only impact this will have on the current process it that the charliecloud executables will be in it's path if the module exists.
  2. If a system does not contain a charliecloud module, nothing will happen this will just throw an error.
  3. This is not persistent. It only applies to the beeflow process. If the beeflow process is killed such as with beeflow stop, a system restart, or a beeflow restart it will need to be loaded again.

I'll add an additional check to make sure lmod is on the system. It will work either way, but it's kind of silly to attempt to run an application that isn't installed.

@rstyd rstyd requested a review from jtronge August 29, 2023 20:54
@pagrubel
Copy link
Collaborator

pagrubel commented Sep 5, 2023

I tried this on fog and it gives me this error:

beeflow start
Checking dependencies...
Traceback (most recent call last):

  File "/yellow/users/pagrubel/.cache/pypoetry/virtualenvs/hpc-beeflow-E-yFAdUf-py3.8/bin/beeflow", line 5, in <module>
    main()

  File "/yellow/users/pagrubel/BEE/BEE/beeflow/cli.py", line 420, in main
    app()

  File "/yellow/users/pagrubel/.cache/pypoetry/virtualenvs/hpc-beeflow-E-yFAdUf-py3.8/lib/python3.8/site-packages/typer/main.py", line 289, in __call__

  File "/yellow/users/pagrubel/.cache/pypoetry/virtualenvs/hpc-beeflow-E-yFAdUf-py3.8/lib/python3.8/site-packages/typer/main.py", line 280, in __call__

  File "/yellow/users/pagrubel/.cache/pypoetry/virtualenvs/hpc-beeflow-E-yFAdUf-py3.8/lib/python3.8/site-packages/click/core.py", line 1157, in __call__

  File "/yellow/users/pagrubel/.cache/pypoetry/virtualenvs/hpc-beeflow-E-yFAdUf-py3.8/lib/python3.8/site-packages/click/core.py", line 1078, in main

  File "/yellow/users/pagrubel/.cache/pypoetry/virtualenvs/hpc-beeflow-E-yFAdUf-py3.8/lib/python3.8/site-packages/click/core.py", line 1688, in invoke

  File "/yellow/users/pagrubel/.cache/pypoetry/virtualenvs/hpc-beeflow-E-yFAdUf-py3.8/lib/python3.8/site-packages/click/core.py", line 1434, in invoke

  File "/yellow/users/pagrubel/.cache/pypoetry/virtualenvs/hpc-beeflow-E-yFAdUf-py3.8/lib/python3.8/site-packages/click/core.py", line 783, in invoke

  File "/yellow/users/pagrubel/.cache/pypoetry/virtualenvs/hpc-beeflow-E-yFAdUf-py3.8/lib/python3.8/site-packages/typer/main.py", line 607, in wrapper

  File "/yellow/users/pagrubel/BEE/BEE/beeflow/cli.py", line 328, in start
    check_dependencies()

  File "/yellow/users/pagrubel/BEE/BEE/beeflow/cli.py", line 236, in check_dependencies
    load_charliecloud()

  File "/yellow/users/pagrubel/BEE/BEE/beeflow/cli.py", line 225, in load_charliecloud
    from env_modules_python import module #noqa No need to import at top

ModuleNotFoundError: No module named 'env_modules_python'

beeflow/cli.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@jtronge jtronge left a comment

Choose a reason for hiding this comment

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

I tried it again and it seems to work now. Once you merge in develop I'll approve.

beeflow/cli.py Outdated
def load_charliecloud():
"""Load the charliecloud module if it exists."""
lmod = os.environ.get('MODULESHOME')
from env_modules_python import module #noqa No need to import at top
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm getting a ModuleNotFoundError: No module named 'env_modules_python' on running beeflow start.

Copy link
Collaborator

@pagrubel pagrubel left a comment

Choose a reason for hiding this comment

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

Waiting on conflict resolution

@pagrubel pagrubel merged commit fc6e718 into develop Sep 27, 2023
4 checks passed
@pagrubel pagrubel deleted the load_module branch September 27, 2023 22:14
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.

3 participants