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

Exit Code from scif run #67

Open
dmachi opened this issue Jan 23, 2024 · 12 comments
Open

Exit Code from scif run #67

dmachi opened this issue Jan 23, 2024 · 12 comments

Comments

@dmachi
Copy link
Contributor

dmachi commented Jan 23, 2024

When launching an app with run, a zero exit code is always returned. As far as I can tell, the code will only return the app's exit code if _exec is called with interactive=True and exit=True. The run() command has interactive explicitly set to False on https://github.com/vsoch/scif/blob/master/scif/main/commands.py#L166. Is there anyway to force that exit code to return properly?

@vsoch
Copy link
Owner

vsoch commented Jan 23, 2024

If you want to open a PR to expose that variable, that would be welcome. The expected use case is that if you are wanting interactive, you'd be using exec.

@dmachi
Copy link
Contributor Author

dmachi commented Jan 23, 2024

Thank you for the prompt reply. Is there some reason why one would NOT want run() to return the exit code of the thing it is running? I'm curious because apptainer does return that exit code from the app run. It makes it difficult to include this in other scripts without an exit code. I am happy to create patch and PR for this, but am wondering if you would accept it if run just always exited with whatever exit code the command exited with?

@vsoch
Copy link
Owner

vsoch commented Jan 23, 2024

Honestly this project is so old I don't remember the details. I agree with you it makes sense to return it, and I'm happy to accept a PR.

@dmachi
Copy link
Contributor Author

dmachi commented Jan 23, 2024

LOL. We were wondering if it was still alive :). We'll get a patch created if we don't find a lazier alternative solution.

@vsoch
Copy link
Owner

vsoch commented Jan 23, 2024

I maintain hundreds of projects, so I will work on them on an as-needs basis. I'm glad you are using SCIF!

@dmachi
Copy link
Contributor Author

dmachi commented Jan 24, 2024

I've created PR #68 to address this.

@vsoch
Copy link
Owner

vsoch commented Jan 24, 2024

Closed with #68

@vsoch vsoch closed this as completed Jan 24, 2024
@vsoch vsoch reopened this Jan 25, 2024
@vsoch
Copy link
Owner

vsoch commented Jan 25, 2024

@dmachi we broke upstream tests, so I had to revert and we will need to address this in another way.

@dmachi
Copy link
Contributor Author

dmachi commented Jan 25, 2024

@vsoch Can you be more specific on what upstream tests are failing so I can figure out how to fix this. Am I able to see those tests and results? I thought my changes should only really add that exit code after the output of the job (which it was already doing).

@vsoch
Copy link
Owner

vsoch commented Jan 25, 2024

See #70

@vsoch
Copy link
Owner

vsoch commented Jan 25, 2024

@vsoch
Copy link
Owner

vsoch commented Jan 25, 2024

and ping @dtrudg - let's make sure we add a test this time to not break things.

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

No branches or pull requests

2 participants