Downloading the runtime definition
Every custom image that you create must be based on one of the standard images that are included in Watson Machine Learning. You can get the name of the image that is used by a runtime from the definition for the runtime.
Required role: You must be an admin of the Cloud Pak for Data instance to download a runtime definition.
You must retrieve the runtime definition by using the Cloud Pak for Data API and store it as a JSON file.
Runtime definition name | Image description |
---|---|
runtime-23.1-py3.10 |
Python 3.10 runtime image |
runtime-24.1-py3.11 |
Python 3.11 runtime image |
spss-modeler_batch |
SPSS runtime batch image |
Follow these steps to download the runtime definition by using cURL in the console:
-
Get the required platform access token.
- Log in to Cloud Pak for Data as an administrator.
- Get the CPD platform URL (
CPD_URL
) by running:
cpd-cli manage get-cpd-instance-details --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
-
Get an authorization token. For more information, see Generating an API authorization token.
You can also set the bearer token manually by omitting the
jq
command and copying the output of theaccessToken
field to theMY_TOKEN
variable. The usage of-k
because of certificate issues.-k
disables certificate validation.
-
List the names of all available runtime definitions on the cluster
curl -ksS -X GET -H "Authorization: ZenApiKey ${MY_TOKEN}" "${CPD_URL}/v2/runtime_definitions" | jq -r ".resources[].entity.name"
-
Download the runtime definition. Replace
<runtime-definition-name>
with the name of the runtime definition that you need for your customization.myRuntimeDefinition=<runtime-definition-name>; curl -ksS -X GET -H "Authorization: ZenApiKey ${MY_TOKEN}" "${CPD_URL}/v2/runtime_definitions?include=launch_configuration" | jq '.resources[] | select(.entity.name=="'${myRuntimeDefinition}'") | .entity' > ${myRuntimeDefinition}-server.json
The following example shows how to download the runtime definition for
runtime-23.1-py3.10
. This saves the.entity
JSON content to the fileruntime-23.1-py3.10-server.json
.myRuntimeDefinition="runtime-23.1-py3.10"; curl -ksS -X GET -H "Authorization: ZenApiKey ${MY_TOKEN}" "${CPD_URL}/v2/runtime_definitions?include=launch_configuration" | jq '.resources[] | select(.entity.name=="'${myRuntimeDefinition}'") | .entity' > ${myRuntimeDefinition}-server.json
Note:To run this script, you must generate and export the token as the
${MY_TOKEN}
environment variable. For more information, see Generating an API authorization token.
Next steps
Parent topic: Preparing to build a custom image