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

Using python env from within gives warnings. #364

Open
JackTemaki opened this issue Feb 23, 2023 · 8 comments
Open

Using python env from within gives warnings. #364

JackTemaki opened this issue Feb 23, 2023 · 8 comments
Assignees

Comments

@JackTemaki
Copy link
Contributor

When using python from within a sisyphus dir, there are warnings triggered by line: https://github.com/rwth-i6/i6_core/blob/main/util.py#L375
Which is e.g.:

[2023-02-23 18:22:34,536] WARNING: Creating absolute path inside current work directory: /work/asr4/rossenbach/rescale/example_sisyphus_setup/pyenv/bin/python3 (disable with WARNING_ABSPATH=False)

Caused by the changes in #261

One way to suppress this message is to use a hash_overwrite... any other ideas?

@michelwi
Copy link
Contributor

Why is the sis_command a python that lives in the setup?

@JackTemaki
Copy link
Contributor Author

Because I was working on a setup intended for non-i6 usage... for example if you use PyCharm to open a project and create an env, it will use venv in the sis setup root as default location.

@christophmluscher
Copy link
Contributor

Maybe the warning is actually to strict.. maybe it should only check alias, config, output, recipe and work?
Or add an configurable exempt dir?

@dthulke
Copy link
Member

dthulke commented Feb 24, 2023

I'd say the warning is fine. The hashes of your jobs should never depend on the location of your setup.

Another solution to hash_overwrite would be to make the path relative, i.e. change:

Path("/work/asr4/rossenbach/rescale/example_sisyphus_setup/pyenv/bin/python3")

to

Path("pyenv/bin/python3")

(even though this changes the hashes, what may be fine since nobody had a setup like this before)

@JackTemaki
Copy link
Contributor Author

JackTemaki commented Feb 24, 2023

I think there is a misunderstanding here. In this case it is not about the hashes. The warning comes because the util function has a fallback to the SIS_COMMAND entry, but it is only used from within the Jobs init function, so nothing is hashed. The SIS_COMMAND itself should have no effect on the setup results, so this is why I thought adding e.g. a hash_overwrite="DEFAULT_SIS_COMMAND to the util functions or so would be okay.

I do not see why having a venv folder in your Sisyphus setup should be bad practice.

@michelwi
Copy link
Contributor

One way to suppress this message is to use a hash_overwrite... any other ideas?

I do not like this, as there could be invisible problems when the fallback python is used and then changes somehow.

In your case I understand the problem is in fact that your (independently created) venv folder is in the root dir of the setup. The warning is only intended to come if your created Path is created by the current setup (which it isn't here) so I tend to agree with Chris:

the warning is actually to strict..

So how to resolve that:

  • you could set gs.WARNING_ABSPATH=False - but I can understand if you don't want to
  • we could add a hash_overwrite - I hope you can understand if I don't want to
  • we change the check according to chris suggestion (check if realpath(path) is in the workdir)

@JackTemaki
Copy link
Contributor Author

Okay, then lets go for option 3

@michelwi
Copy link
Contributor

ok, after discussion in rwth-i6/sisyphus#127 I see, why option 3 is not desirable.

In this light I might take back (or reduce) my reservation against option 2 ("hash overwrite")
Another suggestion (lets name it option 4 - "rel path") was to test for this case and make the path relative in this case.

Based on the code complexity I thing I might prefer option 2 now.

Any thoughts on that from this community?

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

4 participants