ADO-880627: Use docker-less ACR login #61
Merged
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.
For running in environments without docker, such as CI pipelines. This affects uploading Helm charts for CNFs - the ACR login now fetches an access token, which is used to login to the Helm registry and upload the chart.
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az aosm nfd publish
General Guidelines
azdev style <YOUR_EXT>
locally? (pip install azdev
required)python scripts/ci/test_index.py -q
locally?For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.json
automatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json
.Fix details
Fix for https://dev.azure.com/msazuredev/AzureForOperators/_workitems/edit/880627/. OneBranch pipelines run in an environment without docker. When running
az aosm nfd publish --definition-type cnf
, docker is currently used to login to the ACR backing the publisher artifact store.The Azure CLI supports docker-less login by way of an access token - see https://learn.microsoft.com/en-us/azure/container-registry/container-registry-authentication?tabs=azure-cli.
Testing
az acr login
works when run in a OneBranch pipeline. See this commit: https://dev.azure.com/msazuredev/AzureForOperators/_git/afosas-aosm-nfd/commit/138f796d600c1eeaee28105b6ceb6c27cdaf7afc?refName=refs%2Fheads%2Fwb2%2Fstory-737052-ci-to-publish-nfd & successful pipeline stage: https://dev.azure.com/msazuredev/AzureForOperators/_build/results?buildId=1089950&view=logs&j=45688f8f-8b77-5d43-14e3-e592d7b4138f&t=3495c423-bdbb-557b-d256-591edca2e36d. I also tested the script locally.az aosm nfd publish --definition-type cnf
command for a SAS NFD and confirmed the Helm chart was uploaded successfully.