-
Notifications
You must be signed in to change notification settings - Fork 189
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
Docs: Add note on how to create a code that uses Conda environment #5905
Docs: Add note on how to create a code that uses Conda environment #5905
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sphuber
Some comments, but no need for further review
docs/source/howto/run_codes.rst
Outdated
In the `prepend_text`, the required Conda environment is activated as one normally would. | ||
This allows to simply specify the target executable by its name, and there is no need to specify an absolute path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may consider skipping these two lines (they seem obvious from the example above)
In the `prepend_text`, the required Conda environment is activated as one normally would. | |
This allows to simply specify the target executable by its name, and there is no need to specify an absolute path. |
|
||
.. note:: | ||
|
||
It is possible to run codes that are provided by a `Conda environment <https://docs.conda.io/en/latest/>`_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps start with the computer configuration
It is possible to run codes that are provided by a `Conda environment <https://docs.conda.io/en/latest/>`_. | |
It is possible to run codes that are provided by a `Conda environment <https://docs.conda.io/en/latest/>`_. | |
First, configure the AiiDA computer with ``--use-login-shell`` to enable access to the ``conda activate`` command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved the computer configuration to the top. But --use-login-shell
is not the correct option. It it the shebang
that should be set to #!/bin/bash -l
docs/source/howto/run_codes.rst
Outdated
The final requirement is that the computer should be configured to create a submission script that uses a login shell. | ||
To do so, make sure the computer sets ``#!/bin/bash -l`` for the `shebang` property. | ||
The ``-l`` flag in bash enforces the script to be executed using a login shell. | ||
Without this, a normal non-interactive shell is used instead, which will cause the ``conda activate`` command to fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also be dropped if you accept the suggestion above
The final requirement is that the computer should be configured to create a submission script that uses a login shell. | |
To do so, make sure the computer sets ``#!/bin/bash -l`` for the `shebang` property. | |
The ``-l`` flag in bash enforces the script to be executed using a login shell. | |
Without this, a normal non-interactive shell is used instead, which will cause the ``conda activate`` command to fail. |
If you like, you could mention the alternative of providing the absolute path and skipping conda activate
(I guess conda packages are typically reasonable with using RPATH etc. to pick up the right dependencies, but I don't have much experience with it)
This is already supported but it is important that the generated submission script uses a login script or `conda activate` will not work properly.
598289e
to
a83959f
Compare
Fixes #5895
This is already supported but it is important that the generated submission script uses a login script or
conda activate
will not work properly.