Skip to content

New Linux Distro Version - CBL-Mariner #2837

Closed

Description

@mthalman

New Linux Distro Version

Distro: CBL-Mariner 1.0

ImageBuilder Tasks

  • Ensure that the ImageBuilder supports the new distro version in the code to generate the correct README display name from the version specified in the manifest

Nightly Branch Tasks

    • Copy the Dockerfiles of the most recent version of that distro (or author new ones for an entirely new distro) and place them in a version-specific folder under their respective variants (runtime-deps, runtime, aspnet, sdk). Note: not all variants have a corresponding runtime-deps image.
    • Modify the Dockerfiles as appropriate for any specific changes related to the new distro version
    • Update manifest.json to reference the new set of Dockerfiles with the appropriate tags
      • Move any distro-specific floating tags to the newer version (e.g. 3.1-alpine)
    • Update the test data to include the new distro version
    • Run the command to update the READMEs: .\eng\readme-templates\Get-GeneratedReadmes.ps1
    • Run the command to update the image size baseline file: .\tests\performance\Validate-ImageSize.ps1 -UpdateBaselines
    • Inspect generated changes for correctness
    • Consider whether sample Dockerfiles should be authored if this is a new distro and them to the samples
    • Run the command to build and test your changes: .build-and-test.ps1 -OS <os>
    • Commit generated changes
    • Create PR
    • Get PR signoff
    • Merge PR to nightly branch

Main Branch Tasks

    • After the product teams have signed off on the new distro, merge these changes to the main branch as part of the release process for the next .NET release
    • Create an announcement (example: Alpine 3.10) unless the new distro is added only for pre-release versions in which the announcement would be incorporated in the pre-release notes.

Activity

  1. self-assigned this
    on May 26, 2021
  2. mthalman commented on Jun 7, 2021

    @mthalman
    MemberAuthor

    The approach being used to define these Dockerfiles is to install .NET bits via RPM packages downloaded directly from blob storage. This provides the advantage of being able to target any version of .NET even if it isn't made available from packages.microsoft.com (e.g. preview releases) as well as correctly interacting with the package manager to enable third-party package dependencies (e.g. a third-party dependency on the dotnet-sdk package will show that the dotnet-sdk package is installed in the sdk image).

    However, there is a question around how to best deal with the runtime-deps package. It seems logical to install the runtime-deps package in the runtime-deps image. However, the runtime-deps package is fully versioned with a three-part version number. This complicates matters because we strive to share the runtime-deps Dockerfile as much as possible across .NET versions. For example, there is nothing version-specific in the runtime-deps Dockerfile for 3.1 which gets built and tagged as 3.1, 5,0, and 6.0. This optimizes for layer sharing.

    The options below describe different strategies for defining the runtime-deps Dockerfiles.

    Factors to consider for each of these options:

    • For preview releases which occur out-of-band from servicing releases, we want to avoid needing to rebuild images for those versions which are in the servicing stage of their lifecycle. For example, if a 6.0 preview release is happening and the Dockerfile that 6.0 uses is the same Dockerfile used by 5.0, we'd want to avoid rebuilding that Dockerfile because it would require us to rebuild all of the 5.0 Linux images unnecessarily.
    • EOL scenarios could technically cause a breaking change. For example, consider when 3.1 is EOL. If that package had also existed in a runtime-deps image shared with 5.0 or 6.0 and is removed, that would technically be considered a breaking change.

    Option 1: Runtime-deps image hierarchy

    This option defines a hierarchy amongst the runtime-deps images. The base of the hierarchy would be 3.1, followed by 5.0, and then 6.0. Each Dockerfile would install their respective version of the runtime-deps package. This would look roughly like the following:

    3.1 (pseudo) Dockerfile:

    FROM cblmariner.azurecr.io/base/core:1.0
    RUN rpm --install dotnet-runtime-deps-3.1.16-cm.1-x64.rpm

    5.0 (pseudo) Dockerfile:

    FROM mcr.microsoft.com/dotnet/runtime-deps:3.1-cbl-mariner1.0
    RUN rpm --install dotnet-runtime-deps-5.0.7-cm.1-x64.rpm

    6.0 (pseudo) Dockerfile:

    FROM mcr.microsoft.com/dotnet/runtime-deps:5.0-cbl-mariner1.0
    RUN rpm --install dotnet-runtime-deps-6.0.0-preview.5-cm.1-x64.rpm

    Pros:

    • Maintains layer sharing.
    • Supports preview releases without rebuilding other versions because 6.0 is the leaf node in the hierarchy.

    Cons:

    • EOL scenarios are exposed.

    Option 2: Combine multiple runtime-deps packages into one Dockerfile

    Option 2a: One runtime-deps Dockerfile for all versions

    This defines a single "kitchen sink" Dockerfile to install all the runtime-deps packages:

    (pseudo) Dockerfile:

    FROM cblmariner.azurecr.io/base/core:1.0
    RUN rpm --install dotnet-runtime-deps-3.1.16-cm.1-x64.rpm \
            dotnet-runtime-deps-5.0.7-cm.1-x64.rpm \
            dotnet-runtime-deps-6.0.0-preview.5-cm.1-x64.rpm

    Pros:

    • Maintains layer sharing.

    Cons:

    • Preview releases require that all other versions which share the runtime-deps Dockerfile be rebuilt.
    • EOL scenarios are exposed.

    Option 2b: Split runtime-deps Dockerfiles between servicing and preview

    This option solves the issue from 2a wrt preview releases by defining a separate Dockerfile just for .NET versions that are in preview.

    Servicing (pseudo) Dockerfile:

    FROM cblmariner.azurecr.io/base/core:1.0
    RUN rpm --install dotnet-runtime-deps-3.1.16-cm.1-x64.rpm \
            dotnet-runtime-deps-5.0.7-cm.1-x64.rpm

    Preview (pseudo) Dockerfile:

    FROM cblmariner.azurecr.io/base/core:1.0
    RUN rpm --install dotnet-runtime-deps-6.0.0-preview.5-cm.1-x64.rpm

    Pros:

    • Maintains layer sharing for servicing versions.
    • Supports preview releases without rebuilding other versions because 6.0 has its own Dockerfile.

    Cons:

    • Preview releases require that all other versions which share the runtime-deps Dockerfile be rebuilt.
    • EOL scenarios are exposed in servicing versions.
    • Preview version doesn't benefit from layer sharing.

    Option 3: Don't install runtime-deps package in runtime-deps Dockerfile

    This option defines the runtime-deps Dockerfile without installing the runtime-deps package and only the underlying dependent packages. The runtime-deps package would then get installed by the runtime Dockerfile instead. The installation of the runtime-deps package basically becomes a no-op because the dependent packages are already installed from the base runtime-deps image.

    runtime-deps (pseudo) Dockerfile:

    FROM cblmariner.azurecr.io/base/core:{{OS_VERSION_NUMBER}}
    
    RUN tdnf install -y \
            glibc \
            icu \
            krb5 \
            libgcc \
            libstdc++ \
            openssl-libs \
            zlib

    runtime (pseudo) Dockerfile:

    FROM mcr.microsoft.com/dotnet/runtime-deps:5.0-cbl-mariner1.0
    RUN rpm --install dotnet-runtime-deps-5.0.7-cm.1-x64.rpm

    Pros:

    • Maximizes layer sharing
    • No EOL issues because the runtime-deps packages are all associated with their specific runtime versions.

    Cons:

    • Doesn't take advantage of the semantics around the runtime-deps package.
    • Third-party packages that depend only on runtime-deps package will not see the package as being installed in the runtime-deps image.

    Option 4: Define one runtime-deps Dockerfile per version with no hierarchy

    This option effectively kills layer sharing by defining separate Dockerfiles for each .NET version that are separated from each other.

    3.1 (pseudo) Dockerfile:

    FROM cblmariner.azurecr.io/base/core:1.0
    RUN rpm --install dotnet-runtime-deps-3.1.16-cm.1-x64.rpm

    5.0 (pseudo) Dockerfile:

    FROM cblmariner.azurecr.io/base/core:1.0
    RUN rpm --install dotnet-runtime-deps-5.0.7-cm.1-x64.rpm

    6.0 (pseudo) Dockerfile:

    FROM cblmariner.azurecr.io/base/core:1.0
    RUN rpm --install dotnet-runtime-deps-6.0.0-preview.5-cm.1-x64.rpm

    Pros:

    • No EOL issues because the runtime-deps packages are all associated with their specific runtime-deps versions.
    • Supports preview releases without rebuilding other versions because 6.0 has its own runtime-deps Dockerfile.

    Cons:

    • No layer sharing
  3. richlander commented on Jun 7, 2021

    @richlander
    Member

    We've traditionally had a problem with mixing stable and preview versions on the same package feed. How will that work for Mariner? I'm thinking that there are two assumptions of this plan:

    • We will offer preview container images for Mariner.
    • We will install .NET from the Mariner package feed.

    Thoughts?

  4. mthalman commented on Jun 7, 2021

    @mthalman
    MemberAuthor

    There's not a need to mix stable and preview versions in the package feed. What's available in the package feed has no impact on how the packages are installed in the Dockerfile because the RPMs are being installed directly rather from the package feed. From the first sentence in my previous post:

    The approach being used to define these Dockerfiles is to install .NET bits via RPM packages downloaded directly from blob storage.

  5. mthalman commented on Jun 7, 2021

    @mthalman
    MemberAuthor

    After an internal discussion, the consensus is to use Option 4: Define one runtime-deps Dockerfile per version with no hierarchy. This represents the canonical and recommended pattern for installing such a package dependency. The priority is for our Dockerfiles to represent how we would recommend customers to define their own such Dockerfiles. We shouldn't sacrifice that UX in order to reach the goal of layer sharing.

  6. MichaelSimons commented on Jun 9, 2021

    @MichaelSimons
    Member

    [Triage]

    1. What is the plan/criteria on merging this to master?
    2. What facilities does Mariner have to advertise the list of supported tags?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions