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

Integrate Cross Platform Linux Packaging Tester #4466

Merged
Merged
Show file tree
Hide file tree
Changes from 9 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
8 changes: 8 additions & 0 deletions .azure/OneBranch.Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ extends:
- template: .azure/obtemplates/build-linux-packages.yml@self
parameters:
sign: true
- template: .azure/obtemplates/build-linux-packages.yml@self
parameters:
sign: true
kernel: "kernel5_15"
- template: .azure/obtemplates/build-linux-packages.yml@self
parameters:
sign: true
kernel: "kerne6_8"

- stage: package_windows
displayName: Package Windows
Expand Down
6 changes: 6 additions & 0 deletions .azure/OneBranch.PullRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ extends:
- build_linux
jobs:
- template: .azure/obtemplates/build-linux-packages.yml@self
- template: .azure/obtemplates/build-linux-packages.yml@self
parameters:
kernel: "kernel5_15"
- template: .azure/obtemplates/build-linux-packages.yml@self
parameters:
kernel: "kernel6_8"

- stage: package_windows
displayName: Package Windows
Expand Down
24 changes: 11 additions & 13 deletions .azure/obtemplates/build-linux-packages.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
parameters:
sign: false
- name: sign
type: boolean
default: false
- name: kernel
type: string
default: 'kernel5_4'

jobs:
- job: distribution
- job: distribution_${{ parameters.kernel }} # artifact becomes drop_package_linux_${{ jobname }}
displayName: Distribution
strategy:
matrix:
ubuntu_2004:
kernel: "kernel5_4"
ubuntu_2204:
kernel: "kernel5_15"
ubuntu_2404:
kernel: "kernel6_8"
pool:
type: linux
variables:
ob_outputDirectory: $(Build.SourcesDirectory)/artifacts/dist
ob_artifactSuffix: _$(kernel) # drop_package_linux_${{ jobname }}_${{ kernel }}
steps:
- task: PowerShell@2
displayName: Prepare Build Machine
Expand All @@ -26,12 +22,12 @@ jobs:
arguments: -ForContainerBuild
- task: DownloadPipelineArtifact@2
inputs:
artifact: drop_build_linux_$(kernel)_Debug
artifact: drop_build_linux_${{ parameters.kernel }}_Debug
path: $(Build.SourcesDirectory)/artifacts/bin/linux
pattern: '*.tar'
- task: DownloadPipelineArtifact@2
inputs:
artifact: drop_build_linux_$(kernel)_Release
artifact: drop_build_linux_${{ parameters.kernel }}_Release
path: $(Build.SourcesDirectory)/artifacts/bin/linux
pattern: '*.tar'
- script: | # rebuild artifacts with correct permissions and symlink attributes.
Expand All @@ -43,6 +39,8 @@ jobs:
inputs:
pwsh: false
filePath: scripts/package-distribution.ps1
${{ if eq(parameters.kernel, 'kernel6_8') }}:
arguments: -Time64Distro
- script: | # prepare 2 sets of packages for signing with different keys (gen = general purpose, cbl = cbl-mariner)
mkdir $(Build.SourcesDirectory)/artifacts/dist/gen
find $(Build.SourcesDirectory)/artifacts/dist -type f -exec mv -t $(Build.SourcesDirectory)/artifacts/dist/gen/ {} +
Expand Down
98 changes: 98 additions & 0 deletions .github/workflows/docker-image-package-tester.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Docker Linux Packaging Tester CI
Fixed Show fixed Hide fixed
liveans marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build-packages:
name: Generate Linux Packages
needs: []
strategy:
fail-fast: false
matrix:
vec: [
{ config: "Release", os: "ubuntu-20.04", arch: "arm", tls: "openssl" },
{ config: "Release", os: "ubuntu-20.04", arch: "arm64", tls: "openssl" },
{ config: "Release", os: "ubuntu-20.04", arch: "x64", tls: "openssl" },
{ config: "Release", os: "ubuntu-22.04", arch: "arm", tls: "openssl3" },
{ config: "Release", os: "ubuntu-22.04", arch: "arm64", tls: "openssl3" },
{ config: "Release", os: "ubuntu-22.04", arch: "x64", tls: "openssl3" },
{ config: "Release", os: "ubuntu-24.04", arch: "arm", tls: "openssl3", time64: "-Time64Distro" },
{ config: "Release", os: "ubuntu-24.04", arch: "arm64", tls: "openssl3", time64: "-Time64Distro" },
{ config: "Release", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", time64: "-Time64Distro" },
{ config: "Release", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", xdp: "-UseXdp", time64: "-Time64Distro" },
]
uses: ./.github/workflows/package-reuse-linux.yml
with:
config: ${{ matrix.vec.config }}
os: ${{ matrix.vec.os }}
arch: ${{ matrix.vec.arch }}
tls: ${{ matrix.vec.tls }}
xdp: ${{ matrix.vec.xdp }}

test-packages:
name: Test Linux Packages
needs: [build-packages]
strategy:
fail-fast: false
matrix:
vec: [
# Ubuntu 24.04
{ friendlyName: "Ubuntu 24.04 x64", config: "Release", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", image: "mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-24.04-helix-amd64", xdp: "-UseXdp", dotnetVersion: "9.0" },
{ friendlyName: "Ubuntu 24.04 ARM32", config: "Release", os: "ubuntu-24.04", arch: "arm", tls: "openssl3", image: "mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-24.04-helix-arm32v7", dotnetVersion: "9.0" },
{ friendlyName: "Ubuntu 24.04 ARM64", config: "Release", os: "ubuntu-24.04", arch: "arm64", tls: "openssl3", image: "mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-24.04-helix-arm64v8", dotnetVersion: "9.0" },
# Ubuntu 22.04
{ friendlyName: "Ubuntu 22.04 x64", config: "Release", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", image: "mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-helix-amd64", dotnetVersion: "9.0" },
{ friendlyName: "Ubuntu 22.04 ARM64", config: "Release", os: "ubuntu-22.04", arch: "arm64", tls: "openssl3", image: "mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-helix-arm64v8", dotnetVersion: "9.0" },
# Ubuntu 20.04
{ friendlyName: "Ubuntu 20.04 x64", config: "Release", os: "ubuntu-20.04", arch: "x64", tls: "openssl", image: "mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-helix-amd64", dotnetVersion: "9.0" },
{ friendlyName: "Ubuntu 20.04 ARM64", config: "Release", os: "ubuntu-20.04", arch: "arm64", tls: "openssl", image: "mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-helix-arm64v8", dotnetVersion: "9.0" },
# Debian 12
{ friendlyName: "Debian 12 x64", config: "Release", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", image: "mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-amd64", dotnetVersion: "9.0" },
{ friendlyName: "Debian 12 ARM32", config: "Release", os: "ubuntu-22.04", arch: "arm", tls: "openssl3", image: "mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-arm32v7", dotnetVersion: "9.0" },
{ friendlyName: "Debian 12 ARM64", config: "Release", os: "ubuntu-22.04", arch: "arm64", tls: "openssl3", image: "mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-arm64v8", dotnetVersion: "9.0" },
# CBL-Mariner 2.0
# { config: "Release", os: "ubuntu-24.04", arch: "x64", tls: "openssl", image: "mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-helix-amd64" },
# Azure Linux 3.0
# { config: "Release", os: "ubuntu-24.04", arch: "arm64", tls: "openssl3", image: "mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-helix-arm64v8" },
# { config: "Release", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", image: "mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-helix-amd64", xdp: "-UseXdp" },
# Centos Stream 9
{ friendlyName: "CentOS Stream 9 x64", config: "Release", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", image: "mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9-helix", dotnetVersion: "9.0" },
# Fedora 39 - 40
{ friendlyName: "Fedora 39 x64", config: "Release", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", image: "mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-39", dotnetVersion: "9.0" },
{ friendlyName: "Fedora 40 x64", config: "Release", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", image: "mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-40", dotnetVersion: "9.0" },
# OpenSuse 15.4
{ friendlyName: "OpenSuse 15.4 x64", config: "Release", os: "ubuntu-20.04", arch: "x64", tls: "openssl", image: "mcr.microsoft.com/dotnet-buildtools/prereqs:opensuse-15.4-helix-amd64", dotnetVersion: "9.0" },
# RHEL 8 - 9
# { config: "Release", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", image: "redhat/ubi8-minimal:latest" },
# { config: "Release", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", image: "redhat/ubi9-minimal:latest" },
]
runs-on: ${{ matrix.vec.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Fixed Show fixed Hide fixed
- name: Download Package
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: Package-${{ matrix.vec.config }}-linux-${{ matrix.vec.os }}-${{ matrix.vec.arch }}-${{ matrix.vec.tls }}-UseSystemOpenSSLCrypto${{ matrix.vec.xdp }}
path: artifacts
- name: Download Build Artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: ${{ matrix.vec.config }}-linux-${{ matrix.vec.os }}-${{ matrix.vec.arch }}-${{ matrix.vec.tls }}-UseSystemOpenSSLCrypto${{ matrix.vec.xdp }}
path: artifacts
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Fixed Show fixed Hide fixed
- name: Set up .NET 9.0
uses: actions/setup-dotnet@v4
Fixed Show fixed Hide fixed
with:
dotnet-version: ${{ matrix.vec.dotnetVersion }}
- name: Build .NET QUIC Test Project
run: |
pushd src/cs/QuicSimpleTest && dotnet build -a ${{ matrix.vec.arch }} -c ${{ matrix.vec.config }} -o artifacts/net${{ matrix.vec.dotnetVersion }} -f net${{ matrix.vec.dotnetVersion }} && popd
- name: Docker Run
run: |
docker run -v $(pwd):/main ${{ matrix.vec.image }} /main/scripts/docker-script.sh ${{ matrix.vec.arch }} ${{ matrix.vec.config }} ${{ matrix.vec.tls }} ${{ matrix.vec.dotnetVersion }}
7 changes: 4 additions & 3 deletions .github/workflows/package-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
{ config: "Release", os: "ubuntu-22.04", arch: "arm", tls: "openssl3" },
{ config: "Release", os: "ubuntu-22.04", arch: "arm64", tls: "openssl3" },
{ config: "Release", os: "ubuntu-22.04", arch: "x64", tls: "openssl3" },
{ config: "Release", os: "ubuntu-24.04", arch: "arm", tls: "openssl3" },
{ config: "Release", os: "ubuntu-24.04", arch: "arm64", tls: "openssl3" },
{ config: "Release", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", xdp: "-UseXdp" },
{ config: "Release", os: "ubuntu-24.04", arch: "arm", tls: "openssl3", time64: "-Time64Distro" },
{ config: "Release", os: "ubuntu-24.04", arch: "arm64", tls: "openssl3", time64: "-Time64Distro" },
{ config: "Release", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", xdp: "-UseXdp", time64: "-Time64Distro" },
]
uses: ./.github/workflows/package-reuse-linux.yml
with:
Expand All @@ -44,6 +44,7 @@ jobs:
arch: ${{ matrix.vec.arch }}
tls: ${{ matrix.vec.tls }}
xdp: ${{ matrix.vec.xdp }}
time64: ${{ matrix.vec.time64 }}

test-packages:
name: Test Linux Packages
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/package-reuse-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ on:
required: false
default: ''
type: string
time64:
required: false
default: ''
type: string

permissions: read-all

Expand Down Expand Up @@ -96,7 +100,7 @@ jobs:
find -name "*.tar" -exec tar -xvf '{}' \;
- name: Build Package
shell: pwsh
run: scripts/package-distribution.ps1 -OS ${{ inputs.os }}
run: scripts/package-distribution.ps1 ${{ inputs.time64 }}
- name: Upload build artifacts
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
with:
Expand Down
66 changes: 66 additions & 0 deletions scripts/docker-script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#! /bin/bash
set -e
cd /main
OS=$(echo $(awk -F= '$1=="ID" { print $2 ;}' /etc/os-release) | xargs)
VERSION=$(echo $(awk -F= '$1=="VERSION_ID" { print $2 ;}' /etc/os-release) | xargs)

echo "${OS} ${VERSION} is detected."

install_dependencies_apt()
{
sudo apt-get update
sudo apt-get install --fix-broken
sudo apt-get install -y wget git gzip tar
# Remove the existing libmsquic package and dependencies for Ubuntu
nibanks marked this conversation as resolved.
Show resolved Hide resolved
sudo apt-get remove -y libmsquic libnuma1
if [[ "$OS" == "ubuntu" ]] && [[ "$VERSION" == "24.04" ]]; then
sudo apt-get remove -y libxdp1 libnl-route-3-200
fi
sudo apt-get install -y ./artifacts/libmsquic_*.deb
}

install_dependencies_rpm()
{
sudo yum update -y
sudo yum install -y wget git gzip tar libicu
# Remove the existing libmsquic package and dependencies for Ubuntu
sudo yum remove -y libmsquic numactl-libs
sudo find -name "libmsquic*.rpm" -exec yum localinstall -y {} \;
}

install_dependencies_opensuse()
{
sudo zypper ref
sudo zypper install -y wget git gzip
# Remove the existing libmsquic package and dependencies for Ubuntu
sudo zypper remove -y libmsquic libnuma1
sudo find -name "libmsquic*.rpm" -exec zypper install --allow-unsigned-rpm -y {} \;
}

if [[ "$OS" == "ubuntu" ]] || [[ "$OS" == "debian" ]]; then
install_dependencies_apt
elif [[ "$OS" == "centos" ]] || [[ "$OS" == "almalinux" ]] || [[ "$OS" == "rhel" ]] || [[ "$OS" == "fedora" ]]; then
install_dependencies_rpm
elif [[ "$OS" == 'opensuse-leap' ]]; then
install_dependencies_opensuse
else
echo "Unsupported OS: ${OS}"
exit 1
fi

sudo chmod +x artifacts/bin/linux/${1}_${2}_${3}/msquictest
sudo artifacts/bin/linux/${1}_${2}_${3}/msquictest --gtest_filter=ParameterValidation.ValidateApi
if [ $? -ne 0 ]; then
exit $?
fi

cd /main

sudo wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
sudo chmod +x dotnet-install.sh
sudo ./dotnet-install.sh --channel $4

export DOTNET_ROOT=/root/.dotnet
export PATH=$PATH:/root/.dotnet

sudo /root/.dotnet/dotnet src/cs/QuicSimpleTest/artifacts/net$4/QuicHello.dll
liveans marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 5 additions & 2 deletions scripts/package-distribution.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

#>

param (
[Parameter(Mandatory = $false)]
[switch]$Time64Distro = $false
)

Set-StrictMode -Version 'Latest'
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'

Expand Down Expand Up @@ -116,13 +121,11 @@ foreach ($Build in $AllBuilds) {
}

# if datapath_raw_xdp_kern.o exists under $ArtifactsDir, $UseXdp to be true
$Time64Distro = $false
$UseXdp = $false
if ($Platform -eq "linux") {
$XdpBin = Join-Path $ArtifactsDir "datapath_raw_xdp_kern.o"
if (Test-Path $XdpBin) {
$UseXdp = $true
$Time64Distro = $true
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/cs/QuicSimpleTest/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using System.Net.Quic;

Console.WriteLine($"QuicConnection.IsSupported = {QuicConnection.IsSupported}");
liveans marked this conversation as resolved.
Show resolved Hide resolved
return QuicConnection.IsSupported ? 0 : 1;
11 changes: 11 additions & 0 deletions src/cs/QuicSimpleTest/QuicHello.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<EnablePreviewFeatures>true</EnablePreviewFeatures>
</PropertyGroup>

</Project>
Loading