feat: get output of pip commands from env variables #92
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
For CI/CD pipelines, it's a lot of times better to install requirements.txt manifest in a dedicated agent/slave/computer/container that contains the desired python & pip versions, and invoke the rhda analysis in different agent/slave/computer/container ( let's denote it as "node") - that contains the whole infrastructure required to invoke the analysis alone ( including python and pip binaries, but the problem is that it "stuck" with a given versions of python and pip in this node, hence very limited to the versions of packages in requirements.txt).
For that purpose, and in such cases that we need to separate the analysis and the pip install to run in different steps/stages and even on different nodes, this PR introduces two environment variables, these two env variables will need to be populated with the output of the commands (pip show and pip freeze commands) encoded in base64 ( in order to preserve new lines in environment variables, the library will decode it to ASCII plain-text before passing it to the logic of the API).
Example how to retrieve in shell script:
needs to work together with setting EXHORT_PYTHON_VIRTUAL_ENV=false ( this is the default so not specifying this setting is just fine).
Off course, you need to use pipelines workspaces/shared volumes/pipes/fifos/ ipc shared memory/networking in order to pass the data from one node to another.
in case the two new environment variables are not populated, then the logic will be the same ( taking the pip freeze and pip show of the environment formed by pip and python binaries passed to the library.
Checklist