Azure / Azure/azure-sdk-for-python

How to provide environment variables to command components (SDK V2)

Offen
#44,187 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
customer-reported needs-team-attention question
Vorherrschende Sprache
Python
Sterne
5.6k
Forks
3.4k
Ø Merge
2 T. 2 Std.
Gemergte PRs (30 T.)
213

Beschreibung

Hey!

We're migrating from SDK V1 to V2.
I have to say it's been a headache.

We use yaml command components to run/deploy our scripts with SDK v2.
The yaml command components are loaded into a pipeline_component, and then the pipeline_component runs in a job, using the Python V2 SDK.
The above works, the job and its components execute.

**But**, how do we set environment variables for these (yaml) components so that they are reachable at runtime?
Can we set it in the command component yaml? In the loaded component? In the pipeline? In the Environment? I've searched and tried almost everything by now, but to no avail.

There's even a forum question about it, where the mods are suggesting the commandComponent.schema.json supports it, which it doesn't:
https://learn.microsoft.com/en-us/answers/questions/2237919/how-to-pass-environment-variable-into-azureml-comp?comment=answer-2015022&page=1#comment-2360727

Side comment is that a lot of the documentaton on SDK V2 references the _mldesigner_ package, which has dependencies to SDK v1 (azureml.core) - and from what I gather this is contraproductive since SDK v1 is out or support next summer? And not even supporting above Python 3.9?
At least when I've tried to use mldesigner, I get errors that I need to add azureml.core as well.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, den YAML-Befehlskomponentenfluss von SDK V2 und die in der Issue erwähnte Referenz commandComponent.schema.json zu überprüfen. Prüfe, wie Umgebungsvariablen für geladene Komponenten, Pipelines und Umgebungen behandelt werden, und vergleiche dies mit den mldesigner-Richtlinien in der Dokumentation. Als erledigt gilt die Dokumentation der unterstützten Konfiguration oder eine klare Aussage zur Einschränkung und den erforderlichen Paketversionen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
cloud, machine-learning
Issue-Typ
Dokumentation
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.