added parameter checks
This commit is contained in:
Родитель
7ec78ff016
Коммит
d2002ed765
15
code/main.py
15
code/main.py
|
@ -74,6 +74,14 @@ def main():
|
|||
print(f"::error::Workspace authorizationfailed: {exception}")
|
||||
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
|
||||
print("::debug::Loading deployment target")
|
||||
try:
|
||||
|
@ -108,6 +116,7 @@ def main():
|
|||
else:
|
||||
container_registry = None
|
||||
|
||||
try:
|
||||
inference_config = InferenceConfig(
|
||||
entry_script=parameters.get("inference_entry_script", None),
|
||||
runtime=parameters.get("runtime", "python"),
|
||||
|
@ -120,6 +129,12 @@ def main():
|
|||
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
|
||||
print("::debug::Loading run config")
|
||||
|
|
Загрузка…
Ссылка в новой задаче