Skip to content

Commit 118bcd1

Browse files
authored
Publish RPM packages for Azure Linux in the release job (#6774)
1 parent c98505c commit 118bcd1

7 files changed

+165
-66
lines changed

.azure_pipelines_snp.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ resources:
2323
containers:
2424
- container: virtual
2525
image: ghcr.io/microsoft/ccf/ci/default:build-14-01-2025
26-
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro
26+
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE
2727

2828
jobs:
2929
- template: .azure-pipelines-templates/deploy_aci.yml

.github/workflows/ci.yml

+11-18
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ jobs:
3737
- name: virtual
3838
image: default
3939
nodes: [self-hosted, 1ES.Pool=gha-virtual-ccf-sub]
40-
options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro
40+
options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE
4141
- name: snp
4242
image: default
4343
nodes: [self-hosted, 1ES.Pool=gha-virtual-ccf-sub]
44-
options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro
44+
options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE
4545
runs-on: ${{ matrix.platform.nodes }}
4646
container:
4747
image: ghcr.io/microsoft/ccf/ci/${{ matrix.platform.image }}:build-14-01-2025
@@ -107,33 +107,26 @@ jobs:
107107
runs-on: [self-hosted, 1ES.Pool=gha-virtual-ccf-sub]
108108
container:
109109
image: mcr.microsoft.com/azurelinux/base/core:3.0
110-
options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro
110+
options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE
111111

112112
steps:
113-
- name: "Install dependencies"
113+
- name: "Checkout dependencies"
114+
shell: bash
114115
run: |
115-
set -ex
116116
gpg --import /etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY
117117
tdnf -y update
118-
# Source control
119118
tdnf -y install ca-certificates git
120-
# Build tools
121-
tdnf -y install build-essential clang cmake ninja-build which
122-
# libc++
123-
tdnf -y install libcxx-devel llvm-libunwind-devel llvm-libunwind-static
124-
# Dependencies
125-
tdnf -y install openssl-devel libuv-devel nghttp2-devel curl-devel
126-
# Test dependencies
127-
tdnf -y install libarrow-devel parquet-libs-devel lldb npm jq expect
128-
# Install CDDL via rubygems
129-
tdnf -y install rubygems
130-
gem install cddl
131-
shell: bash
132119
133120
- uses: actions/checkout@v4
134121
with:
135122
fetch-depth: 0
136123

124+
- name: "Install dependencies"
125+
shell: bash
126+
run: |
127+
set -ex
128+
./scripts/install-azure-linux-deps.sh
129+
137130
- name: "Build Debug"
138131
run: |
139132
set -ex

.github/workflows/long-test.yml

+9-16
Original file line numberDiff line numberDiff line change
@@ -285,33 +285,26 @@ jobs:
285285
runs-on: [self-hosted, 1ES.Pool=gha-virtual-ccf-sub]
286286
container:
287287
image: mcr.microsoft.com/azurelinux/base/core:3.0
288-
options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro
288+
options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE
289289

290290
steps:
291-
- name: "Install dependencies"
291+
- name: "Checkout dependencies"
292+
shell: bash
292293
run: |
293-
set -ex
294294
gpg --import /etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY
295295
tdnf -y update
296-
# Source control
297296
tdnf -y install ca-certificates git
298-
# Build tools
299-
tdnf -y install build-essential clang cmake ninja-build which
300-
# libc++
301-
tdnf -y install libcxx-devel llvm-libunwind-devel llvm-libunwind-static
302-
# Dependencies
303-
tdnf -y install openssl-devel libuv-devel nghttp2-devel curl-devel
304-
# Test dependencies
305-
tdnf -y install libarrow-devel parquet-libs-devel lldb npm jq expect
306-
# Install CDDL via rubygems
307-
tdnf -y install rubygems
308-
gem install cddl
309-
shell: bash
310297
311298
- uses: actions/checkout@v4
312299
with:
313300
fetch-depth: 0
314301

302+
- name: "Install dependencies"
303+
shell: bash
304+
run: |
305+
set -ex
306+
./scripts/install-azure-linux-deps.sh
307+
315308
- name: "Build Debug (Long Test)"
316309
run: |
317310
set -ex

.github/workflows/release.yml

+87-25
Original file line numberDiff line numberDiff line change
@@ -62,47 +62,75 @@ jobs:
6262
path: rel-notes.md
6363

6464
build_release:
65-
needs: release_notes
6665
name: Build Release
66+
needs: release_notes
6767
strategy:
6868
matrix:
6969
platform:
7070
- name: virtual
71-
image: default
72-
nodes: [self-hosted, 1ES.Pool=gha-virtual-ccf-sub]
71+
os: ubuntu
72+
image: ghcr.io/microsoft/ccf/ci/default:build-14-01-2025
73+
test_filter: "benchmark|unit"
74+
- name: snp
75+
os: ubuntu
76+
image: ghcr.io/microsoft/ccf/ci/default:build-14-01-2025
77+
- name: virtual
78+
os: azure-linux
79+
image: mcr.microsoft.com/azurelinux/base/core:3.0
80+
test_filter: "benchmark|unit|protocolstest|lts"
7381
- name: snp
74-
image: default
75-
nodes: [self-hosted, 1ES.Pool=gha-virtual-ccf-sub]
76-
runs-on: ${{ matrix.platform.nodes }}
82+
os: azure-linux
83+
image: mcr.microsoft.com/azurelinux/base/core:3.0
84+
85+
runs-on: [self-hosted, 1ES.Pool=gha-virtual-ccf-sub]
7786
container:
78-
image: ghcr.io/microsoft/ccf/ci/${{ matrix.platform.image }}:build-14-01-2025
79-
options: "--user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro ${{ matrix.platform.container_options }}"
87+
image: ${{ matrix.platform.image }}
88+
options: "--user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE"
89+
8090
steps:
91+
- name: "Checkout dependencies"
92+
if: ${{ matrix.platform.os == 'azure-linux' }}
93+
shell: bash
94+
run: |
95+
gpg --import /etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY
96+
tdnf -y update
97+
tdnf -y install ca-certificates git
98+
8199
- uses: actions/checkout@v4
82100
with:
83101
fetch-depth: 0
84102

103+
- name: "Install dependencies"
104+
if: ${{ matrix.platform.os == 'azure-linux' }}
105+
shell: bash
106+
run: |
107+
set -ex
108+
./scripts/install-azure-linux-deps.sh
109+
# For packaging and release tests
110+
tdnf -y install rpm-build
111+
85112
- name: "Build Release ${{ matrix.platform.name }}"
113+
shell: bash
86114
run: |
87115
set -ex
88116
git config --global --add safe.directory /__w/CCF/CCF
89117
mkdir build
90118
cd build
91-
cmake -GNinja -DCOMPILE_TARGET=${{ matrix.platform.name }} ${{ matrix.platform.cmake_options }} -DCLIENT_PROTOCOLS_TEST=ON ..
119+
CC=`which clang` CXX=`which clang++` cmake -GNinja -DCOMPILE_TARGET=${{ matrix.platform.name }} -DCLIENT_PROTOCOLS_TEST=ON -DCMAKE_BUILD_TYPE=Release ..
92120
ninja -v | tee build.log
93-
shell: bash
94121
95122
- name: "Install Extended Testing Tools"
123+
if: ${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}
96124
run: |
97125
set -ex
98126
sudo apt-get -y update
99127
sudo apt install ansible -y
100128
cd getting_started/setup_vm
101129
ansible-playbook ccf-extended-testing.yml
102130
shell: bash
103-
if: ${{ matrix.platform.name != 'snp' }}
104131

105132
- name: "Test ${{ matrix.platform.name }}"
133+
if: "${{ matrix.platform.name == 'virtual' }}"
106134
run: |
107135
set -ex
108136
cd build
@@ -114,23 +142,23 @@ jobs:
114142
# Suite tests
115143
./tests.sh --timeout 600 --output-on-failure -L "suite"
116144
# Most tests
117-
./tests.sh --timeout 360 --output-on-failure -LE "benchmark|unit|suite"
145+
./tests.sh --timeout 360 --output-on-failure -LE "suite|${{ matrix.platform.test_filter }}"
118146
shell: bash
119-
if: "${{ matrix.platform.name != 'snp' }}"
120147

121-
- name: "Upload logs for ${{ matrix.platform.name }}"
148+
- name: "Upload logs for ${{ matrix.platform.os }}-${{ matrix.platform.name }}"
149+
if: success() || failure()
122150
uses: actions/upload-artifact@v4
123151
with:
124-
name: logs-${{ matrix.platform.name }}
152+
name: logs-${{ matrix.platform.os }}-${{ matrix.platform.name }}
125153
path: |
126154
build/workspace/*/*.config.json
127155
build/workspace/*/out
128156
build/workspace/*/err
129157
build/workspace/*.ledger/*
130158
if-no-files-found: ignore
131-
if: success() || failure()
132159

133160
- name: "Make .deb Package"
161+
if: "${{ matrix.platform.os == 'ubuntu' }}"
134162
id: make_deb
135163
run: |
136164
set -ex
@@ -146,30 +174,56 @@ jobs:
146174
echo "name=$CCF_GITHUB_PKG" >> $GITHUB_OUTPUT
147175
shell: bash
148176

177+
- name: "Make .rpm Package"
178+
if: "${{ matrix.platform.os == 'azure-linux' }}"
179+
id: make_rpm
180+
run: |
181+
set -ex
182+
set -o pipefail
183+
cd build
184+
cmake -L .. 2>/dev/null | grep CMAKE_INSTALL_PREFIX: | cut -d = -f 2 > /tmp/install_prefix
185+
cpack -V -G RPM
186+
INITIAL_PKG=`ls *.rpm`
187+
CCF_GITHUB_PKG=${INITIAL_PKG//\~/_}
188+
if [[ "$INITIAL_PKG" != "$CCF_GITHUB_PKG" ]]; then
189+
mv $INITIAL_PKG $CCF_GITHUB_PKG
190+
fi
191+
echo "name=$CCF_GITHUB_PKG" >> $GITHUB_OUTPUT
192+
shell: bash
193+
149194
- name: "Install CCF Debian package"
195+
if: "${{ matrix.platform.os == 'ubuntu' }}"
150196
run: |
151197
set -ex
152198
cd build
153199
sudo apt -y install ./${{ steps.make_deb.outputs.name }}
154200
shell: bash
155201

202+
- name: "Install CCF RPM package"
203+
if: "${{ matrix.platform.os == 'azure-linux' }}"
204+
run: |
205+
set -ex
206+
cd build
207+
tdnf -y install ./${{ steps.make_rpm.outputs.name }}
208+
shell: bash
209+
156210
- name: "Test Installed CCF"
211+
if: "${{ matrix.platform.name == 'virtual' }}"
157212
run: |
158213
set -ex
159214
set -o pipefail
160215
cd build
161216
cat /tmp/install_prefix | xargs -i bash -c "PYTHON_PACKAGE_PATH=../python ./test_install.sh {}"
162217
shell: bash
163-
if: "${{ matrix.platform.name != 'snp' }}"
164218

165219
- name: "Recovery Benchmark for Installed CCF"
220+
if: "${{ matrix.platform.name == 'virtual' }}"
166221
run: |
167222
set -ex
168223
set -o pipefail
169224
cd build
170225
cat /tmp/install_prefix | xargs -i bash -c "PYTHON_PACKAGE_PATH=../python ./recovery_benchmark.sh {}"
171226
shell: bash
172-
if: "${{ matrix.platform.name != 'snp' }}"
173227

174228
- name: "Test Building a Sample Against Installed CCF"
175229
run: |
@@ -178,26 +232,35 @@ jobs:
178232
shell: bash
179233

180234
- name: "Upload .deb Package"
235+
if: "${{ matrix.platform.os == 'ubuntu' }}"
181236
uses: actions/upload-artifact@v4
182237
with:
183-
name: pkg-${{ matrix.platform.name }}
238+
name: pkg-${{ matrix.platform.os }}-${{ matrix.platform.name }}
184239
path: build/${{ steps.make_deb.outputs.name }}
185240

241+
- name: "Upload .rpm Package"
242+
if: "${{ matrix.platform.os == 'azure-linux' }}"
243+
uses: actions/upload-artifact@v4
244+
with:
245+
name: pkg-${{ matrix.platform.os }}-${{ matrix.platform.name }}
246+
path: build/${{ steps.make_rpm.outputs.name }}
247+
186248
- name: "Upload Compatibility Report"
249+
if: "${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
187250
uses: actions/upload-artifact@v4
188251
with:
189252
name: compatibility
190253
path: build/compatibility_report.json
191-
if: "${{ matrix.platform.name == 'virtual' }}"
192254

193255
- name: "Upload TLS Report"
256+
if: "${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
194257
uses: actions/upload-artifact@v4
195258
with:
196259
name: tls
197260
path: build/tls_report.html
198-
if: "${{ matrix.platform.name == 'virtual' }}"
199261

200262
- name: "Build Python Wheel"
263+
if: "${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
201264
id: build_wheel
202265
run: |
203266
set -ex
@@ -209,16 +272,16 @@ jobs:
209272
WHL=`ls dist/*.whl`
210273
echo "name=$WHL" >> $GITHUB_OUTPUT
211274
shell: bash
212-
if: "${{ matrix.platform.name == 'virtual' }}"
213275

214276
- name: "Upload Python Wheel"
277+
if: "${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
215278
uses: actions/upload-artifact@v4
216279
with:
217280
name: wheel
218281
path: python/${{ steps.build_wheel.outputs.name }}
219-
if: "${{ matrix.platform.name == 'virtual' }}"
220282

221283
- name: "Build TS Package"
284+
if: "${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
222285
id: build_tstgz
223286
run: |
224287
set -ex
@@ -231,14 +294,13 @@ jobs:
231294
PKG=`ls *.tgz`
232295
echo "name=$PKG" >> $GITHUB_OUTPUT
233296
shell: bash
234-
if: "${{ matrix.platform.name == 'virtual' }}"
235297

236298
- name: "Upload TS Package"
299+
if: "${{ matrix.platform.os == 'ubuntu' && matrix.platform.name == 'virtual' }}"
237300
uses: actions/upload-artifact@v4
238301
with:
239302
name: tstgz
240303
path: js/ccf-app/${{ steps.build_tstgz.outputs.name }}
241-
if: "${{ matrix.platform.name == 'virtual' }}"
242304

243305
create_release:
244306
needs:

cmake/cpack_settings.cmake

+26
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ set(CPACK_RESOURCE_FILE_LICENSE "${CCF_DIR}/LICENSE")
88
set(CPACK_PACKAGE_VERSION ${CCF_RELEASE_VERSION})
99
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
1010

11+
# DEB-specific settings
12+
1113
set(CPACK_DEBIAN_PACKAGE_VERSION "${CCF_RELEASE_VERSION}")
1214

1315
if(CCF_VERSION_SUFFIX)
@@ -32,6 +34,30 @@ endif()
3234

3335
list(JOIN CCF_DEB_DEPENDENCIES ", " CPACK_DEBIAN_PACKAGE_DEPENDS)
3436

37+
message(STATUS "DEB package dependencies: ${CCF_DEB_DEPENDENCIES}")
38+
3539
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
3640

41+
# RPM-specific settings
42+
43+
set(CPACK_RPM_PACKAGE_VERSION "${CCF_RELEASE_VERSION}")
44+
45+
if(CCF_VERSION_SUFFIX)
46+
set(CPACK_RPM_PACKAGE_VERSION
47+
"${CPACK_RPM_PACKAGE_VERSION}~${CCF_VERSION_SUFFIX}"
48+
)
49+
endif()
50+
51+
message(STATUS "RPM package version: ${CPACK_RPM_PACKAGE_VERSION}")
52+
53+
set(CCF_RPM_DEPENDENCIES
54+
"libuv >= 1.34.2, openssl >= 3.3.0, nghttp2 >= 1.40.0, curl >= 7.68.0, libcxxabi >= 18.1.2"
55+
)
56+
57+
message(STATUS "RPM package dependencies: ${CCF_RPM_DEPENDENCIES}")
58+
59+
set(CPACK_RPM_PACKAGE_REQUIRES "${CCF_RPM_DEPENDENCIES}")
60+
61+
set(CPACK_RPM_FILE_NAME RPM-DEFAULT)
62+
3763
include(CPack)

0 commit comments

Comments
 (0)