Skip to content

Commit

Permalink
Fix Time64Distro Packaging on GH Actions (#4463)
Browse files Browse the repository at this point in the history
  • Loading branch information
liveans authored Aug 16, 2024
1 parent 48e1019 commit 6a37cdc
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 19 deletions.
9 changes: 9 additions & 0 deletions .azure/OneBranch.Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,15 @@ extends:
- template: .azure/obtemplates/build-linux-packages.yml@self
parameters:
sign: true
kernel: "kernel5_4"
- 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: "kernel6_8"

- stage: package_windows
displayName: Package Windows
Expand Down
8 changes: 8 additions & 0 deletions .azure/OneBranch.PullRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@ extends:
- build_linux
jobs:
- template: .azure/obtemplates/build-linux-packages.yml@self
parameters:
kernel: "kernel5_4"
- 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
23 changes: 10 additions & 13 deletions .azure/obtemplates/build-linux-packages.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
parameters:
sign: false
- name: sign
type: boolean
default: false
- name: kernel
type: string

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 +21,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 +38,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
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
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

0 comments on commit 6a37cdc

Please sign in to comment.