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

Allow skipping of ConfigPath validation #564

Open
boehmseb opened this issue Aug 7, 2023 · 2 comments
Open

Allow skipping of ConfigPath validation #564

boehmseb opened this issue Aug 7, 2023 · 2 comments

Comments

@boehmseb
Copy link
Collaborator

boehmseb commented Aug 7, 2023

Whenever a ConfigPath object is accessed, the validate function is called which in turn asks the user whether the path should be created if missing. This is makes it very annoying to use inside containers or when running benchbuild via slurm since we cannot always guarantee that all paths exist beforehand. It would be nice to have a mechanism that allows us to temporarily disable the user query or, at least, give us a way to create these paths without any user input (e.g., similar to how you handle tests or the CI).

@simbuerg
Copy link
Member

Sorry for the delay. I did not have access to github during vacation.

The ConfigPath should be "auto-created" whenever there is no tty attached to the parent process. If this check fails, you can "cheat" by defining CI=yes as env var.

The check itself is pretty basic and relies on Python's sys.stdin module:

ignore_stdin_istty = should_ignore_tty()
has_tty = sys.stdin.isatty() and not ignore_stdin_istty

The ignore_stdin_istty handles CI=yes or unittesting (TEST=yes)

The check should not fail when benchbuild is running inside SLURM. I have no idea, if somewhere withing SLURM -> OCI Container a stdin gets attached somewhere. It might be the case.
I could provide a CLI option or BB-style envvar for the settings to control the ignore stdin_istty setting, if that is sufficient.

@boehmseb
Copy link
Collaborator Author

Yeah, there seems to be some sort of wiredness going on in that regard.
Anyway, we now opted for simply not using ConfigPath anywhere. This works out for us since we kind of self-manage our benchbuild config anyway.

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

No branches or pull requests

2 participants