# 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: 'Store model - Watson Machine Learning'
description: |
  Store and persistent trained model on Watson Machine Learning.
metadata:
  annotations: {platform: 'IBM 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'}
  - {name: framework,         description: 'ML/DL Model Framework', default: 'tensorflow'}
  - {name: framework_version, description: 'Model Framework version', default: '1.15'}
  - {name: runtime_version,   description: 'Model Code runtime version', default: '3.6'}
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: [
      -u, /app/wml-store.py,
      --run-uid, {inputValue: run_uid},
      --model-name, {inputValue: model_name},
      --framework, {inputValue: framework},
      --framework-version, {inputValue: framework_version},
      --runtime-version, {inputValue: runtime_version},
      --output-model-uid-path, {outputPath: model_uid}
    ]
