Skip to content

Commit 4219e57

Browse files
Revisit CCF packaging (#7187)
Co-authored-by: Amaury Chamayou <[email protected]>
1 parent f9ee46c commit 4219e57

File tree

19 files changed

+331
-261
lines changed

19 files changed

+331
-261
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ jobs:
8282
shell: bash
8383

8484
ensure-snmalloc:
85-
if: ${{ contains(github.event.pull_request.labels.*.name, 'run-long-test') || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'}}
8685
name: "Ensure using snmalloc"
8786
runs-on: [self-hosted, 1ES.Pool=gha-virtual-ccf-sub]
8887
container:

.github/workflows/release.yml

Lines changed: 50 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -151,34 +151,18 @@ jobs:
151151

152152
- name: "Make .rpm (devel) Package"
153153
id: make_rpm_devel
154-
run: |
155-
set -ex
156-
set -o pipefail
157-
cd build
158-
cmake -L .. 2>/dev/null | grep CMAKE_INSTALL_PREFIX: | cut -d = -f 2 > /tmp/install_prefix
159-
cpack -V -G RPM
160-
INITIAL_PKG=`ls *devel*.rpm`
161-
CCF_GITHUB_PKG=${INITIAL_PKG//\~/_}
162-
if [[ "$INITIAL_PKG" != "$CCF_GITHUB_PKG" ]]; then
163-
mv $INITIAL_PKG $CCF_GITHUB_PKG
164-
fi
165-
echo "name=$CCF_GITHUB_PKG" >> $GITHUB_OUTPUT
166-
shell: bash
167-
168-
- name: "Make .rpm (run) Package"
169-
id: make_rpm_run
170154
run: |
171155
set -ex
172156
set -o pipefail
173157
cd build
174158
175159
# Reset cmake config to affect cpack settings
176160
rm CMakeCache.txt
177-
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCCF_DEVEL=OFF ..
161+
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPACKAGING=ON ..
178162
179163
cmake -L .. 2>/dev/null | grep CMAKE_INSTALL_PREFIX: | cut -d = -f 2 > /tmp/install_prefix
180164
cpack -V -G RPM
181-
INITIAL_PKG=`ls *.rpm | grep -v devel`
165+
INITIAL_PKG=`ls *devel*.rpm`
182166
CCF_GITHUB_PKG=${INITIAL_PKG//\~/_}
183167
if [[ "$INITIAL_PKG" != "$CCF_GITHUB_PKG" ]]; then
184168
mv $INITIAL_PKG $CCF_GITHUB_PKG
@@ -221,12 +205,6 @@ jobs:
221205
name: pkg
222206
path: build/${{ steps.make_rpm_run.outputs.name }}
223207

224-
- name: "Upload -devel.rpm Package"
225-
uses: actions/upload-artifact@v4
226-
with:
227-
name: pkg-devel
228-
path: build/${{ steps.make_rpm_devel.outputs.name }}
229-
230208
- name: "Upload Compatibility Report"
231209
uses: actions/upload-artifact@v4
232210
with:
@@ -302,6 +280,49 @@ jobs:
302280
name: reproduce-metadata
303281
path: reproduce.json
304282

283+
test_rpm_against_app:
284+
name: "Test building against CCF package"
285+
needs: build_release
286+
runs-on: [self-hosted, 1ES.Pool=gha-vmss-d16av5-ci]
287+
container:
288+
image: mcr.microsoft.com/azurelinux/base/core:3.0
289+
options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE
290+
291+
steps:
292+
- name: "Checkout dependencies"
293+
shell: bash
294+
run: |
295+
set -ex
296+
gpg --import /etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY
297+
tdnf -y update
298+
tdnf -y install ca-certificates git
299+
300+
- uses: actions/checkout@v5
301+
with:
302+
fetch-depth: 0
303+
304+
- name: Download RPM
305+
uses: actions/download-artifact@v5
306+
with:
307+
path: DOWNLOAD_DIR
308+
pattern: pkg
309+
merge-multiple: true
310+
311+
- name: Test against RPM
312+
shell: bash
313+
run: |
314+
set -ex
315+
PKG=`ls DOWNLOAD_DIR/*.rpm`
316+
tdnf -y install $PKG
317+
cd tests/ccfapp
318+
mkdir -p build
319+
cd build
320+
CC=clang CXX=clang++ cmake -GNinja -DCMAKE_BUILD_TYPE=Release ..
321+
ninja -v
322+
./ccfapp > out.txt
323+
grep "I'm a CCF test app" out.txt
324+
/opt/ccf/bin/ensure-snmalloc.sh ccfapp
325+
305326
reproduce_rpm:
306327
name: Test Reproducibility
307328
needs:
@@ -328,7 +349,7 @@ jobs:
328349
uses: actions/download-artifact@v5
329350
with:
330351
path: DOWNLOAD_DIR
331-
pattern: pkg*
352+
pattern: pkg
332353
merge-multiple: true
333354
- name: Download Reproducibility Metadata
334355
uses: actions/download-artifact@v5
@@ -344,8 +365,8 @@ jobs:
344365
tdnf install --snapshottime=${{ needs.build_release.outputs.SOURCE_DATE_EPOCH }} -y jq
345366
git config --global --add safe.directory /__w/CCF/CCF
346367
./reproduce/reproduce_rpm.sh repro/reproduce.json
347-
RPM_NAMES=$(ls "$REPRO_DIR" || true)
348-
if [ -z "$RPM_NAMES" ]; then
368+
RPM_NAME=$(ls "$REPRO_DIR" || true)
369+
if [ -z "$RPM_NAME" ]; then
349370
echo "ERROR: No reproduced package found in $REPRO_DIR"
350371
exit 1
351372
fi
@@ -354,9 +375,8 @@ jobs:
354375
shell: bash
355376
run: |
356377
set -ex
357-
for pkg in "$REPRO_DIR"/*; do
358-
cmp "$pkg" "DOWNLOAD_DIR/$(basename "$pkg")"
359-
done
378+
PKG=`ls "$REPRO_DIR"/*.rpm`
379+
cmp "$PKG" "DOWNLOAD_DIR/$(basename "$PKG")"
360380
- name: Upload Non-Reproduced Package
361381
if: failure()
362382
uses: actions/upload-artifact@v4

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2424
- Application logging no longer traverses the ringbuffer. As current target platforms do not require distinct enclave and host components, what was previously "in-enclave" logging that was deferred via the ringbuffer can now be immediately sent to stdout.
2525
- CA certificates issued by CCF (ie - `service_cert.pem`) now include a `keyUsage` extension, to comply with RFC5280 (#7134).
2626

27+
### Removed
28+
29+
- CCF no longer publishes a "run" package (cchost + runtime dependencies). Instead, only the -devel package is published, which has to be used by CCF application developers. CCF also provides ccfapp CPack settings to pull in all CCF runtime dependencies. Check [Packaging your C++ app](https://microsoft.github.io/CCF/main/build_apps/get_started.html#packaging-your-c-app) for documentation (#7187).
30+
2731
### Dependencies
2832

2933
- Updated snmalloc to 0.7.1.

0 commit comments

Comments
 (0)