1# -*- coding: utf-8 -*- # 2# Copyright 2020 Google LLC. All Rights Reserved. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15"""Constants used for AI Platform.""" 16 17from __future__ import absolute_import 18from __future__ import division 19from __future__ import unicode_literals 20 21 22ALPHA_VERSION = 'ALPHA' 23BETA_VERSION = 'BETA' 24AI_PLATFORM_API_VERSION = {BETA_VERSION: 'v1beta1', ALPHA_VERSION: 'v1alpha1'} 25AI_PLATFORM_MESSAGE_PREFIX = { 26 BETA_VERSION: 'GoogleCloudAiplatformV1beta1', 27 ALPHA_VERSION: 'GoogleCloudAiplatformV1alpha1' 28} 29AI_PLATFORM_API_NAME = 'aiplatform' 30 31SUPPORTED_REGION = ['us-central1', 'europe-west4', 'asia-east1'] 32 33OPERATION_CREATION_DISPLAY_MESSAGE = """\ 34The {verb} operation [{name}] was submitted successfully. 35 36You may view the status of your operation with the command 37 38 $ gcloud beta ai operations describe {id} {sub_commands}\ 39""" 40 41CUSTOM_JOB_CREATION_DISPLAY_MESSAGE = """\ 42Custom Job [{id}] submitted successfully. 43 44Your job is still active. You may view the status of your job with the command 45 46 $ gcloud alpha ai custom-jobs describe {id} 47 48Job State: {state}\ 49""" 50 51CUSTOM_JOB_CANCEL_DISPLAY_MESSAGE = """\ 52Request to cancel custom job [{id}] has been sent 53 54You may view the status of your job with the command 55 56 $ gcloud alpha ai custom-jobs describe {id} 57""" 58 59DEFAULT_OPERATION_COLLECTION = 'aiplatform.projects.locations.operations' 60 61CUSTOM_JOB_COLLECTION = 'aiplatform.projects.locations.customJobs' 62 63ENDPOINTS_COLLECTION = 'aiplatform.projects.locations.endpoints' 64 65INDEX_ENDPOINTS_COLLECTION = 'aiplatform.projects.locations.indexEndpoints' 66INDEXES_COLLECTION = 'aiplatform.projects.locations.indexes' 67 68TENSORBOARDS_COLLECTION = 'aiplatform.projects.locations.tensorboards' 69 70HPTUNING_JOB_CREATION_DISPLAY_MESSAGE = """\ 71Hyperparameter tuning job [{id}] submitted successfully. 72 73Your job is still active. You may view the status of your job with the command 74 75 $ gcloud alpha ai hp-tuning-jobs describe {id} 76 77Job State: {state}\ 78""" 79 80HPTUNING_JOB_CANCEL_DISPLAY_MESSAGE = """\ 81Request to cancel hyperparameter tuning job [{id}] has been sent 82 83You may view the status of your job with the command 84 85 $ gcloud alpha ai hp-tuning-jobs describe {id} 86""" 87 88HPTUNING_JOB_COLLECTION = 'aiplatform.projects.locations.hyperparameterTuningJobs' 89 90OP_AUTOSCALING_METRIC_NAME_MAPPER = { 91 'cpu-usage': 92 'aiplatform.googleapis.com/prediction/online/cpu/utilization', 93 'gpu-duty-cycle': 94 'aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle', 95} 96