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

ADO-880627: Use docker-less ACR login #61

Merged

Conversation

wbradley94
Copy link
Collaborator

@wbradley94 wbradley94 commented Aug 21, 2023

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

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run 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

  1. I tested that this variant of 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.
  2. I locally re-enabled the integration tests for VNFs & CNFs and confirmed they worked. The CNF integration test failed when trying to publish the NSD - I didn't determine why, but I claim it is unrelated to my change. The NFD publish command was successful.
  3. I manually ran the az aosm nfd publish --definition-type cnf command for a SAS NFD and confirmed the Helm chart was uploaded successfully.

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.
@wbradley94 wbradley94 marked this pull request as ready for review August 21, 2023 16:11
@patrykkulik-microsoft
Copy link
Collaborator

Looks good to me

@wbradley94 wbradley94 merged commit 63ebf43 into add-aosm-extension Aug 22, 2023
0 of 2 checks passed
@wbradley94 wbradley94 deleted the wb2/ado-880627-acr-login-without-docker branch August 22, 2023 11:46
@sunnycarter
Copy link
Collaborator

Thanks for doing this Will, very helpful. :) FYI some README changes were required alongside this change, I'll make those now but FYI for future PRs.

@wbradley94
Copy link
Collaborator Author

Thanks for doing this Will, very helpful. :) FYI some README changes were required alongside this change, I'll make those now but FYI for future PRs.

Thanks very much Sunny, I did make a note of this when I started development but completely forgot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants