Skip to content

Commit 02fcda1

Browse files
committed
CI: add archive support
Experience is showing using self tested runners works great but collection of results has many hiccups for a few reasons: - semantics for dynamcic results are hard to manage in runners, I suspect this will also get complex if we try to support other runner like gitlab but the hoops we have to jump to get this right in github is silly - permissions on files: we have console files and things which may be owned by root. Despite best effort to ensure these have correct permissions if any of these do have incorrect permissions we loose all the artifacts and loose all the tests To scale this and grow, it seems the lesson learned is the less a runner has to do the better, specially with how dynamic kdevops is with dynamic results and so forth. So just add an ansible role dedicated to dealing with all this. This let's us do the results tarball generation with just: make ci-archive This has other added benefits: 1) This just begged to leverage our existing kdevops-results-archive [0] which also pushed us to adopt git LFS, saving 99.24% of space with it. 2) We can detach ourselves from relying on github artifacts, so now we can just point people to public git tarballs 3) This supports proprietary kernel archive databases. On purpose I've designed this new kdevops results archive ansible role to deal with future variability and so you could easily expand on all this to refer to your own internal repo for kernel testing and results. 4) Security best pratices: this requires an ssh key with a passphrase set, this does all the checks for us 5) We get to test this, so we can easily rule out issues we can easily just test using the demo repo, specifically designed to let you play with all this as you get ramped up with your CI. To play with the CI archive demo just use: make ci-archive DEMO=1 While at it modify our CI for github to use this which shows all the crap we can remove, this is all the changes in the github actions .github/workflows/fstests.yml. [0] https://github.com/linux-kdevops/kdevops-results-archive [1] https://github.com/linux-kdevops/kdevops-results-archive-demo Signed-off-by: Luis Chamberlain <[email protected]>
1 parent 38746a0 commit 02fcda1

File tree

8 files changed

+520
-11
lines changed

8 files changed

+520
-11
lines changed

.github/workflows/fstests.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,31 @@ jobs:
4545
run: |
4646
make fstests-baseline TESTS=generic/003
4747
48-
- name: Get the defined CI test results for this repository
48+
- name: Get systemd journal files
4949
if: always() # This ensures the step runs even if previous steps failed
5050
run: |
5151
cd kdevops
5252
make journal-dump
53-
make ci-results > results.txt
54-
sed -i 's|^|kdevops/|' results.txt
55-
cat results.txt
5653
57-
- name: Read results.txt and set environment variable
54+
- name: Build our kdevops archive results
5855
if: always() # This ensures the step runs even if previous steps failed
5956
run: |
60-
FILE_PATHS=$(cat kdevops/results.txt | tr '\n' '\n')
61-
echo "FILE_PATHS<<EOF" >> $GITHUB_ENV
62-
echo "$FILE_PATHS" >> $GITHUB_ENV
63-
echo "EOF" >> $GITHUB_ENV
57+
cd kdevops
58+
make ci-archive
59+
60+
- name: Find and kdevops results zip file
61+
if: always() # This ensures the step runs even if previous steps failed
62+
run: |
63+
ZIP_FILE=$(find kdevops/archive -name "*.zip" -type f | head -n 1)
64+
echo "Found zip file: $ZIP_FILE"
65+
echo "KDEVOPS_ARTIFACT_PATH=$ZIP_FILE" >> $GITHUB_ENV
6466
65-
- name: Upload files listed in results.txt as artifacts
67+
- name: Upload our kdevops results archive
6668
if: always() # This ensures the step runs even if previous steps failed
6769
uses: actions/upload-artifact@v4
6870
with:
6971
name: kdevops-ci-results
70-
path: ${{ env.FILE_PATHS }}
72+
path: ${{ env.KDEVOPS_ARTIFACT_PATH }}
7173

7274
# Ensure make destroy always runs, even on failure
7375
- name: Run kdevops make destroy

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,5 @@ workflows/linux/refs/user
9393
scripts/kconfig/.nconf-cfg
9494
.dynamic-kconfig.*
9595
vagrant/Kconfig.passthrough_libvirt.generated
96+
97+
archive/

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ DEFAULT_DEPS += $(LOCALHOST_SETUP_WORK)
236236

237237
include scripts/tests.Makefile
238238
include scripts/ci.Makefile
239+
include scripts/archive.Makefile
239240

240241
PHONY += clean
241242
clean:

kconfigs/workflows/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,27 @@ config KDEVOPS_WORKFLOW_DEDICATE_SYSBENCH
184184

185185
endchoice
186186

187+
config KDEVOPS_WORKFLOW_NAME
188+
string
189+
output yaml
190+
default "fstests" if KDEVOPS_WORKFLOW_DEDICATE_FSTESTS
191+
default "blktests" if KDEVOPS_WORKFLOW_DEDICATE_BLKTESTS
192+
default "pynfs" if KDEVOPS_WORKFLOW_DEDICATE_PYNFS
193+
default "selftests" if KDEVOPS_WORKFLOW_DEDICATE_SELFTESTS
194+
default "gitr" if KDEVOPS_WORKFLOW_DEDICATE_GITR
195+
default "ltp" if KDEVOPS_WORKFLOW_DEDICATE_LTP
196+
default "nfstest" if KDEVOPS_WORKFLOW_DEDICATE_NFSTEST
197+
default "sysbench" if KDEVOPS_WORKFLOW_DEDICATE_SYSBENCH
198+
187199
endif
188200

189201
if !WORKFLOWS_DEDICATED_WORKFLOW
190202

203+
config KDEVOPS_WORKFLOW_NAME
204+
string
205+
output yaml
206+
default "mix"
207+
191208
config KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_FSTESTS
192209
bool "fstests"
193210
select KDEVOPS_WORKFLOW_ENABLE_FSTESTS

playbooks/kdevops_archive.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
- hosts: localhost
3+
roles:
4+
- role: kdevops_archive
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
kdevops_archive_data_count: 0
3+
kdevops_results: "{{ topdir_path }}/archive"
4+
kdevops_results_local: "{{ kdevops_results }}/{{ target_linux_ref }}/"
5+
kdevops_results_repo_url_user: "git"
6+
kdevops_results_repo_url: "{{ kdevops_results_repo_url_user}}@github.com:linux-kdevops/kdevops-results-archive.git"
7+
kdevops_results_repo_url_demo: "{{ kdevops_results_repo_url_user}}@github.com:linux-kdevops/kdevops-results-archive-demo.git"
8+
kdevops_results_repo_path: "{{ kdevops_results_repo_url.split('@')[1] }}"
9+
kdevops_results_name: "{{ kdevops_results_repo_path.split('/')[-1] | regex_replace('\\.git$', '') }}"
10+
kdevops_results_archive_dir: "{{ topdir_path }}/../{{ kdevops_results_name }}"
11+
kdevops_archive_mirror_present: false
12+
kdevops_archive_host: "{{ kdevops_results_repo_path.split(':')[0] }}"
13+
kdevops_archive: "/mirror/{{ kdevops_results_name }}.git"
14+
kdevops_archive_key_loaded: False
15+
kdevops_archive_key_name: "kdevops_archive"
16+
kdevops_archive_identity_file: "/home/gh/.ssh/{{ kdevops_archive }}"
17+
kdevops_archive_key_detected: False
18+
kdevops_archive_key_fingerprint: ""
19+
kdevops_archive_key_has_passphrase: False
20+
kdevops_archive_demo: False
21+
bootlinux_tree_set_by_cli: False
22+
kdevops_archive_base: "selftests/gh/linux-modules-kpd/20241021"
23+
kdevops_archive_test_number: "0001"
24+
kdevops_archive_prefix: "{{ kdevops_archive_base }}/{{ kdevops_archive_next_number }}/v6.12-rc4/"

0 commit comments

Comments
 (0)