Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Add external key-value store feature to util.env_variables.py #19

Open
h2floh opened this issue Nov 12, 2020 · 3 comments
Open

Add external key-value store feature to util.env_variables.py #19

h2floh opened this issue Nov 12, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@h2floh
Copy link
Collaborator

h2floh commented Nov 12, 2020

As we discussed with the current approach it can be ease to loose track of the variables to be set.

In general I like the approach made here over the variable helper tool:
https://github.com/liupeirong/MLOpsManufacturing/blob/main/ml_service/util/env_variables.py

I see a big potential if we enable this helper tool to be able to switch between ENV variables (or a YAML file representation) and a Key-Value Store like App Configuration Service.

This will also help to reduce redefinition of "env" variables within a Azure Pipeline, either the values are directly retrieved while the python modules are executed or we could even leverage the Azure Pipeline task for App Configuration Service.

In addition we could also keep track of configuration changes, a feature provided by App Configuration Service.

Still I see a need to classify the variables/parameters regarding their purpose to decide where to store them and which degree of approval is needed to change them. E.g. is the variable/parameter relevant to describe the infrastructure, are they relevant to describe the source data, training parameters, model attributes, secrets etc.

@h2floh h2floh added the enhancement New feature or request label Nov 12, 2020
@h2floh
Copy link
Collaborator Author

h2floh commented Nov 19, 2020

Going one step back, I tried to make the current way of env variable usage clearer with this documentation

@h2floh
Copy link
Collaborator Author

h2floh commented Nov 19, 2020

It is possible to retrieve environment (dev,stage,prod) specific and unspecific key-values out of App Configuration Service via label filters.

I verified that this is working via the API.

Same for the Azure Pipeline task. You need the ',' to get two or more labels at once. But you could workaround it use two calls for getting the specific and unspecific values.

image

We should also be able to build around that, e.g. a template which loads the values via only one REST call.

Here the link to the Python SDK

@h2floh
Copy link
Collaborator Author

h2floh commented Nov 20, 2020

Sample yaml for AppConfiguration Pipeline task

steps:
- task: AzureAppConfiguration.azure-app-configuration-task.custom-build-release-task.AzureAppConfiguration@3
  displayName: 'Azure App Configuration: xyz'
  inputs:
    azureSubscription: 'subscription'
    ConfigstoreName: xyz
    KeyFilter: key
    Label: A
    TrimKeyPrefix: BB

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant