This repository was archived by the owner on Dec 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Observability Helper Library #23
Closed
Closed
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
e36368b
Modified Observability added dependency tracing
df33fa7
Add add env vars to .env.example
e2d38dd
Improvements for Observability Helper
5faab7e
Update script paths
3f6f317
Add observability module to scripts
7893e32
Changes to CI for observability
fcba561
Fix log_metrics, adapt test to singleton pattern
99edaa6
Refactor CI dependency updates
89ecf71
CI dependency template fix add to train pipe
1d076b3
Fix observability formatting
38d11b4
Activate env rebuild for aml pipeline tests
48d57ee
Fix parameters.json path reference
8390138
Fix logger usage in train.py
284d2b0
Fix copy/paste error - print to file
05284f3
Fix duplicate log entries, enrich custom dimension
293f344
Add appinsights cs (secret) to env-var
367de8f
change appinsights env variable name
f5e2e83
Fix log init if appinsights cs key is absent in vg
3fcbd3e
Extend run env with log related variables
943c956
Fix c&p error in register_loggers
89a9d39
Add missing env to build_train_pipeline step
2348bd3
Optimize for AppInsights Application Map
46b39f1
Move end_span to finally block
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| steps: | ||
| # This step ensures that the latest ci dependencies are applied to the build agent | ||
| - script: | | ||
| conda env update -f ml_model/ci_dependencies.yml -n ci | ||
| displayName: 'Update missing dependencies for current branch on build agent' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
| variables: | ||
| # The directory containing the scripts for training, evaluating, and registering the model | ||
| - name: SOURCES_DIR_TRAIN | ||
| value: ml_model | ||
| value: '.' | ||
|
|
||
| # Azure ML Variables | ||
| - name: EXPERIMENT_NAME | ||
|
|
@@ -32,8 +32,8 @@ variables: | |
| - name: ALLOW_RUN_CANCEL | ||
| value: "false" | ||
| # 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" | ||
| - name: AML_REBUILD_ENVIRONMENT | ||
| value: "true" | ||
|
|
||
| # AML Environment Config | ||
| - name: AML_ENV_NAME | ||
|
|
@@ -42,6 +42,8 @@ variables: | |
| value: flower_custom_preprocess_env | ||
|
|
||
| # AML Compute Cluster Config | ||
| - name: AML_ENV_TRAIN_CONDA_DEP_FILE | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this var used? |
||
| value: "ml_model/conda_dependencies.yml" | ||
| - name: AML_COMPUTE_CLUSTER_CPU_SKU | ||
| value: STANDARD_DS2_V2 | ||
| - name: AML_COMPUTE_CLUSTER_NAME | ||
|
|
@@ -52,6 +54,24 @@ variables: | |
| value: 0 | ||
| - name: AML_CLUSTER_MAX_NODES | ||
| value: 4 | ||
| - name: AML_CLUSTER_PRIORITY | ||
| value: lowpriority | ||
|
|
||
| # Observability related | ||
| - name: LOG_TO_CONSOLE | ||
| value: 'false' | ||
| - name: LOG_LEVEL | ||
| value: 'INFO' # DEBUG, INFO, WARNING, ERROR, CRITICAL | ||
| - name: LOG_SAMPLING_RATE | ||
| value: '1.0' # Probability 0.0 -> 1.0 | ||
| - name: TRACE_SAMPLING_RATE | ||
| value: '1.0' # Probability 0.0 -> 1.0 | ||
| - name: METRICS_EXPORT_INTERVAL | ||
| value: '15' # Seconds | ||
|
|
||
| # The name for the (docker/webapp) scoring image | ||
| - name: IMAGE_NAME | ||
| value: "flowerclassifier" | ||
|
|
||
| # AML pipelines can run outside of Azure DevOps, these parameters control AML pipeline behaviors | ||
| - name: PREPROCESSING_PARAM | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,8 +25,18 @@ RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-${CONDA_VERSION} | |
| ~/miniconda/bin/conda clean -tipsy | ||
| ENV PATH="/home/dockeruser/miniconda/bin/:${PATH}" | ||
|
|
||
| USER root | ||
|
|
||
| RUN apt-get update --fix-missing && \ | ||
| apt-get install -y build-essential | ||
|
|
||
| # Create conda environment for dockeruser user | ||
| USER dockeruser | ||
|
|
||
| RUN conda install -y conda=${CONDA_VERSION} python=${PYTHON_VERSION} && \ | ||
| pip install azureml-defaults==${AZUREML_SDK_VERSION} inference-schema==${INFERENCE_SCHEMA_VERSION} &&\ | ||
| pip install python-dotenv==0.12.* dataclasses==0.6 opencensus==0.7.11 opencensus-ext-httplib==0.7.3 \ | ||
| opencensus-ext-azure==1.0.5 opencensus-ext-logging==0.1.0 opencensus-context==0.1.2 && \ | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we use conda dependency yml to be consistent rather than directly pip install? |
||
| conda clean -aqy && \ | ||
| rm -rf ~/miniconda/pkgs && \ | ||
| find ~/miniconda/ -type d -name __pycache__ -prune -exec rm -rf {} \; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only want to rebuild the first time the dependencies are changed, right? Perhaps leave the default to false, and set the ADO variable to true?