ml deployment-job create
Start a deployment job asynchronously. The job can perform batch scoring, streaming, or other types of batch operations such as solving a Decision Optimization problem.
Syntax
cpd-cli ml deployment-job create \
[--context=<catalog-project-or-space-id>] \
[--cpd-config=<cpd-config-location>] \
[--cpd-scope=<cpd-scope>] \
[--custom=<map<key,value>>] \
[--decision-optimization=<input-output-data-properties>] \
--deployment=<resource-reference> \
[--description=<resource-description>] \
[--hardware-spec=<hardware-specification>] \
[--hybrid-pipeline-hardware-specs=<hybrid-pipeline-hardware-specification>] \
[--jmes-query=<jmespath-query>] \
[--name=<resource-name>] \
[--output=json|yaml|table] \
[--output-file=<output-file-location>] \
--profile=<profile-name> \
[--quiet] \
[--raw-output=true|false] \
[--retention=<job-meta-retention-value>] \
[--scoring=<input-output-data-details>] \
--space-id=<space-identifier> \
[--tags=<tag1,tag2,...>] \
[--verbose]
Arguments
The ml deployment-job create
command has no arguments.
Options
Table 1: Command options
| Option | Description |
|---|---|
--context |
Specify the configuration context
name.
|
--cpd-config |
The IBM Software Hub
configuration location. For example,
$HOME/.cpd-cli/config.
|
--cpd-scope |
The IBM Software Hub space,
project, or catalog scope. For example,
cpd://default-context/spaces/7bccdda4-9752-4f37-868e-891de6c48135.
|
--custom |
Specify user-defined properties as
key-value pairs.
|
--decision-optimization |
Provide details about the input
and output data and other properties that are used for a batch deployment job of a decision
optimization problem.
|
--description |
Specify a
resource
description.
|
--hardware-spec |
Specify a hardware
specification.
|
|
|
Display command
help.
|
--hybrid-pipeline-hardware-specs |
Specify a hybrid pipeline hardware
specification.
|
--jmes-query |
Provide a JMESPath query to
customize the output.
|
--name |
Specify a
resource name.
|
--output |
Specify an output
format.
|
--output-file |
Specify a file path where all
output is redirected.
|
--profile |
The name of the profile that you
created to store information about an instance of IBM Software Hub and your credentials for the
instance.
|
--quiet |
Suppress verbose
messages.
|
--raw-output |
When set to true, single values
are not surrounded by quotation marks in
JSON output
mode.
|
--retention |
Specify a value to define the
number of days to retain the job meta. Job meta is automatically deleted after the specified number
of days. The value '-1' sets the meta to never
auto-delete.
|
--scoring |
Specify details about the input
and output data and other properties that are used for a model’s batch deployment job (Python
Function or Python Scripts).
|
--space-id |
Specify a space
identifier.
|
--tags |
Specify the data asset tags.
Multiple tags can be specified.
|
--verbose |
Logs include more detailed
messages.
|
Examples
Note: The following examples use environment variables. Use a script to create
environment variables with the correct values for your environment. You can add the listed
environment variables to the installation variables script. For more information, see Setting up installation environment variables.
- Specify the environment variables, the deployment job name, and the scoring parameters in a script file.
- Replace the following properties with your
data.
deployment_job_name = 'script_batch_deployment_job' deployment = { 'id': deployment_id } deployment_json = json.dumps(deployment) scoring = { "input_data_references": [ { "type": "data_asset", "connection": {}, "location": { "href": "/v2/assets/783d8fc5-ae2c-47d0-a311-f8890dfa1ce0?space_id=d9bfa660-1be7-46ab-aa53-e9010a634bba" } } ], "output_data_reference": { "type": "data_asset", "connection": {}, "location": { "href": "/v2/assets/c7de9cb4-0ec5-41fa-8b94-3e89eb2cb795?space_id=d9bfa660-1be7-46ab-aa53-e9010a634bba" } } } scoring_json = json.dumps(scoring) space_id = <The space identifier> - Create a deployment job.
-
cpd-cli ml deployment-job create \ --deployment=${deployment_json} \ --name=${deployment_job_name} \ --output=json \ --scoring=${scoring_json} \ --space-id==${space_id}