-
Notifications
You must be signed in to change notification settings - Fork 16
azl4: rollback and servicing pipeline support #698
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
Draft
bfjelds
wants to merge
7
commits into
user/bfjelds/azl4-2-images
Choose a base branch
from
user/bfjelds/azl4-3-pipelines
base: user/bfjelds/azl4-2-images
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ad73ad0
azl4: rollback and servicing pipeline support
bfjelds 7a58dfe
switch azl_qemu_guest blob account; download cached netplan RPMs
bfjelds 27015c7
make override more generic
bfjelds 7e162be
pipelines: enable grubazl4 netplan runtime rollback testing and raise…
bfjelds 6a0bf0e
storm/rollback: mark test dummy netplan device optional to avoid wait…
bfjelds 5b34e5d
pipelines: set stageSshKeys false in build-image-template
bfjelds 52d938e
pipelines: address azl4 testimage review feedback
bfjelds 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
48 changes: 48 additions & 0 deletions
48
.pipelines/templates/stages/common_tasks/download-azl4-base-vhdx.yml
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,48 @@ | ||
| parameters: | ||
| - name: tridentSourceDirectory | ||
| type: string | ||
|
|
||
| steps: | ||
| # Download a preview AZL4 base VHDX from storage account. | ||
| - task: AzureCLI@2 | ||
| displayName: "Download AZL4 base VHDX from blob" | ||
| inputs: | ||
| azureSubscription: azlinuxbmpstaging-storage-account-read | ||
| scriptType: bash | ||
| scriptLocation: inlineScript | ||
| workingDirectory: ${{ parameters.tridentSourceDirectory }} | ||
| inlineScript: | | ||
| set -euxo pipefail | ||
|
|
||
| mkdir -p $(Build.ArtifactStagingDirectory)/images | ||
| az storage blob download \ | ||
| --max-connections 10 \ | ||
| --auth-mode login \ | ||
| --account-name azlinuxbmpstaging \ | ||
| --container-name azl4-qemu-guest \ | ||
| --name azl4_qemu_guest.vhdx \ | ||
| --file $(Build.ArtifactStagingDirectory)/images/azl4_qemu_guest.vhdx | ||
| ls -la $(Build.ArtifactStagingDirectory)/images/azl4_qemu_guest.vhdx | ||
|
|
||
| # AZL4 netplan (1.1.2) is incompatible with systemd (258.4). 1.1.2 is the current | ||
| # release of netplan in AZL4, but netplan 1.2.1 fixes the problem. Our | ||
| # tests depend on netplan, so workaround this for now with cached RPMs. | ||
| - task: AzureCLI@2 | ||
| displayName: "Download override AZL4 RPMs from blob" | ||
| inputs: | ||
| azureSubscription: azlinuxbmpstaging-storage-account-read | ||
| scriptType: bash | ||
| scriptLocation: inlineScript | ||
| workingDirectory: ${{ parameters.tridentSourceDirectory }} | ||
| inlineScript: | | ||
| set -euxo pipefail | ||
|
|
||
| mkdir -p ${{ parameters.tridentSourceDirectory }}/artifacts/rpm-overrides | ||
| az storage blob download-batch \ | ||
| --max-connections 10 \ | ||
| --auth-mode login \ | ||
| --account-name azlinuxbmpstaging \ | ||
| --source azl4-override-rpms \ | ||
| --pattern "*.rpm" \ | ||
| --destination ${{ parameters.tridentSourceDirectory }}/artifacts/rpm-overrides | ||
| ls -la ${{ parameters.tridentSourceDirectory }}/artifacts/rpm-overrides |
74 changes: 74 additions & 0 deletions
74
.pipelines/templates/stages/common_tasks/prepare-testimage-requirements.yml
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,74 @@ | ||
| parameters: | ||
| - name: tridentSourceDirectory | ||
| type: string | ||
|
|
||
| - name: azureLinuxVersion | ||
| displayName: Version of AzureLinux for the Base Image | ||
| type: string | ||
| default: "3.0" | ||
|
|
||
| - name: stageSshKeys | ||
| type: boolean | ||
| default: false | ||
|
|
||
| steps: | ||
| - ${{ if eq(parameters.stageSshKeys, true) }}: | ||
| # Stage SSH keys into the testimage tree so they get baked into the image | ||
| # and are available for tests to use. | ||
| - bash: | | ||
| set -euxo pipefail | ||
| SSH_DEST="${{ parameters.tridentSourceDirectory }}/tests/images/trident-vm-testimage/base/files" | ||
| SSH_SRC="${{ parameters.tridentSourceDirectory }}/artifacts" | ||
|
|
||
| if [ ! -f "$SSH_SRC/id_rsa.pub" ]; then | ||
| echo "ssh keys not found at $SSH_SRC" | ||
| echo "Available files:" | ||
| find "$SSH_SRC" -type f 2>/dev/null | head -20 || true | ||
| exit 1 | ||
| fi | ||
|
bfjelds marked this conversation as resolved.
bfjelds marked this conversation as resolved.
|
||
|
|
||
| # Stage only the public key. The image configs reference only | ||
| # files/id_rsa.pub (injected as an authorized key); the private | ||
| # key is used host-side by the test runner and must not be baked | ||
| # into the image. | ||
| mkdir -p "$SSH_DEST" | ||
| cp "$SSH_SRC/id_rsa.pub" "$SSH_DEST/" | ||
| chmod 644 "$SSH_DEST/id_rsa.pub" | ||
|
bfjelds marked this conversation as resolved.
|
||
| displayName: "Stage SSH keys into testimage tree" | ||
| workingDirectory: ${{ parameters.tridentSourceDirectory }} | ||
|
|
||
| - bash: | | ||
| set -euxo pipefail | ||
|
|
||
| # Move base VHDX to artifacts/ (builder expects artifacts/*.vhdx) | ||
| mkdir -p artifacts | ||
| if ls "$(Build.ArtifactStagingDirectory)/images" | grep -q ".*\.vhdx$"; then | ||
| mv $(Build.ArtifactStagingDirectory)/images/*.vhdx artifacts/ | ||
| rm -rf $(Build.ArtifactStagingDirectory)/images | ||
| else | ||
| echo "No base image found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Move dev RPM overrides to artifacts/rpm-overrides/ | ||
| if ls "$(Build.ArtifactStagingDirectory)/rpms/" 2>/dev/null | grep -q "rpms.tar.gz"; then | ||
| mkdir -p artifacts/rpm-overrides | ||
| tar -xvf $(Build.ArtifactStagingDirectory)/rpms/rpms.tar.gz \ | ||
| --strip-components=2 \ | ||
| -C artifacts/rpm-overrides | ||
| rm $(Build.ArtifactStagingDirectory)/rpms/rpms.tar.gz | ||
| fi | ||
|
|
||
| DISTRO=azl3 | ||
| if [[ "${{ parameters.azureLinuxVersion }}" == "4.0-preview" ]]; then | ||
| DISTRO=azl4 | ||
| fi | ||
|
bfjelds marked this conversation as resolved.
|
||
|
|
||
| # Move Trident RPMs to bin/RPMS/ (builder expects bin/RPMS/*.rpm) | ||
| if [ -d "$(Build.ArtifactStagingDirectory)/trident" ]; then | ||
| mkdir -p bin/RPMS | ||
| find "$(Build.ArtifactStagingDirectory)/trident" -name "*${DISTRO}*.rpm" -exec mv {} bin/RPMS/ \; | ||
| rm -rf "$(Build.ArtifactStagingDirectory)/trident" | ||
| fi | ||
|
bfjelds marked this conversation as resolved.
|
||
| displayName: "Prepare and move requirements" | ||
| workingDirectory: ${{ parameters.tridentSourceDirectory }} | ||
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,6 +25,7 @@ parameters: | |
| type: string | ||
| values: | ||
| - qemu-grub | ||
| - grubazl4 | ||
| - qemu | ||
| - uki | ||
|
|
||
|
|
@@ -160,7 +161,10 @@ jobs: | |
| fi | ||
| if [ "${{ parameters.flavor }}" != "uki" ]; then | ||
| if [[ "${{ parameters.testSecureBoot }}" == 'True' ]]; then | ||
| STORM_DYNAMIC_FLAGS="$STORM_DYNAMIC_FLAGS --secure-boot" | ||
| # grubazl4 is skipped: its base image does not support secure boot yet. | ||
|
Member
Author
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. revisit |
||
| if [[ "${{ parameters.flavor }}" != 'grubazl4' ]]; then | ||
| STORM_DYNAMIC_FLAGS="$STORM_DYNAMIC_FLAGS --secure-boot" | ||
| fi | ||
| fi | ||
| fi | ||
| if [ "${{ parameters.skipManualRollbackTesting }}" == "true" ]; then | ||
|
|
@@ -195,7 +199,7 @@ jobs: | |
| --force-cleanup | ||
| displayName: "Rollback test (${{ parameters.platform }})" | ||
| workingDirectory: $(TRIDENT_SOURCE_DIR) | ||
| timeoutInMinutes: 5 | ||
| timeoutInMinutes: 10 | ||
|
|
||
| - bash: | | ||
| set -eux | ||
|
|
||
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 |
|---|---|---|
|
|
@@ -40,6 +40,7 @@ parameters: | |
| displayName: Image flavor | ||
| type: string | ||
| values: | ||
| - grubazl4 | ||
| - qemu | ||
| - azure | ||
| - uki | ||
|
|
@@ -167,7 +168,10 @@ jobs: | |
| fi | ||
| if [ "${{ parameters.flavor }}" != "uki" ]; then | ||
| if [[ "${{ parameters.testSecureBoot }}" == 'True' ]]; then | ||
| FLAGS="$FLAGS --secure-boot" | ||
| # grubazl4 is skipped: its base image does not support secure boot yet. | ||
|
Member
Author
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. revisit |
||
| if [[ "${{ parameters.flavor }}" != 'grubazl4' ]]; then | ||
| FLAGS="$FLAGS --secure-boot" | ||
| fi | ||
| fi | ||
| fi | ||
| if [ "${{ parameters.rollbackTesting }}" == "True" ]; then | ||
|
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.