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

extending use of SOURCES_DIR_TRAIN variable #143

Merged
merged 2 commits into from
Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 4 additions & 4 deletions .pipelines/azdo-ci-build-train.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ stages:
modelSourceType: manualSpec
modelName: '$(MODEL_NAME)'
modelVersion: $(MODEL_VERSION)
inferencePath: '$(Build.SourcesDirectory)/code/scoring/inference_config.yml'
inferencePath: '$(Build.SourcesDirectory)/$(SOURCES_DIR_TRAIN)/scoring/inference_config.yml'
deploymentTarget: ACI
deploymentName: $(ACI_DEPLOYMENT_NAME)
deployConfig: '$(Build.SourcesDirectory)/code/scoring/deployment_config_aci.yml'
deployConfig: '$(Build.SourcesDirectory)/$(SOURCES_DIR_TRAIN)/scoring/deployment_config_aci.yml'
overwriteExistingDeployment: true
- task: AzureCLI@1
displayName: 'Smoke test'
Expand Down Expand Up @@ -150,11 +150,11 @@ stages:
modelSourceType: manualSpec
modelName: '$(MODEL_NAME)'
modelVersion: $(MODEL_VERSION)
inferencePath: '$(Build.SourcesDirectory)/code/scoring/inference_config.yml'
inferencePath: '$(Build.SourcesDirectory)/$(SOURCES_DIR_TRAIN)/scoring/inference_config.yml'
deploymentTarget: AKS
aksCluster: $(AKS_COMPUTE_NAME)
deploymentName: $(AKS_DEPLOYMENT_NAME)
deployConfig: '$(Build.SourcesDirectory)/code/scoring/deployment_config_aks.yml'
deployConfig: '$(Build.SourcesDirectory)/$(SOURCES_DIR_TRAIN)/scoring/deployment_config_aks.yml'
overwriteExistingDeployment: true
- task: AzureCLI@1
displayName: 'Smoke test'
Expand Down
8 changes: 6 additions & 2 deletions code/evaluate/evaluate_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@
run = Run.get_context()
if (run.id.startswith('OfflineRun')):
from dotenv import load_dotenv
sys.path.append(os.path.abspath("./code/util")) # NOQA: E402
from model_helper import get_model_by_tag
# For local development, set values in this section
load_dotenv()
sources_dir = os.environ.get("SOURCES_DIR_TRAIN")
if (sources_dir is None):
sources_dir = 'code'
path_to_util = os.path.join(".", sources_dir, "util")
sys.path.append(os.path.abspath(path_to_util)) # NOQA: E402
from model_helper import get_model_by_tag
workspace_name = os.environ.get("WORKSPACE_NAME")
experiment_name = os.environ.get("EXPERIMENT_NAME")
resource_group = os.environ.get("RESOURCE_GROUP")
Expand Down
8 changes: 6 additions & 2 deletions ml_service/pipelines/verify_train_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ def main():
run = Run.get_context()
if (run.id.startswith('OfflineRun')):
from dotenv import load_dotenv
sys.path.append(os.path.abspath("./code/util")) # NOQA: E402
from model_helper import get_model_by_tag
# For local development, set values in this section
load_dotenv()
sources_dir = os.environ.get("SOURCES_DIR_TRAIN")
if (sources_dir is None):
sources_dir = 'code'
path_to_util = os.path.join(".", sources_dir, "util")
sys.path.append(os.path.abspath(path_to_util)) # NOQA: E402
from model_helper import get_model_by_tag
workspace_name = os.environ.get("WORKSPACE_NAME")
experiment_name = os.environ.get("EXPERIMENT_NAME")
resource_group = os.environ.get("RESOURCE_GROUP")
Expand Down
9 changes: 7 additions & 2 deletions ml_service/util/create_scoring_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
args = parser.parse_args()

model = Model(ws, name=e.model_name, version=e.model_version)
os.chdir("./code/scoring")
sources_dir = e.sources_dir
if (sources_dir is None):
sources_dir = 'code'
path_to_scoring = os.path.join(".", sources_dir, "scoring")
cwd = os.getcwd()
os.chdir(path_to_scoring)

image_config = ContainerImage.image_configuration(
execution_script=e.score_script,
Expand All @@ -40,7 +45,7 @@
name=e.image_name, models=[model], image_config=image_config, workspace=ws
)

os.chdir("../..")
os.chdir(cwd)

image.wait_for_creation(show_output=True)

Expand Down