[isar-cip-core v3 2/2] .reproducible-check-ci.yml: Add ci for reproducible build checks


Venkata Pyla
 

From: venkata pyla <venkata.pyla@...>

The reproducible check is added only for scheduled CI's in order to reduce
burden on regular commit pushes and monitor only reproducible checks on
specified intervals like bi-weekly or monthly.

Signed-off-by: venkata pyla <venkata.pyla@...>
---
.gitlab-ci.yml | 5 +++
.reproducible-check-ci.yml | 91 ++++++++++++++++++++++++++++++++++++++
2 files changed, 96 insertions(+)
create mode 100644 .reproducible-check-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f7c8c88..3642661 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,6 +13,7 @@ variables:

stages:
- build
+ - test

default:
before_script:
@@ -26,6 +27,8 @@ default:

.build_base:
stage: build
+ except:
+ - schedules
tags:
- large
variables:
@@ -281,3 +284,5 @@ build:qemu-amd64-secure-boot-buster:
use_rt: disable
wic_targz: disable
deploy: disable
+
+include: '.reproducible-check-ci.yml'
diff --git a/.reproducible-check-ci.yml b/.reproducible-check-ci.yml
new file mode 100644
index 0000000..a50d683
--- /dev/null
+++ b/.reproducible-check-ci.yml
@@ -0,0 +1,91 @@
+# extension to gitlab-ci for reproducible checks
+
+.repro-build:
+ variables:
+ use_rt: disable
+ wic_targz: disable
+ targz: enable
+ deploy: disable
+ deploy_kernelci: disable
+ artifact_suffix: ".tar.gz"
+ base_yaml: "kas-cip.yml:kas/board/${target}.yml"
+ stage: build
+ tags:
+ - large
+ only:
+ - schedules
+ script:
+ - if [ -f kas/opt/reproducible.yml ]; then base_yaml="${base_yaml}:kas/opt/reproducible.yml"; fi
+ # Build 1st time
+ - !reference [.build_base, script]
+ - mv build/tmp/deploy/images/${target}/cip-core-image-cip-core-${release}-${target}${artifact_suffix} image1
+ # clean
+ - sudo rm -rf build/tmp
+ - sudo rm -rf build/sstate-cache
+ # Build 2nd time
+ - !reference [.build_base, script]
+ - mv build/tmp/deploy/images/${target}/cip-core-image-cip-core-${release}-${target}${artifact_suffix} image2
+ artifacts:
+ expire_in: 1 day
+ paths:
+ - image1
+ - image2
+
+.repro-test:
+ image:
+ name: debian:bullseye
+ tags:
+ - large
+ stage: test
+ only:
+ - schedules
+ variables:
+ GIT_STRATEGY: none
+ before_script:
+ - apt update && DEBIAN_FRONTEND=noninteractive apt install -y diffoscope
+ script:
+ - diffoscope --text diffoscope_output.txt image1 image2
+ artifacts:
+ when: always
+ expire_in: 1 day
+ paths:
+ - diffoscope_output.txt
+
+
+# repro build
+build:qemu-amd64-base-repro-build:
+ extends:
+ - .repro-build
+ variables:
+ target: qemu-amd64
+
+build:qemu-arm64-base-repro-build:
+ extends:
+ - .repro-build
+ variables:
+ target: qemu-arm64
+
+build:qemu-arm-base-repro-build:
+ extends:
+ - .repro-build
+ variables:
+ target: qemu-arm
+
+# repro build test
+test:qemu-amd64-base-repro-test:
+ extends:
+ - .repro-test
+ dependencies:
+ - build:qemu-amd64-base-repro-build
+
+test:qemu-arm64-base-repro-test:
+ extends:
+ - .repro-test
+ dependencies:
+ - build:qemu-arm64-base-repro-build
+
+test:qemu-arm-base-repro-test:
+ extends:
+ - .repro-test
+ dependencies:
+ - build:qemu-arm-base-repro-build
--
2.20.1


Jan Kiszka
 

On 22.02.23 12:44, venkata.pyla@... wrote:
From: venkata pyla <venkata.pyla@...>

The reproducible check is added only for scheduled CI's in order to reduce
burden on regular commit pushes and monitor only reproducible checks on
specified intervals like bi-weekly or monthly.

Signed-off-by: venkata pyla <venkata.pyla@...>
---
.gitlab-ci.yml | 5 +++
.reproducible-check-ci.yml | 91 ++++++++++++++++++++++++++++++++++++++
2 files changed, 96 insertions(+)
create mode 100644 .reproducible-check-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f7c8c88..3642661 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,6 +13,7 @@ variables:

stages:
- build
+ - test

default:
before_script:
@@ -26,6 +27,8 @@ default:

.build_base:
stage: build
+ except:
+ - schedules
tags:
- large
variables:
@@ -281,3 +284,5 @@ build:qemu-amd64-secure-boot-buster:
use_rt: disable
wic_targz: disable
deploy: disable
+
+include: '.reproducible-check-ci.yml'
diff --git a/.reproducible-check-ci.yml b/.reproducible-check-ci.yml
new file mode 100644
index 0000000..a50d683
--- /dev/null
+++ b/.reproducible-check-ci.yml
@@ -0,0 +1,91 @@
Missing copyright header - yes, also in .gitlab-ci.yml. I'm picking the
one from kas/opt/reproducible.yml for this file.

Jan

+# extension to gitlab-ci for reproducible checks
+
+.repro-build:
+ variables:
+ use_rt: disable
+ wic_targz: disable
+ targz: enable
+ deploy: disable
+ deploy_kernelci: disable
+ artifact_suffix: ".tar.gz"
+ base_yaml: "kas-cip.yml:kas/board/${target}.yml"
+ stage: build
+ tags:
+ - large
+ only:
+ - schedules
+ script:
+ - if [ -f kas/opt/reproducible.yml ]; then base_yaml="${base_yaml}:kas/opt/reproducible.yml"; fi
+ # Build 1st time
+ - !reference [.build_base, script]
+ - mv build/tmp/deploy/images/${target}/cip-core-image-cip-core-${release}-${target}${artifact_suffix} image1
+ # clean
+ - sudo rm -rf build/tmp
+ - sudo rm -rf build/sstate-cache
+ # Build 2nd time
+ - !reference [.build_base, script]
+ - mv build/tmp/deploy/images/${target}/cip-core-image-cip-core-${release}-${target}${artifact_suffix} image2
+ artifacts:
+ expire_in: 1 day
+ paths:
+ - image1
+ - image2
+
+.repro-test:
+ image:
+ name: debian:bullseye
+ tags:
+ - large
+ stage: test
+ only:
+ - schedules
+ variables:
+ GIT_STRATEGY: none
+ before_script:
+ - apt update && DEBIAN_FRONTEND=noninteractive apt install -y diffoscope
+ script:
+ - diffoscope --text diffoscope_output.txt image1 image2
+ artifacts:
+ when: always
+ expire_in: 1 day
+ paths:
+ - diffoscope_output.txt
+
+
+# repro build
+build:qemu-amd64-base-repro-build:
+ extends:
+ - .repro-build
+ variables:
+ target: qemu-amd64
+
+build:qemu-arm64-base-repro-build:
+ extends:
+ - .repro-build
+ variables:
+ target: qemu-arm64
+
+build:qemu-arm-base-repro-build:
+ extends:
+ - .repro-build
+ variables:
+ target: qemu-arm
+
+# repro build test
+test:qemu-amd64-base-repro-test:
+ extends:
+ - .repro-test
+ dependencies:
+ - build:qemu-amd64-base-repro-build
+
+test:qemu-arm64-base-repro-test:
+ extends:
+ - .repro-test
+ dependencies:
+ - build:qemu-arm64-base-repro-build
+
+test:qemu-arm-base-repro-test:
+ extends:
+ - .repro-test
+ dependencies:
+ - build:qemu-arm-base-repro-build
--
Siemens AG, Technology
Competence Center Embedded Linux