HPE Morpheus Enterprise Software
1856406 Members
5169 Online
104112 Solutions
New Discussion

Python venv ephemeral

 
Not applicable

Python venv ephemeral

Hi,

I’m looking to dynamically change IaC in Git based on user input. We then run that new code. I’m not sure of another way of doing this but I was going to use GitPython in a Python task but I need to set Git credentials or the key. Obviously if the venv is shared across the box I may expose credentials to other users. If venvs are like previous version of Ansible Tower that have ephemeral venvs or at least venvs per user/task then I haven’t set global Git credentials.

So is the Python venv shared? I was also wondering with one or multiple venvs running multiple Python tasks doesn’t it create GIL issues?

Thanks Mark

2 REPLIES 2
Not applicable

Re: Python venv ephemeral

Perfect thanks, that is how I assumed things worked but I’m new to Morpheus.

Not applicable

Re: Python venv ephemeral

The venv for Morpheus Python tasks is dynamically created each time the task is run. If you need to set a git SSH private key up to have GitPython use it, you may have to create a file, have GitPython reference it for the SSH authentication and clean it up afterward. The private key could be retrieved from the Morpheus Cypher and used in your Python code.