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
Problem: UsePythonVersion on self-hosted agents is open to side effects from previous builds #15417
Comments
@max-zaytsev ping 🙂any chances of getting this clarified? |
I am starting to think this should have been marked as a bug 🐛. UsePythonVersion having different behavior in self-hosted or microsoft-hosted agents does not feel right. |
@max-zaytsev will I get an answer? |
Hi @FrancescElies, |
@max-zaytsev Maybe I am having the wrong expectations. On ms-hosted you can do: steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.9'
-run: pip install -r my-pinned-packages.txt
# this is just fine, packages are installed
# and on the next run I get a new VM and a
# clean python venv On self-hosted the same pattern is broken: steps:
# this now installs things in Agent.ToolsDirectory
# which is shared between builds. One ends up installing
# python packages on the same installation across builds.
- task: UsePythonVersion@0
inputs:
versionSpec: '3.9'
-run: pip install -r my-pinned-packages.txt
# this is normally fine, unless something strange happens
# and the python environment gets broken. I would expect getting a clean python environment when I call As mentioned above this is normally not a problem, but sometimes strange things happen. In self hosted we need to create a new venv to make sure we don't pollute Making us having to distinguish between self-hosted or ms-hosted agents when we write yaml ci code is not optimal. Are my expectations wrong? |
Hi @FrancescElies we are currently working on more prioritized issues, but will get back to this one be able to. |
Thanks for the update |
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days |
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days |
Don’t close please. We have a workaround but the behavior is in my opinion not consistent |
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days |
Required Information
Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Question
Enter Task Name: UsePythonVersion
Issue Description
When using UsePythonVersion with ms-hosted agents everything works
nicely, you get a clean environment on every build (you get a clean machine) 👌.
When using the same task in self-hosted agents you get the selected
python environent under AGENT_TOOLSDIRECTORY leaving the door open to
side effects due to inplace modifications of that virtual environment in
that self-hosted machine.
Shouldn't UsePythonVersion provide a clean virtual environent in
self-hosted machines to avoid side effects?
The text was updated successfully, but these errors were encountered: