Skip to content

Commit

Permalink
Update agent ARM32/64 images to use Alpine (#6264)
Browse files Browse the repository at this point in the history
Our amd64 .NET-based Docker images have always used Alpine. I _think_ our arm64 .NET images may have been Alpine to start but moved to Ubuntu to work around some temporary issue. And our arm32 images were always Ubuntu-based because .NET Core 3.1 images for arm32v7 didn't come in Alpine.

Now that our codebase has upgraded to .NET 6, we want to use Alpine in all our .NET images for the reduced size and smaller attack surface.

This change moves all our .NET images to Alpine. In many cases, the Dockerfiles for the different architectures are identical, or nearly so. We have an opportunity to consolidate in the future, but I didn't take that step here to keep things focused.

Regarding the Edge Hub module: rather than updating the scripts to build watchdog and broker for Alpine, I have removed watchdog and broker from the module. They are preview components that are being removed from the main branch of the product. See the note [here](https://docs.microsoft.com/en-us/azure/iot-edge/how-to-publish-subscribe?view=iotedge-2020-11).

This change also cherry-picks a131745 to run Arm64 end-to-end tests on a 1ES-hosted agent instead of Raspberry Pi.

To test, I ran the Build Images pipeline, then passed the results to the End-to-end and Connectivity test pipelines, and verified the tests passed on amd64, arm32v7, and arm64v8.
  • Loading branch information
damonbarry authored Jun 1, 2022
1 parent bb844b5 commit 059aaea
Show file tree
Hide file tree
Showing 86 changed files with 500 additions and 1,726 deletions.
44 changes: 3 additions & 41 deletions builds/e2e/compare-compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ jobs:
################################################################################
- job: ubuntu_2004_arm64v8
################################################################################
displayName: Ubuntu 20.04 with arm64v8
displayName: Ubuntu 20.04 on arm64v8

pool:
name: 'Azure-IoT-Edge-1ES-Hosted-Linux-Arm64'
name: $(pool.linux.arm.name)
demands:
- ImageOverride -equals agent-aziotedge-ubuntu-20.04-arm64

Expand All @@ -189,45 +189,7 @@ jobs:
KeyVaultName: $(az.keyvault)
SecretsFilter: >-
edgebuild-service-principal-secret,
- bash: |
set -e
# Install PowerShell dependencies
sudo apt-get update
sudo apt-get install -y liblttng-ust0 jq
# Get the PowerShell tarball
release_id=$(curl -sSH 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/powershell/powershell/releases/latest | jq '.id')
url=$(curl -sSH 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/powershell/powershell/releases/$release_id/assets | jq -r ".[] | select(.name | contains(\"linux-arm64.tar.gz\")) | .browser_download_url")
echo "$release_id"
echo "$url"
file=$(basename $url)
curl -sSL $url -o /tmp/$file
# Install PowerShell
sudo mkdir -p /opt/microsoft/powershell/7
sudo tar zxf /tmp/$file -C /opt/microsoft/powershell/7
sudo chmod +x /opt/microsoft/powershell/7/pwsh
sudo ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh
displayName: Install pwsh
- bash: |
set -e
# Install .NET Core dependencies
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
libc6 libgcc1 libgssapi-krb5-2 libicu66 libssl1.1 libstdc++6 zlib1g
# Install .NET Core
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 6.0
sudo ln -s $HOME/.dotnet/dotnet /usr/bin/dotnet
displayName: Install .NET Core
- bash: |
set -e
# Install Moby
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > ./microsoft-prod.list
sudo cp ./microsoft-prod.list /etc/apt/sources.list.d/
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo cp ./microsoft.gpg /etc/apt/trusted.gpg.d/
rm microsoft-prod.list microsoft.gpg
sudo apt-get update
sudo apt-get install -y moby-engine
displayName: Install moby
- template: ../templates/prep-arm-agent.yaml
- template: templates/e2e-setup.yaml
- bash: |
set -e
Expand Down
9 changes: 5 additions & 4 deletions builds/e2e/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ jobs:
################################################################################
- job: ubuntu_2004_arm64v8
################################################################################
displayName: Ubuntu 20.04 with arm64v8
displayName: Ubuntu 20.04 on arm64v8
pool:
name: $(pool.custom.name)
demands:
- agent-group -equals rpi3-e2e-aarch64
name: $(pool.linux.arm.name)
demands:
- ImageOverride -equals agent-aziotedge-ubuntu-20.04-arm64

variables:
os: linux
Expand All @@ -191,6 +191,7 @@ jobs:
timeoutInMinutes: 120

steps:
- template: ../templates/prep-arm-agent.yaml
- template: templates/e2e-clean-directory.yaml
- template: templates/e2e-setup.yaml
- template: templates/e2e-clear-docker-cached-images.yaml
Expand Down
2 changes: 0 additions & 2 deletions builds/e2e/templates/e2e-run-base-image-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ parameters:
# NestedEdgeOnly: Only applies to nested edge cases
# NestedEdgeAmqpOnly: Only applies to nested edge cases using amqp upstream protocol
# LegacyMqttRequired: Only applies to cases with the edgehub legacy mqtt protocol head
# BrokerRequired: Only applies to cases with the broker enabled
steps:
- pwsh: |
$testFile = '$(binDir)/Microsoft.Azure.Devices.Edge.Test.dll'
Expand Down Expand Up @@ -47,7 +46,6 @@ steps:
elseif ($test_type -eq 'nestededge_amqp')
{
$filter += '&Category!=SingleNodeOnly'
$filter += '&Category!=BrokerRequired'
$filter += '&Category!=FlakyOnNested'
# Below tests were disabled and marked for re-enable when a blocking item was resolved.
# When it was resolved the tests were never enabled. We need to re-enable these.
Expand Down
2 changes: 0 additions & 2 deletions builds/e2e/templates/e2e-run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ parameters:
# NestedEdgeOnly: Only applies to nested edge cases
# NestedEdgeAmqpOnly: Only applies to nested edge cases using amqp upstream protocol
# LegacyMqttRequired: Only applies to cases with the edgehub legacy mqtt protocol head
# BrokerRequired: Only applies to cases with the broker enabled
# SkipManifestTrust: Only applies to manifest/content trust tests
steps:
- pwsh: |
Expand Down Expand Up @@ -48,7 +47,6 @@ steps:
elseif ($test_type -eq 'nestededge_amqp')
{
$filter += '&Category!=SingleNodeOnly'
$filter += '&Category!=BrokerRequired'
$filter += '&Category!=FlakyOnNested'
# Below tests were disabled and marked for re-enable when a blocking item was resolved.
# When it was resolved the tests were never enabled. We need to re-enable these.
Expand Down
101 changes: 0 additions & 101 deletions builds/misc/images-mqtt.yaml

This file was deleted.

Loading

0 comments on commit 059aaea

Please sign in to comment.