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

Update build containers #60208

Closed
richlander opened this issue Feb 5, 2025 · 20 comments
Closed

Update build containers #60208

richlander opened this issue Feb 5, 2025 · 20 comments
Assignees
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Comments

@richlander
Copy link
Member

richlander commented Feb 5, 2025

The following container references need to be updated in all active branches.

image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.19-WithNode
mariner20CrossArmAlpine:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm-alpine
mariner20CrossArm64Alpine:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-alpine

There are two issues at play:

Related: dotnet/runtime#112191

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Feb 5, 2025
@richlander
Copy link
Member Author

richlander commented Feb 5, 2025

@wtgodbe
Copy link
Member

wtgodbe commented Feb 6, 2025

We don't build native components in those jobs, but the legs using those containers do build node components, so we'd need containers w/ node installed to replace them

@richlander
Copy link
Member Author

richlander commented Feb 6, 2025

Should we create a pre-req container that is the .NET SDK + node + Helix?

Is this for building? It looks like that, but I want to confirm. Also, do you really need a cross image? I assume not.

@wtgodbe
Copy link
Member

wtgodbe commented Feb 6, 2025

Yes, we use the images for building - .NET SDK + node should be sufficient for that. If it was suitable for Helix that'd be nice too as we could use it in multiple places, but wouldn't be necessary for the way we use those containers today.

I don't think we need a cross image - we just need images we can build our musl bits on.

@richlander
Copy link
Member Author

You are right. Helix isn't needed. I was getting my wires crossed.

I assume you install the SDK with the install script per the global.json for the branch. Do you just need an image that has .NET dependencies + node in it?

@wtgodbe
Copy link
Member

wtgodbe commented Feb 6, 2025

I assume you install the SDK with the install script per the global.json for the branch. Do you just need an image that has .NET dependencies + node in it?

Yes, that should be sufficient

@richlander
Copy link
Member Author

I'll make something and let's give it a try.

@richlander
Copy link
Member Author

Do you think we can get away with a single container image? Specifically, do you need an Alpine variant? Is an Azure Linux x64 image sufficient?

@wtgodbe
Copy link
Member

wtgodbe commented Feb 6, 2025

Do you think we can get away with a single container image? Specifically, do you need an Alpine variant? Is an Azure Linux x64 image sufficient?

Having an Alpine variant is nice as that way we can build our musl bits on a musl image - but it's not strictly necessary. I'm fine cross-building if we're trying to slim down our set of docker images.

@richlander
Copy link
Member Author

I'd much prefer we built everything in Azure Linux images, like we do for runtime. Sounds like it is just a change in approach. If it is a big deal, let's take a closer look. I'll make the Azure Linux image later today.

@richlander
Copy link
Member Author

Can you give this a shot @wtgodbe? This is beyond my ability to do efficiently.

Here's the new image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-build-amd64

@wtgodbe
Copy link
Member

wtgodbe commented Feb 7, 2025

#60260

@richlander
Copy link
Member Author

Great. Assuming this works well, I can make .NET 8 and 9 variants of this image so that we can repeat this exercise on the other two active branches. The 10.0 one should work fine, however, it will confuse some people later for no good reason. It is low cost to create the other variants and I'm happy to do that.

@wtgodbe
Copy link
Member

wtgodbe commented Feb 7, 2025

Looks like there was a failure in initializing the container:

##[error]Docker-exec executed: useradd -m -u 1000 cloudtest_azpcontainer; container id: 13c97d350150618711d06a6a7bbae0eec25110dfa57536f2c6e2ce501b3145d8; exit code: 126; command output: OCI runtime exec failed: exec failed: unable to start container process: exec: "useradd": executable file not found in $PATH: unknown

@richlander
Copy link
Member Author

@richlander
Copy link
Member Author

@wtgodbe
Copy link
Member

wtgodbe commented Feb 8, 2025

New error this time:

##[error]Docker-exec executed: su -c "echo '%azure_pipelines_sudo ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers"; container id: 8434a1df9d9be4b93817712f476c60c5f99007ce1a4125e98ae00a937ec1b618; exit code: 126; command output: OCI runtime exec failed: exec failed: unable to start container process: exec: "su": executable file not found in $PATH: unknown

@richlander
Copy link
Member Author

@wtgodbe
Copy link
Member

wtgodbe commented Feb 11, 2025

All PRs are merged!

@wtgodbe wtgodbe closed this as completed Feb 11, 2025
@wtgodbe wtgodbe self-assigned this Feb 11, 2025
@richlander
Copy link
Member Author

Thanks @wtgodbe!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

No branches or pull requests

2 participants