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

Virtual env is probably not being activated #3

Open
ch-ahindura opened this issue Sep 27, 2024 · 5 comments · May be fixed by #4
Open

Virtual env is probably not being activated #3

ch-ahindura opened this issue Sep 27, 2024 · 5 comments · May be fixed by #4

Comments

@ch-ahindura
Copy link
Collaborator

Issue

When we run the command below in ex3:

nqrun   --env QAL9000_API_URL="https://api.qal9000.se"   \
--env QAL9000_SERVICE_NAME="ex3"   \
--env POLL_TIMEOUT=500   \
--python python-3.8.16  \ -p armq -N 1 -n 256 --pty   sample.py

where sample.py is

"""A sample script checking environment is set appropriately"""

import os
import sys

# Don't remove this as it ensures tergite is installed
import tergite
import qiskit

print(sys.executable)
print(f"QAL9000_API_URL: {os.environ.get('QAL9000_API_URL')}")
print(f"QAL9000_API_TOKEN: {os.environ.get('QAL9000_API_TOKEN')}")
print(f"QAL9000_SERVICE_NAME: {os.environ.get('QAL9000_SERVICE_NAME')}")
print(f"POLL_TIMEOUT: {os.environ.get('POLL_TIMEOUT')}")

It raises the error:

line 6: python: command not found
@ch-ahindura
Copy link
Collaborator Author

It must be that when I was testing, the environment in the login node was somehow transferred to the compute node or something. Now the same commands fail. Maybe the ex3 admins changed that behaviour.

One potential way of solving this is it move the virtual environments to the /global/D1/homes/$(whoami) folder and have the generated bash script activate that environment. Currently the bash script itself does not activate any environment.

@JLenssen FYI

@ch-ahindura
Copy link
Collaborator Author

ch-ahindura commented Oct 3, 2024

It turns out that this only happens for specific modules that are available in the login node but not available in the compute node. In this case, 'python-3.8.16' is the culprit.

To check if a module is available in the compute module, run this:

# enter the compute node in this case: armq
srun -p armq -N 1 -n 256 --pty /bin/bash
# check which python modules are available. See if the module you want is in the list
module avail python

@ch-ahindura
Copy link
Collaborator Author

ch-ahindura commented Oct 7, 2024

@JLenssen could you have a look at this issue and its related pull request?
Note: the qiskit dependency issues seem to recur but the environment gets activated with the python module selected is also present in the compute node.

@JLenssen
Copy link

JLenssen commented Oct 7, 2024

Hi @ch-ahindura , yes I'll try to check it this week. Unfortunately, quite busy atm.

@ch-ahindura
Copy link
Collaborator Author

Sure, no worries. When you have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants