要创建新的托管笔记本,可以使用以下示例:
BASE_ADDRESS=notebooks.googleapis.com
LOCATION=us-central1
PROJECT_ID=gogasca-sandbox
AUTH_TOKEN=$(gcloud auth application-default print-access-token)
RUNTIME_BODY="{
'access_config': {
'access_type': 'SINGLE_USER',
'runtime_owner': '[email protected]'
},
'virtual_machine': {
'virtual_machine_config': {
'data_disk': {
'initialize_params': {
'disk_size_gb': 200,
'disk_type': 'PD_SSD',
}
},
'container_images': [{
'repository': 'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag': 'latest'
}],
'metadata': {
'file_to_load_1':'https://test.google.com/v2/models/versions/trainable_v1.0/zip',
},
'machine_type':'n1-standard-4',
'accelerator_config': {
'type': 'NVIDIA_TESLA_T4',
'core_count': '1'
}
}
},
'software_config':{
'post_startup_script':'gs://gcp-scripts/step01.sh'
}
}"
RUNTIME_NAME=gogasca-managed-notebook
curl -X POST https://${BASE_ADDRESS}/v1/projects/$PROJECT_ID/locations/$LOCATION/runtimes?runtime_id=$RUNTIME_NAME -d "${RUNTIME_BODY}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AUTH_TOKEN" -v
谷歌云SDK正在进行中。
Terraform模块刚刚发布。