-
Notifications
You must be signed in to change notification settings - Fork 4
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 option to set environment variables when invoking singularity #334
Comments
Yep, and you'll also need to add it to the bind paths in the singularity backend options. Just as a workaround for now. My proposed sustainable solution:
Then these sorts of things could be available across all backends uniformly. |
I tried the above but it doesn't seem like the environment variable is getting passed through correctly. If I look at the dumped config file I see following for the backend settings opts:
backend:
default_registry: quay.io/stimela2
override_registries: {}
select: singularity
singularity:
enable: true
image_dir: /home/bester/.singularity
auto_build: true
rebuild: true
executable: null
remote_only: false
bind_dirs:
/home/bester/projects/ESO137: rw If I look at the cab that gets invoked I also see the following under the management:
environment:
NUMBA_CACHE_DIR: /home/bester/projects/ESO137/numba_cache
cleanup: {}
wranglers: {} But printing the numba cache dir from inside a worker produces
which means it hasn't been set. I guess I could dive into the singularity backend but wouldn't even be sure what to look for. Any ideas? |
Hilariously, I ran into this during a pipeline run yesterday. I have implemented a very basic fix in the selfcal-1:
info: |
Use quartical to perform basic selfcal. Solves for a delay and phase
term per scan. Note that the selfcal step may require tuning based
on the field and instrument in question.
_use: lib.steps.quartical.k
backend:
singularity:
bind_dirs:
/home/kenyon/numba_cache_dir: rw
env:
NUMBA_CACHE_DIR: /home/kenyon/numba_cache_dir
params:
K.time_interval: 4 I appreciate that this may not be the best solution, but it is a simple one which can be used to check that this is the root cause of the original error. In principle, all backends should likely support an Edit: I am still rerunning the recipe to see if this has solved the problem. |
The above also has the advantage of being easily configurable for both the entire recipe and per step. |
This does seem to have fixed the issue for me (assuming it isn't intermittent). |
Awesome, this seems to have fixed the problem for me. Thanks @JSKenyon |
Yeah the
|
We have this option for the kube backend but not for singularity. It is useful for things like caches. In my case I ran into
which I am assuming happens because numba is caching directly to the singularity image and this must have some sort of limit set?
The workaround I am testing is to merge in a separate config which sets
Is this the correct thing to do?
The text was updated successfully, but these errors were encountered: