-
Notifications
You must be signed in to change notification settings - Fork 7
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
Automatic code
object creation can fail if another process writes to the subshell
#100
Comments
Thank Mr. Johnston for the report. As a first workaround you could opt to set the As for a proper fix, I am wondering what the correct behavior should be. First step is to detect the problem. I could check if the captured And then there is how to act on it. Should we just raise a warning, or try to fix it by automatically extracting what should be the executable path? Not sure if the latter can be done reliably. Any ideas? |
Yes, I had the same struggle when thinking about fixes. I also pondered whether it is necessary to fix it - is it the reasonable to expect that there will be no additional output on SSH'ing to a machine? I think I can argue either way. These informational messages are fairly common on managed trad HPC. If we can send more than one command over the transport, and guarentee that they are run in the same shell, then perhaps you can specify your own delimiter - like |
Not really. That is also why
I think this is indeed a viable solution: In [1]: from aiida.transports.plugins.local import LocalTransport
In [2]: with LocalTransport(use_login_shell=True) as t:
...: exit_code, stdout, stderr = t.exec_command_wait('echo "DELIMITER";which cat; echo "/DELIMITER"')
...: print(stdout)
...:
LOAD PROFILE
DELIMITER
/usr/bin/cat
/DELIMITER The That being said, I am starting to wonder whether we actually want this feature at all. I already had to add the The original reasoning was to add some validation when a user ran a shell job in case they made a typo in the command name. But perhaps, instead of anticipating it with all the associated pitfalls, it is best to leave determining a non existing command to the parser that will just parse that from the job's output. Since we are always expecting a bash shell on the other end, I think the message should always be Do you still think a benefit of having the check in the |
When
aiida-shell
runs with some arbitrary command, likecat
, an AiiDAcode
object is created automatically.Part of this process is calling
which
to get the path to the arbitrary command:aiida-shell/src/aiida_shell/launch.py
Line 131 in 2ab8219
On my machine, I've seen a helpful warning from a sysadmin process being written to the subshell on invocation, and thus this bonus message get prepended to the output of
which
. This then ends up in the_aiidasubmit.sh
script written by_prepareforsubmission
.An example of the created faulty
code
is like this:The text was updated successfully, but these errors were encountered: