-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix_gpupod_check
- Loading branch information
Showing
13 changed files
with
386 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
ods_ci/tests/Resources/CLI/DataSciencePipelines/DataSciencePipelinesUpgradeTesting.resource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
*** Settings *** | ||
Documentation Upgrade Testing Keywords | ||
Resource DataSciencePipelinesBackend.resource | ||
Resource ../../../Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/Projects.resource | ||
|
||
|
||
*** Variables *** | ||
${PROJECT}= dsp-upgrade-testing | ||
${PIPELINE_LONGRUNNING_FILEPATH}= tests/Resources/Files/pipeline-samples/v2/pip_index_url/take_nap_pipeline_root_compiled.yaml # robocop: disable:line-too-long | ||
|
||
|
||
*** Keywords *** | ||
Setup Environment For Upgrade Testing | ||
[Documentation] Creates project dsp-test-upgrade and sets up the resources to test during upgrade: | ||
... - Creates a pipeline server | ||
... - Starts a pipeline that will run for 1h | ||
Create Project And Configure Pipeline Server ${PROJECT} | ||
Start Long Running Pipeline ${PROJECT} | ||
|
||
Verify Resources After Upgrade | ||
[Documentation] Verifies the status of the resources created in ${PROJECT} after the upgrade | ||
... Deletes ${PROJECT} if all verifications are correct (leaving for debugging purposes if not) | ||
DataSciencePipelinesBackend.Wait Until Pipeline Server Is Deployed namespace=${PROJECT} | ||
|
||
Verify Run Status | ||
... namespace=${PROJECT} username=${TEST_USER.USERNAME} password=${TEST_USER.PASSWORD} | ||
... pipeline_run_id=${DSP_LONGRUNNING_PIPELINE_RUN_ID} pipeline_run_expected_status=RUNNING | ||
|
||
Projects.Delete Project Via CLI By Display Name ${PROJECT} | ||
|
||
Create Project And Configure Pipeline Server | ||
[Documentation] Creates a data science pipelines project ${namespace} (deleting existing one if needed), | ||
... configures a pipeline server using the default configuration and waits until the server is running | ||
[Arguments] ${namespace} | ||
Projects.Delete Project Via CLI By Display Name ${namespace} | ||
Projects.Create Data Science Project From CLI ${namespace} | ||
DataSciencePipelinesBackend.Create Pipeline Server namespace=${namespace} | ||
... object_storage_access_key=${S3.AWS_ACCESS_KEY_ID} | ||
... object_storage_secret_key=${S3.AWS_SECRET_ACCESS_KEY} | ||
... object_storage_endpoint=${S3.BUCKET_2.ENDPOINT} | ||
... object_storage_region=${S3.BUCKET_2.REGION} | ||
... object_storage_bucket_name=${S3.BUCKET_2.NAME} | ||
... dsp_version=v2 | ||
DataSciencePipelinesBackend.Wait Until Pipeline Server Is Deployed namespace=${namespace} | ||
|
||
Start Long Running Pipeline | ||
[Documentation] Imports and creates a run of a long running pipeline | ||
[Arguments] ${namespace} | ||
|
||
${pipeline_run_params}= Create Dictionary naptime_secs=${3600} | ||
|
||
# robocop:off=unused-variable | ||
${pipeline_id} ${pipeline_version_id} ${pipeline_run_id} ${experiment_id}= | ||
... DataSciencePipelinesBackend.Import Pipeline And Create Run | ||
... namespace=${namespace} username=${TEST_USER.USERNAME} password=${TEST_USER.PASSWORD} | ||
... pipeline_name=take-nap | ||
... pipeline_description=A pipeline that runs for 1h and prints a message | ||
... pipeline_package_path=${PIPELINE_LONGRUNNING_FILEPATH} | ||
... pipeline_run_name=take-nap-run | ||
... pipeline_run_params=${pipeline_run_params} | ||
|
||
Set Global Variable ${DSP_LONGRUNNING_PIPELINE_RUN_ID} ${pipeline_run_id} |
2 changes: 1 addition & 1 deletion
2
ods_ci/tests/Resources/CLI/ModelRegistry/samples/istio/components/istio.env
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
ods_ci/tests/Resources/Files/pipeline-samples/v2/pip_index_url/take_nap_pipeline_root.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from kfp import compiler, dsl, kubernetes | ||
from kfp.dsl import PipelineTask | ||
|
||
common_base_image = ( | ||
"registry.redhat.io/ubi8/python-39@sha256:3523b184212e1f2243e76d8094ab52b01ea3015471471290d011625e1763af61" | ||
) | ||
|
||
|
||
def add_pip_index_configuration(task: PipelineTask): | ||
kubernetes.use_config_map_as_env( | ||
task, | ||
config_map_name="ds-pipeline-custom-env-vars", | ||
config_map_key_to_env={"pip_index_url": "PIP_INDEX_URL", "pip_trusted_host": "PIP_TRUSTED_HOST"}, | ||
) | ||
|
||
|
||
@dsl.component(base_image=common_base_image) | ||
def take_nap(naptime_secs: int) -> str: | ||
"""Sleeps for secs""" | ||
from time import sleep # noqa: PLC0415 | ||
|
||
print(f"Sleeping for {naptime_secs} seconds: Zzzzzz ...") | ||
sleep(naptime_secs) | ||
return "I'm awake now. Did I snore?" | ||
|
||
|
||
@dsl.component(base_image=common_base_image) | ||
def wake_up(message: str): | ||
"""Wakes up from nap printing a message""" | ||
print(message) | ||
|
||
|
||
@dsl.pipeline(name="take-nap-pipeline", description="Pipeline that sleeps for 15 mins (900 secs)") | ||
def take_nap_pipeline(naptime_secs: int = 900): | ||
take_nap_task = take_nap(naptime_secs=naptime_secs).set_caching_options(False) | ||
add_pip_index_configuration(take_nap_task) | ||
wake_up_task = wake_up(message=take_nap_task.output).set_caching_options(False) | ||
add_pip_index_configuration(wake_up_task) | ||
|
||
|
||
if __name__ == "__main__": | ||
compiler.Compiler().compile(take_nap_pipeline, package_path=__file__.replace(".py", "_compiled.yaml")) |
Oops, something went wrong.