Add runPipelineData(1).yaml

Signed-off-by: cuidongdong <515783741@qq.com>
This commit is contained in:
cuidongdong 2024-07-01 17:57:58 +08:00
parent 5ec8193201
commit b655210bc3
1 changed files with 188 additions and 0 deletions

188
runPipelineData(1).yaml Normal file
View File

@ -0,0 +1,188 @@
components:
comp-deploy:
executorLabel: exec-deploy
inputDefinitions:
parameters:
accuracy:
parameterType: NUMBER_DOUBLE
comp-evaluate:
executorLabel: exec-evaluate
inputDefinitions:
artifacts:
model:
artifactType:
schemaTitle: system.Model
schemaVersion: 0.0.1
outputDefinitions:
parameters:
Output:
parameterType: NUMBER_DOUBLE
comp-train:
executorLabel: exec-train
inputDefinitions:
parameters:
batch_size:
parameterType: NUMBER_INTEGER
outputDefinitions:
artifacts:
model:
artifactType:
schemaTitle: system.Model
schemaVersion: 0.0.1
deploymentSpec:
executors:
exec-deploy:
container:
args:
- "--executor_input"
- "{{$}}"
- "--function_to_execute"
- deploy
command:
- sh
- "-c"
- >
if ! [ -x "$(command -v pip)" ]; then
python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip
fi
PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install
--no-warn-script-location 'kfp-leinao==2.4.0' '--no-deps'
'typing-extensions>=3.7.4,<5; python_version<"3.9"' && "$0" "$@"
- 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"
"$@"
- |+
import kfp
from kfp import dsl
from kfp.dsl import *
from typing import *
def deploy(accuracy: float):
pass
image: "registry.cnbita.com:5000/wangshi/python:3.10"
exec-evaluate:
container:
args:
- "--executor_input"
- "{{$}}"
- "--function_to_execute"
- evaluate
command:
- sh
- "-c"
- >
if ! [ -x "$(command -v pip)" ]; then
python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip
fi
PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install
--no-warn-script-location 'kfp-leinao==2.4.0' '--no-deps'
'typing-extensions>=3.7.4,<5; python_version<"3.9"' && "$0" "$@"
- 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"
"$@"
- |+
import kfp
from kfp import dsl
from kfp.dsl import *
from typing import *
def evaluate(model: Input[Model]) -> float:
with open(model.path, 'r') as f:
print(f.read())
accuracy = 0.9
return accuracy
image: "registry.cnbita.com:5000/wangshi/python:3.10"
exec-train:
container:
args:
- "echo 'I am a model' > {{$.outputs.artifacts['model'].path}}"
command:
- sh
- "-c"
env:
- name: env_k1
value: env_v1
- name: env_k2
value: env_v2
image: "registry.cnbita.com:5000/wangshi/python:3.10"
pipelineInfo:
name: sample-pipeline
root:
dag:
tasks:
deploy:
cachingOptions:
enableCache: true
componentRef:
name: comp-deploy
dependentTasks:
- evaluate
inputs:
parameters:
accuracy:
taskOutputParameter:
outputParameterKey: Output
producerTask: evaluate
taskInfo:
name: deploy
evaluate:
cachingOptions:
enableCache: true
componentRef:
name: comp-evaluate
dependentTasks:
- train
inputs:
artifacts:
model:
taskOutputArtifact:
outputArtifactKey: model
producerTask: train
taskInfo:
name: evaluate
train:
cachingOptions:
enableCache: true
componentRef:
name: comp-train
inputs:
parameters:
batch_size:
componentInputParameter: batch_size
taskInfo:
name: train
inputDefinitions:
parameters:
batch_size:
parameterType: NUMBER_INTEGER
schemaVersion: 2.1.0