-
Notifications
You must be signed in to change notification settings - Fork 15
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
Python virtual environment isn't "activated" in kubernetes containers #44
Comments
I also see this problem. It appears the |
Any update on this topic? |
I'm having issues with Docker. I assume that the reason might be the same. I'm using
Do I understand correctly that Pyenv Pipeline Plugin currently doesn't support Docker Pipeline plugin? Or am I doing something wrong? |
Indeed it seems that the plugin does not work with Docker :( node('linux') {
docker.image('python:3.8-slim-bullseye').inside {
sh "echo python"
withPythonEnv('python') {
sh("""
which python
which python3
""")
}
}
}
It successfully creates the venv directory, but fails to use it in |
The workaround that works for us: and in the stage: |
Version report
Jenkins and plugins versions report:
Reproduction steps
Results
Expected result:
Expected the commands inside the
withPythonEnv
block to print the executable and build flags for the virtual environment.Actual result:
Given what I know about this plugin, I suppose this could be a kubernetes pipeline problem instead, with environment variables not getting passed through properly. And since this plugin hasn't been updated in a couple years, maybe this is no longer maintained? If that's the case, there is an obvious workaround of just not using this plugin, and explicitly handling the virtual environment myself in the
sh
commands. But thought I'd check if maybe this is a fixable bug, or if there's a known/official workaround.(and yes, I'm aware that in theory there's no need for the virtualenv inside a container, because the container is isolated, but due to certain combinations of dependencies, scripts, etc, it's not feasible right now to try to set up a build without the virtualenv)
The text was updated successfully, but these errors were encountered: