Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an environment variable flag to recreate the AMLS Environment #230

Merged
merged 8 commits into from
Mar 16, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ RUN_EVALUATION = 'true'

# Set to true cancels the Azure ML pipeline run when evaluation criteria are not met.
ALLOW_RUN_CANCEL = 'true'

# Flag to allow rebuilding the AML Environment after it was built for the first time. This enables dependency updates from conda_dependencies.yaml.
AML_REBUILD_ENVIRONMENT = 'false'
7 changes: 6 additions & 1 deletion .pipelines/diabetes_regression-variables-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,9 @@ variables:
# For debugging deployment issues. Specify a build id with the MODEL_BUILD_ID pipeline variable at queue time
# to skip training and deploy a model registered by a previous build.
- name: modelbuildid
value: $[coalesce(variables['MODEL_BUILD_ID'], variables['Build.BuildId'])]
value: $[coalesce(variables['MODEL_BUILD_ID'], variables['Build.BuildId'])]


# Flag to allow rebuilding the AML Environment after it was built for the first time. This enables dependency updates from conda_dependencies.yaml.
# - name: AML_REBUILD_ENVIRONMENT
# value: "false"
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ def main():

# Create a reusable Azure ML environment
environment = get_environment(
aml_workspace, e.aml_env_name, create_new=False) # NOQA: E501

aml_workspace, e.aml_env_name, create_new=e.rebuild_env) #
run_config = RunConfiguration()
run_config.environment = environment

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def main():
# Make sure to include `r-essentials'
# in diabetes_regression/conda_dependencies.yml
environment = get_environment(
aml_workspace, e.aml_env_name, create_new=False) # NOQA: E501
aml_workspace, e.aml_env_name, create_new=e.rebuild_env) # NOQA: E501
run_config = RunConfiguration()
run_config.environment = environment

Expand Down
6 changes: 6 additions & 0 deletions ml_service/util/env_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def __init__(self):
self._allow_run_cancel = os.environ.get(
"ALLOW_RUN_CANCEL", "true")
self._aml_env_name = os.environ.get("AML_ENV_NAME")
self._rebuild_env = os.environ.get("AML_REBUILD_ENVIRONMENT",
"false").lower().strip() == "true"

@property
def workspace_name(self):
Expand Down Expand Up @@ -166,3 +168,7 @@ def allow_run_cancel(self):
@property
def aml_env_name(self):
return self._aml_env_name

@property
def rebuild_env(self):
return self._rebuild_env