Skip to content
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

Support disconnected environment for Pipeline SDK tests #1730

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

diegolovison
Copy link
Contributor

@diegolovison diegolovison commented Aug 16, 2024

Support disconnected environment for Pipeline SDK tests.

Tested on the disconnected environment by setting PIP_INDEX_URL.
Tested on a cluster with access to the internet without PIP_INDEX_URL.

Copy link
Contributor

github-actions bot commented Aug 16, 2024

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass %
522 0 0 522 100

@jstourac
Copy link
Member

@diegolovison just to be sure - do I understand correctly that since we're compiling the pipeline code here ourselves, this change will be still needed even once the https://issues.redhat.com/browse/RHOAIENG-6376 is fixed, correct?

Comment on lines 98 to 101
# the run_robot_test.sh is sending the --variablefile ${TEST_VARIABLES_FILE}
# there is no way to double-check if a the key is presented there
# the workaround is the following
# https://issues.redhat.com/browse/RHOAIENG-6376
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# the run_robot_test.sh is sending the --variablefile ${TEST_VARIABLES_FILE}
# there is no way to double-check if a the key is presented there
# the workaround is the following
# https://issues.redhat.com/browse/RHOAIENG-6376
# The run_robot_test.sh is sending the --variablefile ${TEST_VARIABLES_FILE}
# which may contain the `PIP_INDEX_URL` and `PIP_TRUSTED_HOST` variables,
# e.g. for disconnected testing. In such case we need to pass them to the
# `Create Run From Pipeline Func` so that it knows when to amend the pipeline
# code for the https://issues.redhat.com/browse/RHOAIENG-6376 issue.

@diegolovison
Copy link
Contributor Author

this change will be still needed even once the https://issues.redhat.com/browse/RHOAIENG-6376 is fixed, correct?

Yes.

jstourac
jstourac previously approved these changes Aug 19, 2024
Comment on lines 100 to 102
# `PIP_INDEX_URL` or `PIP_TRUSTED_HOST was definied. The only way is by calling Run Keyword And Return Status
# Log If it returns true, means that we are running the test in a disconnected environment.
${pip_index_url_definied} Run Keyword And Return Status Log ${PIP_INDEX_URL}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is not the only way, but there is a built-in function in RF: https://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Get%20Variable%20Value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will end up in the same situation. Logging or getting will return an error if the variable doesn't exists.
The real way to solve is by checking if the variable exists and I didn't find any function.

Copy link

file_content = file.read()
file_content = file_content.replace(
"python3 -m pip install",
f"python3 -m pip install --index-url {pip_index_url} --trusted-host {pip_trusted_host}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @diegolovison , could we remove --trusted-host {pip_trusted_host}?
We would like to cover also self-signed certs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. This is related to kubeflow/pipelines#10720

@diegolovison diegolovison merged commit be6c8c4 into red-hat-data-services:master Aug 21, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants