diff mbox series

[isar-cip-core,v3,2/2] .gitlab-ci.yml: Add condition check in .build_base to build v2 image

Message ID 20240214154820.3544080-3-Sai.Sathujoda@toshiba-tsip.com (mailing list archive)
State Superseded
Headers show
Series Upload .swu file and firmware for LAVA testing | expand

Commit Message

Sai.Sathujoda@toshiba-tsip.com Feb. 14, 2024, 3:48 p.m. UTC
From: Sai Sathujoda <Sai.Sathujoda@toshiba-tsip.com>

To re-use the built artifacts of v1 image, the consecutive build must
happen in the project directory of the job. So if use_swu is enabled, then
a consecutive build with a minor recipe change is done to get an .swu
artifact for swupdate testing in LAVA.

Signed-off-by: Sai Sathujoda <Sai.Sathujoda@toshiba-tsip.com>
---
 .gitlab-ci.yml | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Jan Kiszka Feb. 14, 2024, 5:24 p.m. UTC | #1
On 14.02.24 16:48, Sai.Sathujoda@toshiba-tsip.com wrote:
> From: Sai Sathujoda <Sai.Sathujoda@toshiba-tsip.com>
> 
> To re-use the built artifacts of v1 image, the consecutive build must
> happen in the project directory of the job. So if use_swu is enabled, then
> a consecutive build with a minor recipe change is done to get an .swu
> artifact for swupdate testing in LAVA.
> 
> Signed-off-by: Sai Sathujoda <Sai.Sathujoda@toshiba-tsip.com>
> ---
>  .gitlab-ci.yml | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index 4f87ec3..bbd534e 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -25,6 +25,7 @@ variables:
>    dtb: none
>    deploy: enable
>    deploy_kernelci: disable
> +  use_swu: disable

Also here: naming. This is rather "build_swu_v2", and deploy it, of course.

>  
>  stages:
>    - build
> @@ -66,6 +67,12 @@ default:
>      - echo "Building ${base_yaml}"
>      - kas build ${base_yaml}
>      - if [ "${deploy}" = "enable" ]; then scripts/deploy-cip-core.sh ${release} ${target} ${extension} ${dtb} ${CI_COMMIT_REF_SLUG}; fi
> +    - >

Just wondering: Is there a technical reason to use "- >" here, rather
then starting directly with the command?

> +      if [ "${use_swu}" = "enable" ]; then
> +          echo "PV = \"2.0\"" >> recipes-core/images/cip-core-image-security.bb
> +          kas build ${base_yaml}
> +          scripts/deploy-cip-core.sh ${release} ${target} ${extension} ${dtb} ${CI_COMMIT_REF_SLUG} ${use_swu}
> +      fi
>      - if [ "${deploy_kernelci}" = "enable" ]; then scripts/deploy-kernelci.py ${release} ${target} ${extension} ${dtb}; fi
>  
>  # base image
> @@ -105,6 +112,7 @@ build:qemu-amd64-base:
>      use_rt: disable
>      wic_targz: disable
>      targz: enable
> +    use_swu: enable
>  
>  build:qemu-amd64-base-kernelci:
>    extends:
> @@ -127,6 +135,7 @@ build:qemu-arm64-base:
>      use_rt: disable
>      wic_targz: disable
>      targz: enable
> +    use_swu: enable
>  
>  build:qemu-arm64-base-kernelci:
>    extends:
> @@ -149,6 +158,7 @@ build:qemu-arm-base:
>      use_rt: disable
>      wic_targz: disable
>      targz: enable
> +    use_swu: enable
>  
>  build:qemu-arm-base-kernelci:
>    extends:

Jan
Sai.Sathujoda@toshiba-tsip.com Feb. 15, 2024, 6:01 a.m. UTC | #2
Hi Jan,

Thank you for your comments.

Using 'build_swu_v2' switch to decide whether we need to build the second image for it's .swu while extending .build_base is more relevant. We ll make the change for that. 

Another thing is we want to completely occupy $6 parameter in both the places the deploy-cip-core.sh shall be called from now so that we can avoid conflict if some one wants to introduce 6th positional parameter in the first call to deploy script. For that we want to declare a new variable name 'deploy_file' with it's default as wic. We shall use 'deploy_file: swu' when we build the v2 image. We can also hardcode "wic" and "swu" as $6 parameters in deploy script calls instead of using a separate 'deploy_file' variable.

I also wanted to confirm that I added   - > under the script section is to run multiple commands as a yaml multi-line block.

Please provide your opinion on this, Jan. We ll send v4 series once you confirm this approach.

Thanks and Regards,
Sai Ashrith Sathujoda



-----Original Message-----
From: Jan Kiszka <jan.kiszka@siemens.com> 
Sent: Wednesday, February 14, 2024 10:55 PM
To: ashrith sai(TSIP) <Sai.Sathujoda@toshiba-tsip.com>; cip-dev@lists.cip-project.org
Cc: dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4) <kazuhiro3.hayashi@toshiba.co.jp>
Subject: Re: [isar-cip-core v3 2/2] .gitlab-ci.yml: Add condition check in .build_base to build v2 image

On 14.02.24 16:48, Sai.Sathujoda@toshiba-tsip.com wrote:
> From: Sai Sathujoda <Sai.Sathujoda@toshiba-tsip.com>
> 
> To re-use the built artifacts of v1 image, the consecutive build must 
> happen in the project directory of the job. So if use_swu is enabled, 
> then a consecutive build with a minor recipe change is done to get an 
> .swu artifact for swupdate testing in LAVA.
> 
> Signed-off-by: Sai Sathujoda <Sai.Sathujoda@toshiba-tsip.com>
> ---
>  .gitlab-ci.yml | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4f87ec3..bbd534e 
> 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -25,6 +25,7 @@ variables:
>    dtb: none
>    deploy: enable
>    deploy_kernelci: disable
> +  use_swu: disable

Also here: naming. This is rather "build_swu_v2", and deploy it, of course.

>  
>  stages:
>    - build
> @@ -66,6 +67,12 @@ default:
>      - echo "Building ${base_yaml}"
>      - kas build ${base_yaml}
>      - if [ "${deploy}" = "enable" ]; then scripts/deploy-cip-core.sh 
> ${release} ${target} ${extension} ${dtb} ${CI_COMMIT_REF_SLUG}; fi
> +    - >

Just wondering: Is there a technical reason to use "- >" here, rather then starting directly with the command?

> +      if [ "${use_swu}" = "enable" ]; then
> +          echo "PV = \"2.0\"" >> recipes-core/images/cip-core-image-security.bb
> +          kas build ${base_yaml}
> +          scripts/deploy-cip-core.sh ${release} ${target} ${extension} ${dtb} ${CI_COMMIT_REF_SLUG} ${use_swu}
> +      fi
>      - if [ "${deploy_kernelci}" = "enable" ]; then 
> scripts/deploy-kernelci.py ${release} ${target} ${extension} ${dtb}; 
> fi
>  
>  # base image
> @@ -105,6 +112,7 @@ build:qemu-amd64-base:
>      use_rt: disable
>      wic_targz: disable
>      targz: enable
> +    use_swu: enable
>  
>  build:qemu-amd64-base-kernelci:
>    extends:
> @@ -127,6 +135,7 @@ build:qemu-arm64-base:
>      use_rt: disable
>      wic_targz: disable
>      targz: enable
> +    use_swu: enable
>  
>  build:qemu-arm64-base-kernelci:
>    extends:
> @@ -149,6 +158,7 @@ build:qemu-arm-base:
>      use_rt: disable
>      wic_targz: disable
>      targz: enable
> +    use_swu: enable
>  
>  build:qemu-arm-base-kernelci:
>    extends:

Jan

--
Siemens AG, Technology
Linux Expert Center
Jan Kiszka Feb. 15, 2024, 6:51 a.m. UTC | #3
On 15.02.24 07:01, Sai.Sathujoda@toshiba-tsip.com wrote:
> Hi Jan,
> 
> Thank you for your comments.
> 
> Using 'build_swu_v2' switch to decide whether we need to build the second image for it's .swu while extending .build_base is more relevant. We ll make the change for that. 
> 
> Another thing is we want to completely occupy $6 parameter in both the places the deploy-cip-core.sh shall be called from now so that we can avoid conflict if some one wants to introduce 6th positional parameter in the first call to deploy script. For that we want to declare a new variable name 'deploy_file' with it's default as wic. We shall use 'deploy_file: swu' when we build the v2 image. We can also hardcode "wic" and "swu" as $6 parameters in deploy script calls instead of using a separate 'deploy_file' variable.

Actually, I'm not fully happy with the interface yet, even when using
"deploy_file: swu" because that mode still seems to deploy more than
just the swu. Maybe you can make sure that in this mode really only the
swu is pushed. That would allow in the future to push image, firmware,
you-name-it in one step and add the swu right after that without
uploading bits twice.

> 
> I also wanted to confirm that I added   - > under the script section is to run multiple commands as a yaml multi-line block.

Sure, but you are only adding a single shell command (the if-block
counts as one).

Jan

> 
> Please provide your opinion on this, Jan. We ll send v4 series once you confirm this approach.
> 
> Thanks and Regards,
> Sai Ashrith Sathujoda
> 
> 
> 
> -----Original Message-----
> From: Jan Kiszka <jan.kiszka@siemens.com> 
> Sent: Wednesday, February 14, 2024 10:55 PM
> To: ashrith sai(TSIP) <Sai.Sathujoda@toshiba-tsip.com>; cip-dev@lists.cip-project.org
> Cc: dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4) <kazuhiro3.hayashi@toshiba.co.jp>
> Subject: Re: [isar-cip-core v3 2/2] .gitlab-ci.yml: Add condition check in .build_base to build v2 image
> 
> On 14.02.24 16:48, Sai.Sathujoda@toshiba-tsip.com wrote:
>> From: Sai Sathujoda <Sai.Sathujoda@toshiba-tsip.com>
>>
>> To re-use the built artifacts of v1 image, the consecutive build must 
>> happen in the project directory of the job. So if use_swu is enabled, 
>> then a consecutive build with a minor recipe change is done to get an 
>> .swu artifact for swupdate testing in LAVA.
>>
>> Signed-off-by: Sai Sathujoda <Sai.Sathujoda@toshiba-tsip.com>
>> ---
>>  .gitlab-ci.yml | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4f87ec3..bbd534e 
>> 100644
>> --- a/.gitlab-ci.yml
>> +++ b/.gitlab-ci.yml
>> @@ -25,6 +25,7 @@ variables:
>>    dtb: none
>>    deploy: enable
>>    deploy_kernelci: disable
>> +  use_swu: disable
> 
> Also here: naming. This is rather "build_swu_v2", and deploy it, of course.
> 
>>  
>>  stages:
>>    - build
>> @@ -66,6 +67,12 @@ default:
>>      - echo "Building ${base_yaml}"
>>      - kas build ${base_yaml}
>>      - if [ "${deploy}" = "enable" ]; then scripts/deploy-cip-core.sh 
>> ${release} ${target} ${extension} ${dtb} ${CI_COMMIT_REF_SLUG}; fi
>> +    - >
> 
> Just wondering: Is there a technical reason to use "- >" here, rather then starting directly with the command?
> 
>> +      if [ "${use_swu}" = "enable" ]; then
>> +          echo "PV = \"2.0\"" >> recipes-core/images/cip-core-image-security.bb
>> +          kas build ${base_yaml}
>> +          scripts/deploy-cip-core.sh ${release} ${target} ${extension} ${dtb} ${CI_COMMIT_REF_SLUG} ${use_swu}
>> +      fi
>>      - if [ "${deploy_kernelci}" = "enable" ]; then 
>> scripts/deploy-kernelci.py ${release} ${target} ${extension} ${dtb}; 
>> fi
>>  
>>  # base image
>> @@ -105,6 +112,7 @@ build:qemu-amd64-base:
>>      use_rt: disable
>>      wic_targz: disable
>>      targz: enable
>> +    use_swu: enable
>>  
>>  build:qemu-amd64-base-kernelci:
>>    extends:
>> @@ -127,6 +135,7 @@ build:qemu-arm64-base:
>>      use_rt: disable
>>      wic_targz: disable
>>      targz: enable
>> +    use_swu: enable
>>  
>>  build:qemu-arm64-base-kernelci:
>>    extends:
>> @@ -149,6 +158,7 @@ build:qemu-arm-base:
>>      use_rt: disable
>>      wic_targz: disable
>>      targz: enable
>> +    use_swu: enable
>>  
>>  build:qemu-arm-base-kernelci:
>>    extends:
> 
> Jan
> 
> --
> Siemens AG, Technology
> Linux Expert Center
diff mbox series

Patch

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4f87ec3..bbd534e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -25,6 +25,7 @@  variables:
   dtb: none
   deploy: enable
   deploy_kernelci: disable
+  use_swu: disable
 
 stages:
   - build
@@ -66,6 +67,12 @@  default:
     - echo "Building ${base_yaml}"
     - kas build ${base_yaml}
     - if [ "${deploy}" = "enable" ]; then scripts/deploy-cip-core.sh ${release} ${target} ${extension} ${dtb} ${CI_COMMIT_REF_SLUG}; fi
+    - >
+      if [ "${use_swu}" = "enable" ]; then
+          echo "PV = \"2.0\"" >> recipes-core/images/cip-core-image-security.bb
+          kas build ${base_yaml}
+          scripts/deploy-cip-core.sh ${release} ${target} ${extension} ${dtb} ${CI_COMMIT_REF_SLUG} ${use_swu}
+      fi
     - if [ "${deploy_kernelci}" = "enable" ]; then scripts/deploy-kernelci.py ${release} ${target} ${extension} ${dtb}; fi
 
 # base image
@@ -105,6 +112,7 @@  build:qemu-amd64-base:
     use_rt: disable
     wic_targz: disable
     targz: enable
+    use_swu: enable
 
 build:qemu-amd64-base-kernelci:
   extends:
@@ -127,6 +135,7 @@  build:qemu-arm64-base:
     use_rt: disable
     wic_targz: disable
     targz: enable
+    use_swu: enable
 
 build:qemu-arm64-base-kernelci:
   extends:
@@ -149,6 +158,7 @@  build:qemu-arm-base:
     use_rt: disable
     wic_targz: disable
     targz: enable
+    use_swu: enable
 
 build:qemu-arm-base-kernelci:
   extends: