-
Notifications
You must be signed in to change notification settings - Fork 177
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
Test: e2e Cypress migration from ODS-2206 #3580
Open
FedeAlonso
wants to merge
24
commits into
opendatahub-io:main
Choose a base branch
from
FedeAlonso:test/cypress-ods2206-pipelines
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+528
−33
Open
Changes from 14 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
585f627
test: Cypress Pipelines e2e ODS2206
FedeAlonso e5d3045
Merge branch 'main' of github.com:opendatahub-io/odh-dashboard into t…
FedeAlonso 224f888
Merge branch 'main' of github.com:opendatahub-io/odh-dashboard into t…
FedeAlonso fd43246
Save point
FedeAlonso 8f6d122
Merge branch 'main' into test/cypress-ods2206-pipelines
FedeAlonso 59e0d3c
checkpoint
FedeAlonso d7b49b8
Merge branch 'test/cypress-ods2206-pipelines' of github.com:FedeAlons…
FedeAlonso a50b6da
try to wait to the modal to be closed
FedeAlonso 5ac6639
lint fixes
FedeAlonso 90d5484
Unskip first test
FedeAlonso c9774fc
Split into two different files
FedeAlonso a9bc940
Merge branch 'main' of github.com:opendatahub-io/odh-dashboard into t…
FedeAlonso 171adae
rename file
FedeAlonso 7f2b84d
Lint fixes
FedeAlonso b5785ef
Merge branch 'main' into test/cypress-ods2206-pipelines
FedeAlonso 7bed0a8
Merge branch 'main' into test/cypress-ods2206-pipelines
FedeAlonso 8615f3a
fix application issue
FedeAlonso f0a44d5
Merge branch 'main' into test/cypress-ods2206-pipelines
FedeAlonso dc20b60
Merge branch 'main' into test/cypress-ods2206-pipelines
FedeAlonso 5489de0
Apply Purva's solution
FedeAlonso a1dcb35
workbenches
FedeAlonso dfefe0c
Merge branch 'main' into test/cypress-ods2206-pipelines
FedeAlonso 3fe6df7
fix pip config retrieving
FedeAlonso fa658bb
Merge branch 'main' into test/cypress-ods2206-pipelines
FedeAlonso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
296 changes: 296 additions & 0 deletions
296
...__/cypress/cypress/fixtures/resources/pipelines/iris_pipeline_pip_index_url_compiled.yaml
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,296 @@ | ||
# PIPELINE DEFINITION | ||
# Name: iris-training-pipeline | ||
# Inputs: | ||
# neighbors: int [Default: 3.0] | ||
# standard_scaler: bool [Default: True] | ||
# Outputs: | ||
# train-model-metrics: system.ClassificationMetrics | ||
components: | ||
comp-create-dataset: | ||
executorLabel: exec-create-dataset | ||
outputDefinitions: | ||
artifacts: | ||
iris_dataset: | ||
artifactType: | ||
schemaTitle: system.Dataset | ||
schemaVersion: 0.0.1 | ||
comp-normalize-dataset: | ||
executorLabel: exec-normalize-dataset | ||
inputDefinitions: | ||
artifacts: | ||
input_iris_dataset: | ||
artifactType: | ||
schemaTitle: system.Dataset | ||
schemaVersion: 0.0.1 | ||
parameters: | ||
standard_scaler: | ||
parameterType: BOOLEAN | ||
outputDefinitions: | ||
artifacts: | ||
normalized_iris_dataset: | ||
artifactType: | ||
schemaTitle: system.Dataset | ||
schemaVersion: 0.0.1 | ||
comp-train-model: | ||
executorLabel: exec-train-model | ||
inputDefinitions: | ||
artifacts: | ||
normalized_iris_dataset: | ||
artifactType: | ||
schemaTitle: system.Dataset | ||
schemaVersion: 0.0.1 | ||
parameters: | ||
n_neighbors: | ||
parameterType: NUMBER_INTEGER | ||
outputDefinitions: | ||
artifacts: | ||
metrics: | ||
artifactType: | ||
schemaTitle: system.ClassificationMetrics | ||
schemaVersion: 0.0.1 | ||
model: | ||
artifactType: | ||
schemaTitle: system.Model | ||
schemaVersion: 0.0.1 | ||
deploymentSpec: | ||
executors: | ||
exec-create-dataset: | ||
container: | ||
args: | ||
- --executor_input | ||
- '{{$}}' | ||
- --function_to_execute | ||
- create_dataset | ||
command: | ||
- sh | ||
- -c | ||
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\ | ||
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\ | ||
\ python3 -m pip install --quiet --no-warn-script-location --index-url $PIP_INDEX_URL\ | ||
\ --trusted-host $PIP_TRUSTED_HOST 'kfp==2.9.0' '--no-deps' 'typing-extensions>=3.7.4,<5;\ | ||
\ python_version<\"3.9\"' && python3 -m pip install --quiet --no-warn-script-location\ | ||
\ --index-url $PIP_INDEX_URL --trusted-host $PIP_TRUSTED_HOST 'pandas==2.2.0'\ | ||
\ && \"$0\" \"$@\"\n" | ||
- sh | ||
- -ec | ||
- 'program_path=$(mktemp -d) | ||
|
||
|
||
printf "%s" "$0" > "$program_path/ephemeral_component.py" | ||
|
||
_KFP_RUNTIME=true python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@" | ||
|
||
' | ||
- "\nimport kfp\nfrom kfp import dsl\nfrom kfp.dsl import *\nfrom typing import\ | ||
\ *\n\ndef create_dataset(iris_dataset: Output[Dataset]):\n from io import\ | ||
\ StringIO # noqa: PLC0415\n\n import pandas as pd # noqa: PLC0415\n\ | ||
\n data = \"\"\"\n 5.1,3.5,1.4,0.2,Iris-setosa\n 4.9,3.0,1.4,0.2,Iris-setosa\n\ | ||
\ 4.7,3.2,1.3,0.2,Iris-setosa\n 4.6,3.1,1.5,0.2,Iris-setosa\n 5.0,3.6,1.4,0.2,Iris-setosa\n\ | ||
\ 5.7,3.8,1.7,0.3,Iris-setosa\n 5.1,3.8,1.5,0.3,Iris-setosa\n 5.4,3.4,1.7,0.2,Iris-setosa\n\ | ||
\ 5.1,3.7,1.5,0.4,Iris-setosa\n 5.1,3.4,1.5,0.2,Iris-setosa\n 5.0,3.5,1.3,0.3,Iris-setosa\n\ | ||
\ 4.5,2.3,1.3,0.3,Iris-setosa\n 4.4,3.2,1.3,0.2,Iris-setosa\n 5.0,3.5,1.6,0.6,Iris-setosa\n\ | ||
\ 5.1,3.8,1.9,0.4,Iris-setosa\n 4.8,3.0,1.4,0.3,Iris-setosa\n 5.1,3.8,1.6,0.2,Iris-setosa\n\ | ||
\ 4.6,3.2,1.4,0.2,Iris-setosa\n 5.3,3.7,1.5,0.2,Iris-setosa\n 5.0,3.3,1.4,0.2,Iris-setosa\n\ | ||
\ 7.0,3.2,4.7,1.4,Iris-versicolor\n 6.4,3.2,4.5,1.5,Iris-versicolor\n\ | ||
\ 6.9,3.1,4.9,1.5,Iris-versicolor\n 5.5,2.3,4.0,1.3,Iris-versicolor\n\ | ||
\ 6.5,2.8,4.6,1.5,Iris-versicolor\n 6.2,2.2,4.5,1.5,Iris-versicolor\n\ | ||
\ 5.6,2.5,3.9,1.1,Iris-versicolor\n 5.9,3.2,4.8,1.8,Iris-versicolor\n\ | ||
\ 6.1,2.8,4.0,1.3,Iris-versicolor\n 6.3,2.5,4.9,1.5,Iris-versicolor\n\ | ||
\ 6.1,2.8,4.7,1.2,Iris-versicolor\n 6.4,2.9,4.3,1.3,Iris-versicolor\n\ | ||
\ 6.6,3.0,4.4,1.4,Iris-versicolor\n 5.6,2.7,4.2,1.3,Iris-versicolor\n\ | ||
\ 5.7,3.0,4.2,1.2,Iris-versicolor\n 5.7,2.9,4.2,1.3,Iris-versicolor\n\ | ||
\ 6.2,2.9,4.3,1.3,Iris-versicolor\n 5.1,2.5,3.0,1.1,Iris-versicolor\n\ | ||
\ 5.7,2.8,4.1,1.3,Iris-versicolor\n 6.3,3.3,6.0,2.5,Iris-virginica\n\ | ||
\ 5.8,2.7,5.1,1.9,Iris-virginica\n 7.1,3.0,5.9,2.1,Iris-virginica\n\ | ||
\ 6.3,2.9,5.6,1.8,Iris-virginica\n 6.5,3.0,5.8,2.2,Iris-virginica\n\ | ||
\ 6.9,3.1,5.1,2.3,Iris-virginica\n 5.8,2.7,5.1,1.9,Iris-virginica\n\ | ||
\ 6.8,3.2,5.9,2.3,Iris-virginica\n 6.7,3.3,5.7,2.5,Iris-virginica\n\ | ||
\ 6.7,3.0,5.2,2.3,Iris-virginica\n 6.3,2.5,5.0,1.9,Iris-virginica\n\ | ||
\ 6.5,3.0,5.2,2.0,Iris-virginica\n 6.2,3.4,5.4,2.3,Iris-virginica\n\ | ||
\ 5.9,3.0,5.1,1.8,Iris-virginica\n \"\"\"\n col_names = [\"Sepal_Length\"\ | ||
, \"Sepal_Width\", \"Petal_Length\", \"Petal_Width\", \"Labels\"]\n df\ | ||
\ = pd.read_csv(StringIO(data), names=col_names)\n\n with open(iris_dataset.path,\ | ||
\ \"w\") as f:\n df.to_csv(f)\n\n" | ||
image: registry.redhat.io/ubi8/python-39@sha256:3523b184212e1f2243e76d8094ab52b01ea3015471471290d011625e1763af61 | ||
exec-normalize-dataset: | ||
container: | ||
args: | ||
- --executor_input | ||
- '{{$}}' | ||
- --function_to_execute | ||
- normalize_dataset | ||
command: | ||
- sh | ||
- -c | ||
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\ | ||
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\ | ||
\ python3 -m pip install --quiet --no-warn-script-location --index-url $PIP_INDEX_URL\ | ||
\ --trusted-host $PIP_TRUSTED_HOST 'kfp==2.9.0' '--no-deps' 'typing-extensions>=3.7.4,<5;\ | ||
\ python_version<\"3.9\"' && python3 -m pip install --quiet --no-warn-script-location\ | ||
\ --index-url $PIP_INDEX_URL --trusted-host $PIP_TRUSTED_HOST 'pandas==2.2.0'\ | ||
\ 'scikit-learn==1.4.0' && \"$0\" \"$@\"\n" | ||
- sh | ||
- -ec | ||
- 'program_path=$(mktemp -d) | ||
|
||
|
||
printf "%s" "$0" > "$program_path/ephemeral_component.py" | ||
|
||
_KFP_RUNTIME=true python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@" | ||
|
||
' | ||
- "\nimport kfp\nfrom kfp import dsl\nfrom kfp.dsl import *\nfrom typing import\ | ||
\ *\n\ndef normalize_dataset(\n input_iris_dataset: Input[Dataset],\n\ | ||
\ normalized_iris_dataset: Output[Dataset],\n standard_scaler: bool,\n\ | ||
):\n import pandas as pd # noqa: PLC0415\n from sklearn.preprocessing\ | ||
\ import MinMaxScaler, StandardScaler # noqa: PLC0415\n\n with open(input_iris_dataset.path)\ | ||
\ as f:\n df = pd.read_csv(f)\n labels = df.pop(\"Labels\")\n\n\ | ||
\ scaler = StandardScaler() if standard_scaler else MinMaxScaler()\n\n\ | ||
\ df = pd.DataFrame(scaler.fit_transform(df))\n df[\"Labels\"] = labels\n\ | ||
\ normalized_iris_dataset.metadata[\"state\"] = \"Normalized\"\n with\ | ||
\ open(normalized_iris_dataset.path, \"w\") as f:\n df.to_csv(f)\n\ | ||
\n" | ||
image: registry.redhat.io/ubi8/python-39@sha256:3523b184212e1f2243e76d8094ab52b01ea3015471471290d011625e1763af61 | ||
exec-train-model: | ||
container: | ||
args: | ||
- --executor_input | ||
- '{{$}}' | ||
- --function_to_execute | ||
- train_model | ||
command: | ||
- sh | ||
- -c | ||
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\ | ||
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\ | ||
\ python3 -m pip install --quiet --no-warn-script-location --index-url $PIP_INDEX_URL\ | ||
\ --trusted-host $PIP_TRUSTED_HOST 'kfp==2.9.0' '--no-deps' 'typing-extensions>=3.7.4,<5;\ | ||
\ python_version<\"3.9\"' && python3 -m pip install --quiet --no-warn-script-location\ | ||
\ --index-url $PIP_INDEX_URL --trusted-host $PIP_TRUSTED_HOST 'pandas==2.2.0'\ | ||
\ 'scikit-learn==1.4.0' && \"$0\" \"$@\"\n" | ||
- sh | ||
- -ec | ||
- 'program_path=$(mktemp -d) | ||
|
||
|
||
printf "%s" "$0" > "$program_path/ephemeral_component.py" | ||
|
||
_KFP_RUNTIME=true python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@" | ||
|
||
' | ||
- "\nimport kfp\nfrom kfp import dsl\nfrom kfp.dsl import *\nfrom typing import\ | ||
\ *\n\ndef train_model(\n normalized_iris_dataset: Input[Dataset],\n\ | ||
\ model: Output[Model],\n metrics: Output[ClassificationMetrics],\n\ | ||
\ n_neighbors: int,\n):\n import pickle # noqa: PLC0415\n\n import\ | ||
\ pandas as pd # noqa: PLC0415\n from sklearn.metrics import confusion_matrix\ | ||
\ # noqa: PLC0415\n from sklearn.model_selection import cross_val_predict,\ | ||
\ train_test_split # noqa: PLC0415\n from sklearn.neighbors import KNeighborsClassifier\ | ||
\ # noqa: PLC0415\n\n with open(normalized_iris_dataset.path) as f:\n\ | ||
\ df = pd.read_csv(f)\n\n y = df.pop(\"Labels\")\n X = df\n\ | ||
\n X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)\ | ||
\ # noqa: F841\n\n clf = KNeighborsClassifier(n_neighbors=n_neighbors)\n\ | ||
\ clf.fit(X_train, y_train)\n\n predictions = cross_val_predict(clf,\ | ||
\ X_train, y_train, cv=3)\n metrics.log_confusion_matrix(\n [\"\ | ||
Iris-Setosa\", \"Iris-Versicolour\", \"Iris-Virginica\"],\n confusion_matrix(y_train,\ | ||
\ predictions).tolist(), # .tolist() to convert np array to list.\n \ | ||
\ )\n\n model.metadata[\"framework\"] = \"scikit-learn\"\n with open(model.path,\ | ||
\ \"wb\") as f:\n pickle.dump(clf, f)\n\n" | ||
image: registry.redhat.io/ubi8/python-39@sha256:3523b184212e1f2243e76d8094ab52b01ea3015471471290d011625e1763af61 | ||
pipelineInfo: | ||
name: iris-training-pipeline | ||
root: | ||
dag: | ||
outputs: | ||
artifacts: | ||
train-model-metrics: | ||
artifactSelectors: | ||
- outputArtifactKey: metrics | ||
producerSubtask: train-model | ||
tasks: | ||
create-dataset: | ||
cachingOptions: {} | ||
componentRef: | ||
name: comp-create-dataset | ||
taskInfo: | ||
name: create-dataset | ||
normalize-dataset: | ||
cachingOptions: {} | ||
componentRef: | ||
name: comp-normalize-dataset | ||
dependentTasks: | ||
- create-dataset | ||
inputs: | ||
artifacts: | ||
input_iris_dataset: | ||
taskOutputArtifact: | ||
outputArtifactKey: iris_dataset | ||
producerTask: create-dataset | ||
parameters: | ||
standard_scaler: | ||
componentInputParameter: standard_scaler | ||
taskInfo: | ||
name: normalize-dataset | ||
train-model: | ||
cachingOptions: {} | ||
componentRef: | ||
name: comp-train-model | ||
dependentTasks: | ||
- normalize-dataset | ||
inputs: | ||
artifacts: | ||
normalized_iris_dataset: | ||
taskOutputArtifact: | ||
outputArtifactKey: normalized_iris_dataset | ||
producerTask: normalize-dataset | ||
parameters: | ||
n_neighbors: | ||
componentInputParameter: neighbors | ||
taskInfo: | ||
name: train-model | ||
inputDefinitions: | ||
parameters: | ||
neighbors: | ||
defaultValue: 3.0 | ||
isOptional: true | ||
parameterType: NUMBER_INTEGER | ||
standard_scaler: | ||
defaultValue: true | ||
isOptional: true | ||
parameterType: BOOLEAN | ||
outputDefinitions: | ||
artifacts: | ||
train-model-metrics: | ||
artifactType: | ||
schemaTitle: system.ClassificationMetrics | ||
schemaVersion: 0.0.1 | ||
schemaVersion: 2.1.0 | ||
sdkVersion: kfp-2.9.0 | ||
--- | ||
platforms: | ||
kubernetes: | ||
deploymentSpec: | ||
executors: | ||
exec-create-dataset: | ||
configMapAsEnv: | ||
- configMapName: ds-pipeline-custom-env-vars | ||
keyToEnv: | ||
- configMapKey: pip_index_url | ||
envVar: PIP_INDEX_URL | ||
- configMapKey: pip_trusted_host | ||
envVar: PIP_TRUSTED_HOST | ||
exec-normalize-dataset: | ||
configMapAsEnv: | ||
- configMapName: ds-pipeline-custom-env-vars | ||
keyToEnv: | ||
- configMapKey: pip_index_url | ||
envVar: PIP_INDEX_URL | ||
- configMapKey: pip_trusted_host | ||
envVar: PIP_TRUSTED_HOST | ||
exec-train-model: | ||
configMapAsEnv: | ||
- configMapName: ds-pipeline-custom-env-vars | ||
keyToEnv: | ||
- configMapKey: pip_index_url | ||
envVar: PIP_INDEX_URL | ||
- configMapKey: pip_trusted_host | ||
envVar: PIP_TRUSTED_HOST |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check please if this is breaking the Mock Tests?
https://github.com/opendatahub-io/odh-dashboard/actions/runs/12427145849/job/34696500427?pr=3580