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

Add component.yaml to every ibm-components #984

Merged
merged 3 commits into from
Mar 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions components/ibm-components/commons/config/component.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 'Kubernetes Cluster - Create secret'
description: |
Create secret to store pipeline credentials on Kubernetes Cluster
inputs:
- {name: token, description: 'Required. GitHub token for accessing private repository'}
- {name: url, description: 'Required. GitHub raw path for accessing the credential file'}
- {name: name, description: 'Required. Secret Name to be stored in Kubernetes'}
outputs:
- {name: secret_name, description: 'Kubernetes secret name'}
implementation:
container:
image: docker.io/aipipeline/wml-config:latest
command: ['python3']
args: [
/app/config.py,
--token, {inputValue: token},
--url, {inputValue: url},
--name, {inputValue: name}
]
fileOutputs:
secret_name: /tmp/ai-pipeline-creds
37 changes: 37 additions & 0 deletions components/ibm-components/ffdl/serve/component.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 'Seldon Core - Serve PyTorch Model'
description: |
Serve PyTorch Models remotely as web service using Seldon Core
inputs:
- {name: model_id, description: 'Required. Model training_id from Fabric for Deep Learning'}
- {name: deployment_name, description: 'Required. Deployment name for the seldon service'}
- {name: model_class_name, description: 'PyTorch model class name', default: 'ModelClass'}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this specific to PyTorch models? Should we call this 'Seldon Core - Serve PyTorch Model' ? Or make it mroe generic?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the review. The component container itself could be more generic, but maybe this component.yaml implementation is more specific for PyTorch model. Let me rename the description.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

- {name: model_class_file, description: 'File that contains the PyTorch model class', default: 'model_class.py'}
- {name: serving_image, description: 'Model serving images', default: 'aipipeline/seldon-pytorch:0.1'}
outputs:
- {name: output, description: 'Model Serving status'}
implementation:
container:
image: docker.io/aipipeline/ffdl-serve:latest
command: ['python']
args: [
-u, serve.py,
--model_id, {inputValue: model_id},
--deployment_name, {inputValue: deployment_name},
--model_class_name, {inputValue: model_class_name},
--model_class_file, {inputValue: model_class_file},
--serving_image, {inputValue: serving_image}
]
fileOutputs:
output: /tmp/deployment_result.txt
31 changes: 31 additions & 0 deletions components/ibm-components/ffdl/train/component.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 'Fabric for Deep Learning - Train Model'
description: |
Train Machine Learning and Deep Learning Models remotely using Fabric for Deep Learning
inputs:
- {name: model_def_file_path, description: 'Required. Path for model training code in object storage'}
- {name: manifest_file_path, description: 'Required. Path for model manifest definition in object storage'}
outputs:
- {name: output, description: 'Model training_id'}
implementation:
container:
image: docker.io/aipipeline/ffdl-train:latest
command: ['python']
args: [
-u, train.py,
--model_def_file_path, {inputValue: model_def_file_path},
--manifest_file_path, {inputValue: manifest_file_path}
]
fileOutputs:
output: /tmp/training_id.txt
33 changes: 33 additions & 0 deletions components/ibm-components/watson/deploy/component.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 'Watson Machine Learning - Deploy Model'
description: |
Deploy stored model on Watson Machine Learning as a web service.
inputs:
- {name: model_uid, description: 'Required. UID for the Watson Machine Learning model'}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the UID for stored model?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the Watson store component output will be passed to this field as model UID.

- {name: model_name, description: 'Required. Model Name on Watson Machine Learning'}
- {name: scoring_payload, description: 'Required. Sample Payload file name in the object storage'}
outputs:
- {name: output, description: 'Link to the deployed model web service'}
implementation:
container:
image: docker.io/aipipeline/wml-deploy:latest
command: ['python3']
args: [
/app/wml-deploy.py,
--model-uid, {inputValue: model_uid},
--model-name, {inputValue: model_name},
--scoring-payload, {inputValue: scoring_payload}
]
fileOutputs:
output: /tmp/output
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: Enable fairness monitoring on Watson OpenScale
name: 'Watson OpenScale - Monitor Fairness'
description: |
Enable model fairness monitoring on Watson OpenScale.
inputs:
Expand All @@ -22,6 +22,7 @@ inputs:
implementation:
container:
image: docker.io/aipipeline/monitor_fairness:latest
command: ['python']
args: [
-u, monitor_fairness.py,
--model_name, {inputValue: model_name},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: Enable quality monitoring on Watson OpenScale
name: 'Watson OpenScale - Monitor quality'
description: |
Enable model quality monitoring on Watson OpenScale.
inputs:
Expand All @@ -21,6 +21,7 @@ inputs:
implementation:
container:
image: docker.io/aipipeline/monitor_quality:latest
command: ['python']
args: [
-u, monitor_quality.py,
--model_name, {inputValue: model_name},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: Subscribe Watson OpenScale
name: 'Watson OpenScale - Subscribe'
description: |
Binding deployed models and subscribe them to Watson OpenScale service.
inputs:
Expand All @@ -23,6 +23,7 @@ outputs:
implementation:
container:
image: docker.io/aipipeline/subscribe:latest
command: ['python']
args: [
-u, subscribe.py,
--model_name, {inputValue: model_name},
Expand All @@ -31,4 +32,4 @@ implementation:
--label_column, {inputValue: label_column}
]
fileOutputs:
job_id: /tmp/model_name.txt
model_name: /tmp/model_name.txt
31 changes: 31 additions & 0 deletions components/ibm-components/watson/store/component.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 'Watson Machine Learning - Store model'
description: |
Store and persistent trained model on Watson Machine Learning.
inputs:
- {name: run_uid, description: 'Required. UID for the Watson Machine Learning training-runs'}
- {name: model_name, description: 'Required. Model Name to store on Watson Machine Learning'}
outputs:
- {name: model_uid, description: 'UID for the stored model on Watson Machine Learning'}
implementation:
container:
image: docker.io/aipipeline/wml-store:latest
command: ['python3']
args: [
/app/wml-store.py,
--run-uid, {inputValue: run_uid},
--model-name, {inputValue: model_name}
]
fileOutputs:
model_uid: /tmp/model_uid
45 changes: 45 additions & 0 deletions components/ibm-components/watson/train/component.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 'Watson Machine Learning - Train Model'
description: |
Train Machine Learning and Deep Learning Models in the Cloud using Watson Machine Learning
inputs:
- {name: train_code, description: 'Required. Code for training ML/DL models'}
- {name: execution_command, description: 'Required. Execution command to start the model training.'}
- {name: config, description: 'Required. Credential configfile is properly created.'}
- {name: framework, description: 'ML/DL Model Framework', default: 'tensorflow'}
- {name: framework_version, description: 'Model Framework version', default: '1.5'}
- {name: runtime, description: 'Model Code runtime language', default: 'python'}
- {name: runtime_version, description: 'Model Code runtime version', default: '3.5'}
- {name: run_definition, description: 'Name for the Watson Machine Learning training definition', default: 'python-tensorflow-definition'}
- {name: run_name, description: 'Name for the Watson Machine Learning training-runs', default: 'python-tensorflow-run'}
outputs:
- {name: run_uid, description: 'UID for the Watson Machine Learning training-runs'}
implementation:
container:
image: docker.io/aipipeline/wml-train:latest
command: ['python3']
args: [
/app/wml-train.py,
--config, {inputValue: config},
--train-code, {inputValue: train_code},
--execution-command, {inputValue: execution_command},
--framework, {inputValue: framework},
--framework-version, {inputValue: framework_version},
--runtime, {inputValue: runtime},
--runtime-version, {inputValue: runtime_version},
--run-definition, {inputValue: run_definition},
--run-name, {inputValue: run_name}
]
fileOutputs:
run_uid: /tmp/run_uid