added parameter checks
This commit is contained in:
Родитель
7ec78ff016
Коммит
d2002ed765
39
code/main.py
39
code/main.py
|
@ -74,6 +74,14 @@ def main():
|
||||||
print(f"::error::Workspace authorizationfailed: {exception}")
|
print(f"::error::Workspace authorizationfailed: {exception}")
|
||||||
raise ProjectSystemException
|
raise ProjectSystemException
|
||||||
|
|
||||||
|
# Checking provided parameters
|
||||||
|
print("::debug::Checking provided parameters")
|
||||||
|
required_parameters_provided(
|
||||||
|
parameters=parameters,
|
||||||
|
keys=["name"],
|
||||||
|
message="Required parameter(s) not found in your parameters file for creating a web service. Please provide a value for the following key(s): "
|
||||||
|
)
|
||||||
|
|
||||||
# Loading deployment target
|
# Loading deployment target
|
||||||
print("::debug::Loading deployment target")
|
print("::debug::Loading deployment target")
|
||||||
try:
|
try:
|
||||||
|
@ -108,18 +116,25 @@ def main():
|
||||||
else:
|
else:
|
||||||
container_registry = None
|
container_registry = None
|
||||||
|
|
||||||
inference_config = InferenceConfig(
|
try:
|
||||||
entry_script=parameters.get("inference_entry_script", None),
|
inference_config = InferenceConfig(
|
||||||
runtime=parameters.get("runtime", "python"),
|
entry_script=parameters.get("inference_entry_script", None),
|
||||||
conda_file=parameters.get("conda_file", None),
|
runtime=parameters.get("runtime", "python"),
|
||||||
extra_docker_file_steps=parameters.get("extra_docker_file_steps", None),
|
conda_file=parameters.get("conda_file", None),
|
||||||
source_directory=parameters.get("inference_source_directory", None),
|
extra_docker_file_steps=parameters.get("extra_docker_file_steps", None),
|
||||||
enable_gpu=parameters.get("enable_gpu", None),
|
source_directory=parameters.get("inference_source_directory", None),
|
||||||
description=parameters.get("description", None),
|
enable_gpu=parameters.get("enable_gpu", None),
|
||||||
base_image=parameters.get("base_image", None),
|
description=parameters.get("description", None),
|
||||||
base_image_registry=container_registry,
|
base_image=parameters.get("base_image", None),
|
||||||
cuda_version=parameters.get("cuda_version", None)
|
base_image_registry=container_registry,
|
||||||
)
|
cuda_version=parameters.get("cuda_version", None)
|
||||||
|
)
|
||||||
|
except WebserviceException as exception:
|
||||||
|
print("::debug::Failed to create InferenceConfig. Trying to create no code deployment.")
|
||||||
|
inference_config = None
|
||||||
|
except TypeError as exception:
|
||||||
|
print("::debug::Failed to create InferenceConfig. Trying to create no code deployment.")
|
||||||
|
inference_config = None
|
||||||
|
|
||||||
# Loading run config
|
# Loading run config
|
||||||
print("::debug::Loading run config")
|
print("::debug::Loading run config")
|
||||||
|
|
Загрузка…
Ссылка в новой задаче