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

Add helix image for armv6 raspbian #1083

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
sbomer marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ parameters:
windowsAmdBuildJobTimeout: 60
windowsAmdTestJobTimeout: 60
linuxAmdBuildJobTimeout: 60
linuxArmBuildJobTimeout: 60
linuxAmd64Pool: ""
buildMatrixType: platformDependencyGraph
testMatrixType: platformVersionedOs
Expand Down Expand Up @@ -51,6 +52,7 @@ stages:
windowsAmdBuildJobTimeout: ${{ parameters.windowsAmdBuildJobTimeout }}
windowsAmdTestJobTimeout: ${{ parameters.windowsAmdTestJobTimeout }}
linuxAmdBuildJobTimeout: ${{ parameters.linuxAmdBuildJobTimeout }}
linuxArmBuildJobTimeout: ${{ parameters.linuxArmBuildJobTimeout }}
buildMatrixType: ${{ parameters.buildMatrixType }}
testMatrixType: ${{ parameters.testMatrixType }}

Expand Down
1 change: 1 addition & 0 deletions eng/pipelines/dotnet-buildtools-prereqs-raspbian-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ stages:
parameters:
internalProjectName: ${{ variables.internalProjectName }}
publicProjectName: ${{ variables.publicProjectName }}
linuxArmBuildJobTimeout: 120
1 change: 1 addition & 0 deletions eng/pipelines/dotnet-buildtools-prereqs-raspbian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ extends:
parameters:
internalProjectName: ${{ variables.internalProjectName }}
publicProjectName: ${{ variables.publicProjectName }}
linuxArmBuildJobTimeout: 120
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu.azurecr.io/ubuntu:18.04
FROM ubuntu.azurecr.io/ubuntu:22.04

# Install the base toolchain we need to build anything (clang, cmake, make and the like).
RUN apt-get update \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:raspbian-10-crossdeps-local as builder
FROM --platform=linux/arm/v7 mcr.microsoft.com/dotnet-buildtools/prereqs:raspbian-12-crossdeps-local as builder

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we passing --platform here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be linux/arm/v6?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't be necessary at all. That would only be necessary if you were pulling a multi-arch tag which isn't the case here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without --platform I am getting the following in ci:

Dockerfile:1
--------------------
   1 | >>> FROM mcr.microsoft.com/dotnet-buildtools/prereqs:raspbian-12-crossdeps-local as builder
   2 |     
   3 |     ARG ROOTFS_DIR=/crossrootfs
--------------------
ERROR: failed to solve: mcr.microsoft.com/dotnet-buildtools/prereqs:raspbian-12-crossdeps-local: mcr.microsoft.com/dotnet-buildtools/prereqs:raspbian-12-crossdeps-local: not found
   at Microsoft.DotNet.ImageBuilder.ExecuteHelper.Execute(ProcessStartInfo info, Func`2 executor, Boolean isDryRun, String errorMessage, String executeMessageOverride) in /image-builder/src/ExecuteHelper.cs:line 101
   at Microsoft.DotNet.ImageBuilder.ExecuteHelper.ExecuteWithRetry(ProcessStartInfo info, Action`1 processStartedCallback, Boolean isDryRun, String errorMessage, String executeMessageOverride) in /image-builder/src/ExecuteHelper.cs:line 60
   at Microsoft.DotNet.ImageBuilder.ExecuteHelper.ExecuteWithRetry(String fileName, String args, Boolean isDryRun, String errorMessage, String executeMessageOverride) in /image-builder/src/ExecuteHelper.cs:line 45
   at Microsoft.DotNet.ImageBuilder.DockerService.BuildImage(String dockerfilePath, String buildContextPath, String platform, IEnumerable`1 tags, IDictionary`2 buildArgs, Boolean isRetryEnabled, Boolean isDryRun) in /image-builder/src/DockerService.cs:line 60
   at Microsoft.DotNet.ImageBuilder.DockerServiceCache.BuildImage(String dockerfilePath, String buildContextPath, String platform, IEnumerable`1 tags, IDictionary`2 buildArgs, Boolean isRetryEnabled, Boolean isDryRun) in /image-builder/src/DockerServiceCache.cs:line 37
   at Microsoft.DotNet.ImageBuilder.Commands.BuildCommand.BuildImage(PlatformInfo platform, IEnumerable`1 allTags) in /image-builder/src/Commands/BuildCommand.cs:line 483

IIRC I could build this locally with --platform. I think v7 is right because the raspbian-12-crossdeps image says v7 in manifest.json. Let's see if this works in ci.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are going to replace "armv6" image and new image doesn't provide armv6, then it is not the right image? I think uname -a etc. should show armv6l. v7 and v6 are very different ISAs; which is why we have ARM and ARMV6 as separate architectures.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without --platform I am getting the following in ci:

Dockerfile:1
--------------------
   1 | >>> FROM mcr.microsoft.com/dotnet-buildtools/prereqs:raspbian-12-crossdeps-local as builder
   2 |     
   3 |     ARG ROOTFS_DIR=/crossrootfs
--------------------
ERROR: failed to solve: mcr.microsoft.com/dotnet-buildtools/prereqs:raspbian-12-crossdeps-local: mcr.microsoft.com/dotnet-buildtools/prereqs:raspbian-12-crossdeps-local: not found
   at Microsoft.DotNet.ImageBuilder.ExecuteHelper.Execute(ProcessStartInfo info, Func`2 executor, Boolean isDryRun, String errorMessage, String executeMessageOverride) in /image-builder/src/ExecuteHelper.cs:line 101
   at Microsoft.DotNet.ImageBuilder.ExecuteHelper.ExecuteWithRetry(ProcessStartInfo info, Action`1 processStartedCallback, Boolean isDryRun, String errorMessage, String executeMessageOverride) in /image-builder/src/ExecuteHelper.cs:line 60
   at Microsoft.DotNet.ImageBuilder.ExecuteHelper.ExecuteWithRetry(String fileName, String args, Boolean isDryRun, String errorMessage, String executeMessageOverride) in /image-builder/src/ExecuteHelper.cs:line 45
   at Microsoft.DotNet.ImageBuilder.DockerService.BuildImage(String dockerfilePath, String buildContextPath, String platform, IEnumerable`1 tags, IDictionary`2 buildArgs, Boolean isRetryEnabled, Boolean isDryRun) in /image-builder/src/DockerService.cs:line 60
   at Microsoft.DotNet.ImageBuilder.DockerServiceCache.BuildImage(String dockerfilePath, String buildContextPath, String platform, IEnumerable`1 tags, IDictionary`2 buildArgs, Boolean isRetryEnabled, Boolean isDryRun) in /image-builder/src/DockerServiceCache.cs:line 37
   at Microsoft.DotNet.ImageBuilder.Commands.BuildCommand.BuildImage(PlatformInfo platform, IEnumerable`1 allTags) in /image-builder/src/Commands/BuildCommand.cs:line 483

This doesn't make sense to me. This happens on the CI in AzDO? I can't find a failed build with that error. I'd like to see the build log to understand what's happening. Getting a not found error would mean the image tag doesn't exist at all, regardless of its platform.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are going to replace "armv6" image and new image doesn't provide armv6, then it is not the right image?

I am trying to follow the setup introduced in https://github.com/dotnet/dotnet-buildtools-prereqs-docker/pull/550/files#diff-d5da67421f1a1e08a8982140c63e4c621c9332ea33774a4db797a3dc334261b9 where the crossdeps image uses armv7, and it is used to build a rootfs for an armv6 helix image. The intention of adding --platform is to specify the armv7 variant for the crossdeps image, even though we are targeting armv6 in the final stage of this dockerfile. That's the idea, but not sure if our infrastructure supports this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mthalman see the build failures without --platform here.

Locally, if I do docker buildx build --platform=linux/arm/v6 . and I leave out --platform=linux/arm/v7 from the base image, I get this:

BUILDKIT_PROGRESS=plain docker buildx build --platform=linux/arm/v6 .
#0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 DONE 0.0s

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 2.71kB done
#1 DONE 0.0s

#2 [internal] load metadata for mcr.microsoft.com/dotnet-buildtools/prereqs:raspbian-12-crossdeps-local
#2 ERROR: mcr.microsoft.com/dotnet-buildtools/prereqs:raspbian-12-crossdeps-local: not found
------
 > [internal] load metadata for mcr.microsoft.com/dotnet-buildtools/prereqs:raspbian-12-crossdeps-local:
------
Dockerfile:3
--------------------
   1 |     ARG ROOTFS_DIR=/crossrootfs
   2 |     
   3 | >>> FROM mcr.microsoft.com/dotnet-buildtools/prereqs:raspbian-12-crossdeps-local as builder
   4 |     
   5 |     ARG ROOTFS_DIR
--------------------
ERROR: failed to solve: mcr.microsoft.com/dotnet-buildtools/prereqs:raspbian-12-crossdeps-local: failed to resolve source metadata for mcr.microsoft.com/dotnet-buildtools/prereqs:raspbian-12-crossdeps-local: mcr.microsoft.com/dotnet-buildtools/prereqs:raspbian-12-crossdeps-local: not found

Which looks similar to the CI failure. If I keep --platform=linux/arm/v7 in the dockerfile, it finds the image (which I built using --platform=linux/arm/v7 and tagged locally).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I get why --platform is needed now. That's fine. I'll leave it to the other reviewers to determine whether consuming a v7 image from a v6 image is the right thing to do.

ARG ROOTFS_DIR=/crossrootfs

Expand All @@ -7,7 +7,7 @@ RUN git config --global user.email builder@dotnet-buildtools-prereqs-docker && \
git clone --depth 1 --single-branch https://github.com/dotnet/arcade /scripts

# Build the rootfs
RUN /scripts/eng/common/cross/build-rootfs.sh armv6 raspbian --skipunmount
RUN /scripts/eng/common/cross/build-rootfs.sh armv6 bookworm --skipunmount

FROM scratch
ARG ROOTFS_DIR=/crossrootfs
Expand Down
25 changes: 20 additions & 5 deletions src/raspbian/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,34 @@
"platforms": [
{
"architecture": "arm",
"dockerfile": "src/raspbian/10/crossdeps/arm32v7",
"dockerfile": "src/raspbian/12/crossdeps/arm32v7",
"os": "linux",
"osVersion": "buster",
"osVersion": "jammy",
akoeplinger marked this conversation as resolved.
Show resolved Hide resolved
"tags": {
"raspbian-10-crossdeps-$(System:TimeStamp)-$(System:DockerfileGitCommitSha)": {},
"raspbian-10-crossdeps$(FloatingTagSuffix)": {},
"raspbian-10-crossdeps-local": {
"raspbian-12-crossdeps-$(System:TimeStamp)-$(System:DockerfileGitCommitSha)": {},
"raspbian-12-crossdeps$(FloatingTagSuffix)": {},
"raspbian-12-crossdeps-local": {
"isLocal": true
}
},
"variant": "v7"
}
]
},
{
"platforms": [
{
"architecture": "arm",
"dockerfile": "src/raspbian/12/helix/arm32v6",
"os": "linux",
"osVersion": "bookworm",
"tags": {
"raspbian-12-helix-arm32v6-$(System:TimeStamp)-$(System:DockerfileGitCommitSha)": {},
"raspbian-12-helix-arm32v6$(FloatingTagSuffix)": {}
},
"variant": "v6"
}
]
}
]
}
Expand Down
Loading