|
2 | 2 | """
|
3 | 3 | This is a Python script that will copy/promote a Verta Build from one environment
|
4 | 4 | to another.
|
| 5 | +
|
5 | 6 | - The script will use the model version passed in the VERTA_SOURCE_MODEL_VERSION_ID environment variable
|
6 | 7 | as the model version to promote.
|
7 | 8 | - The latest self-contained build of the model version will be promoted. The promotion process will terminate if no
|
8 | 9 | self-contained builds of the model version are found.
|
9 | 10 | - If you need to create a self-contained build of a model version, use the create_scb.py script.
|
| 11 | +
|
10 | 12 | Configuration is done via environment variables. All are mandatory except VERTA_DEST_REGISTERED_MODEL_ID:
|
| 13 | +
|
11 | 14 | - VERTA_SOURCE_MODEL_VERSION_ID: The ID of the model version to promote
|
12 | 15 | - VERTA_SOURCE_HOST: The source Verta instance to promote from
|
13 | 16 | - VERTA_SOURCE_EMAIL: The email address for authentication to the source Verta instance
|
|
18 | 21 | - VERTA_DEST_DEV_KEY: The dev key associated to the email address on the destination Verta instance
|
19 | 22 | - VERTA_DEST_WORKSPACE: The workspace associated with the build on the destination Verta instance
|
20 | 23 | - VERTA_DEST_REGISTERED_MODEL_ID: [optional] The ID of the registered model to promote to. If missing, we'll create a new registered model
|
| 24 | +
|
21 | 25 | Optional environment variables to configure curl usage:
|
22 | 26 | VERTA_CURL_OPTS: Options to pass to curl. Defaults to '-O'
|
| 27 | +
|
23 | 28 | With these values set, run the script. The script will not attempt to delete any data and will fail if the registered
|
24 | 29 | model (if an existing one has not been provided) or version already exists in the destination.
|
25 | 30 | """
|
@@ -261,6 +266,7 @@ def upload_artifact(auth, model_version_id, artifact):
|
261 | 266 | key = artifact['key']
|
262 | 267 | print("Uploading artifact '%s'" % key)
|
263 | 268 | print(artifact)
|
| 269 | + |
264 | 270 | artifact_request = {
|
265 | 271 | 'method': 'PUT',
|
266 | 272 | 'model_version_id': model_version_id,
|
|
0 commit comments