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

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.

1 Like

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