* [PATCH v2 1/5] testsuite: Dockerfile for docker-isar image
2023-03-22 12:29 [PATCH v2 0/5] Use `docker-isar` image for maintainer test jobs Uladzimir Bely
@ 2023-03-22 12:29 ` Uladzimir Bely
2023-03-22 16:22 ` Moessbauer, Felix
2023-03-22 12:29 ` [PATCH v2 2/5] testsuite: Add README for docker-isar Uladzimir Bely
` (3 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Uladzimir Bely @ 2023-03-22 12:29 UTC (permalink / raw)
To: isar-users
Add dockerfile for generating docker-isar image supposed to be used
in docker-based CI systems.
This image better fits testing when compared with 'kas-isar' one:
- Avocado test framework preinstalled.
- Qemu-system packages for running execution testcases preinstalled.
- Direct avocado execution (without ci_build.sh) when necessary (e.g.,
for manual testing).
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
testsuite/dockerdata/.dockerignore | 2 ++
testsuite/dockerdata/Dockerfile | 18 ++++++++++++++++++
2 files changed, 20 insertions(+)
create mode 100644 testsuite/dockerdata/.dockerignore
create mode 100644 testsuite/dockerdata/Dockerfile
diff --git a/testsuite/dockerdata/.dockerignore b/testsuite/dockerdata/.dockerignore
new file mode 100644
index 00000000..6e19512a
--- /dev/null
+++ b/testsuite/dockerdata/.dockerignore
@@ -0,0 +1,2 @@
+.dockerignore
+Dockerfile
diff --git a/testsuite/dockerdata/Dockerfile b/testsuite/dockerdata/Dockerfile
new file mode 100644
index 00000000..87ae2f20
--- /dev/null
+++ b/testsuite/dockerdata/Dockerfile
@@ -0,0 +1,18 @@
+FROM ghcr.io/siemens/kas/kas-isar:latest
+
+ARG TARGETPLATFORM
+ARG DEBIAN_FRONTEND=noninteractive
+
+USER root
+
+# Isar testsuite dependencies
+RUN pip3 --proxy=$https_proxy install avocado-framework==100.1 && \
+ rm -rf $(pip3 cache dir) && \
+ apt-get update && \
+ apt-get install -y -f --no-install-recommends \
+ qemu-system ovmf
+
+RUN apt-get clean && \
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+
+USER builder
--
2.20.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/5] testsuite: Dockerfile for docker-isar image
2023-03-22 12:29 ` [PATCH v2 1/5] testsuite: Dockerfile for docker-isar image Uladzimir Bely
@ 2023-03-22 16:22 ` Moessbauer, Felix
2023-03-23 5:24 ` Uladzimir Bely
2023-03-23 5:46 ` Jan Kiszka
0 siblings, 2 replies; 9+ messages in thread
From: Moessbauer, Felix @ 2023-03-22 16:22 UTC (permalink / raw)
To: ubely, isar-users
On Wed, 2023-03-22 at 13:29 +0100, Uladzimir Bely wrote:
> Add dockerfile for generating docker-isar image supposed to be used
> in docker-based CI systems.
>
> This image better fits testing when compared with 'kas-isar' one:
> - Avocado test framework preinstalled.
> - Qemu-system packages for running execution testcases preinstalled.
> - Direct avocado execution (without ci_build.sh) when necessary
> (e.g.,
> for manual testing).
>
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
> testsuite/dockerdata/.dockerignore | 2 ++
> testsuite/dockerdata/Dockerfile | 18 ++++++++++++++++++
> 2 files changed, 20 insertions(+)
> create mode 100644 testsuite/dockerdata/.dockerignore
> create mode 100644 testsuite/dockerdata/Dockerfile
>
> diff --git a/testsuite/dockerdata/.dockerignore
> b/testsuite/dockerdata/.dockerignore
> new file mode 100644
> index 00000000..6e19512a
> --- /dev/null
> +++ b/testsuite/dockerdata/.dockerignore
> @@ -0,0 +1,2 @@
> +.dockerignore
> +Dockerfile
> diff --git a/testsuite/dockerdata/Dockerfile
> b/testsuite/dockerdata/Dockerfile
> new file mode 100644
> index 00000000..87ae2f20
> --- /dev/null
> +++ b/testsuite/dockerdata/Dockerfile
> @@ -0,0 +1,18 @@
> +FROM ghcr.io/siemens/kas/kas-isar:latest
I would recommend to use a fixed version / tag here.
Floating references are problematic as local rebuilds of the image
might use different versions of the base image.
Felix
> +
> +ARG TARGETPLATFORM
> +ARG DEBIAN_FRONTEND=noninteractive
> +
> +USER root
> +
> +# Isar testsuite dependencies
> +RUN pip3 --proxy=$https_proxy install avocado-framework==100.1 && \
> + rm -rf $(pip3 cache dir) && \
> + apt-get update && \
> + apt-get install -y -f --no-install-recommends \
> + qemu-system ovmf
> +
> +RUN apt-get clean && \
> + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Please do this in the previous RUN invocation as otherwise the data is
added to the first layer. By that, no space is saved.
Felix
> +
> +USER builder
> --
> 2.20.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/5] testsuite: Dockerfile for docker-isar image
2023-03-22 16:22 ` Moessbauer, Felix
@ 2023-03-23 5:24 ` Uladzimir Bely
2023-03-23 5:46 ` Jan Kiszka
1 sibling, 0 replies; 9+ messages in thread
From: Uladzimir Bely @ 2023-03-23 5:24 UTC (permalink / raw)
To: isar-users, Moessbauer, Felix
In mail from Wednesday, 22 March 2023 19:22:09 +03 user Moessbauer, Felix
wrote:
> On Wed, 2023-03-22 at 13:29 +0100, Uladzimir Bely wrote:
>
> > Add dockerfile for generating docker-isar image supposed to be used
> > in docker-based CI systems.
> >
> > This image better fits testing when compared with 'kas-isar' one:
> > - Avocado test framework preinstalled.
> > - Qemu-system packages for running execution testcases preinstalled.
> > - Direct avocado execution (without ci_build.sh) when necessary
> > (e.g.,
> > for manual testing).
> >
> > Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> > ---
> > testsuite/dockerdata/.dockerignore | 2 ++
> > testsuite/dockerdata/Dockerfile | 18 ++++++++++++++++++
> > 2 files changed, 20 insertions(+)
> > create mode 100644 testsuite/dockerdata/.dockerignore
> > create mode 100644 testsuite/dockerdata/Dockerfile
> >
> > diff --git a/testsuite/dockerdata/.dockerignore
> > b/testsuite/dockerdata/.dockerignore
> > new file mode 100644
> > index 00000000..6e19512a
> > --- /dev/null
> > +++ b/testsuite/dockerdata/.dockerignore
> > @@ -0,0 +1,2 @@
> > +.dockerignore
> > +Dockerfile
> > diff --git a/testsuite/dockerdata/Dockerfile
> > b/testsuite/dockerdata/Dockerfile
> > new file mode 100644
> > index 00000000..87ae2f20
> > --- /dev/null
> > +++ b/testsuite/dockerdata/Dockerfile
> > @@ -0,0 +1,18 @@
> > +FROM ghcr.io/siemens/kas/kas-isar:latest
>
>
> I would recommend to use a fixed version / tag here.
> Floating references are problematic as local rebuilds of the image
> might use different versions of the base image.
>
> Felix
>
Actually, ":latest" here is just an anchor for sed (see README.md from p.2).
I didn't find better simple way to generate new image with the same version as
base image has. Any other approach needs Dockerfile to be edited.
>
> > +
> > +ARG TARGETPLATFORM
> > +ARG DEBIAN_FRONTEND=noninteractive
> > +
> > +USER root
> > +
> > +# Isar testsuite dependencies
> > +RUN pip3 --proxy=$https_proxy install avocado-framework==100.1 && \
> > + rm -rf $(pip3 cache dir) && \
> > + apt-get update && \
> > + apt-get install -y -f --no-install-recommends \
> > + qemu-system ovmf
> > +
> > +RUN apt-get clean && \
> > + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
>
>
> Please do this in the previous RUN invocation as otherwise the data is
> added to the first layer. By that, no space is saved.
>
> Felix
>
>
> > +
> > +USER builder
> > --
> > 2.20.1
> >
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/5] testsuite: Dockerfile for docker-isar image
2023-03-22 16:22 ` Moessbauer, Felix
2023-03-23 5:24 ` Uladzimir Bely
@ 2023-03-23 5:46 ` Jan Kiszka
1 sibling, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2023-03-23 5:46 UTC (permalink / raw)
To: Moessbauer, Felix, ubely, isar-users
On 22.03.23 17:22, Moessbauer, Felix wrote:
> On Wed, 2023-03-22 at 13:29 +0100, Uladzimir Bely wrote:
>> Add dockerfile for generating docker-isar image supposed to be used
>> in docker-based CI systems.
>>
>> This image better fits testing when compared with 'kas-isar' one:
>> - Avocado test framework preinstalled.
>> - Qemu-system packages for running execution testcases preinstalled.
>> - Direct avocado execution (without ci_build.sh) when necessary
>> (e.g.,
>> for manual testing).
>>
>> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
>> ---
>> testsuite/dockerdata/.dockerignore | 2 ++
>> testsuite/dockerdata/Dockerfile | 18 ++++++++++++++++++
>> 2 files changed, 20 insertions(+)
>> create mode 100644 testsuite/dockerdata/.dockerignore
>> create mode 100644 testsuite/dockerdata/Dockerfile
>>
>> diff --git a/testsuite/dockerdata/.dockerignore
>> b/testsuite/dockerdata/.dockerignore
>> new file mode 100644
>> index 00000000..6e19512a
>> --- /dev/null
>> +++ b/testsuite/dockerdata/.dockerignore
>> @@ -0,0 +1,2 @@
>> +.dockerignore
>> +Dockerfile
>> diff --git a/testsuite/dockerdata/Dockerfile
>> b/testsuite/dockerdata/Dockerfile
>> new file mode 100644
>> index 00000000..87ae2f20
>> --- /dev/null
>> +++ b/testsuite/dockerdata/Dockerfile
>> @@ -0,0 +1,18 @@
>> +FROM ghcr.io/siemens/kas/kas-isar:latest
>
> I would recommend to use a fixed version / tag here.
> Floating references are problematic as local rebuilds of the image
> might use different versions of the base image.
>
This also does not help with testing kas-isar:latest as the image build
is not part of your CI. Instead, use a fixed release by default and
rather set up a dedicated CI job that builds and uses a :latest image.
Jan
--
Siemens AG, Technology
Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 2/5] testsuite: Add README for docker-isar
2023-03-22 12:29 [PATCH v2 0/5] Use `docker-isar` image for maintainer test jobs Uladzimir Bely
2023-03-22 12:29 ` [PATCH v2 1/5] testsuite: Dockerfile for docker-isar image Uladzimir Bely
@ 2023-03-22 12:29 ` Uladzimir Bely
2023-03-22 12:29 ` [PATCH v2 3/5] gitlab-ci: Switch to `rules` instead of `except` and `only` Uladzimir Bely
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Uladzimir Bely @ 2023-03-22 12:29 UTC (permalink / raw)
To: isar-users
Document `docker-isar` image prepare and publish steps.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
testsuite/dockerdata/.dockerignore | 1 +
testsuite/dockerdata/README.md | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
create mode 100644 testsuite/dockerdata/README.md
diff --git a/testsuite/dockerdata/.dockerignore b/testsuite/dockerdata/.dockerignore
index 6e19512a..d06a06ab 100644
--- a/testsuite/dockerdata/.dockerignore
+++ b/testsuite/dockerdata/.dockerignore
@@ -1,2 +1,3 @@
.dockerignore
Dockerfile
+README.md
diff --git a/testsuite/dockerdata/README.md b/testsuite/dockerdata/README.md
new file mode 100644
index 00000000..f98a8e1e
--- /dev/null
+++ b/testsuite/dockerdata/README.md
@@ -0,0 +1,20 @@
+# Creating image
+
+```
+export version="3.2.3"
+cd <isar_dir>/testsuite/dockerdata
+sed "s/:latest/:${version}/" Dockerfile | docker build -t ghcr.io/ilbers/docker-isar:${version} -
+```
+
+# Pushing the image to docker hub
+
+- Configure github token (classic) with `write:packages` permissions.
+
+- Use it for uploading docker image:
+
+```
+export version="3.2.3"
+docker push ghcr.io/ilbers/docker-isar:${version}
+```
+
+- Make the uploaded package public
--
2.20.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 3/5] gitlab-ci: Switch to `rules` instead of `except` and `only`
2023-03-22 12:29 [PATCH v2 0/5] Use `docker-isar` image for maintainer test jobs Uladzimir Bely
2023-03-22 12:29 ` [PATCH v2 1/5] testsuite: Dockerfile for docker-isar image Uladzimir Bely
2023-03-22 12:29 ` [PATCH v2 2/5] testsuite: Add README for docker-isar Uladzimir Bely
@ 2023-03-22 12:29 ` Uladzimir Bely
2023-03-22 12:29 ` [PATCH v2 4/5] gitlab-ci.yml: Run 'fast' and 'full' only if specific variable set Uladzimir Bely
2023-03-22 12:29 ` [PATCH v2 5/5] gitlab-ci.yml: Add jobs that run with custom docker-isar image Uladzimir Bely
4 siblings, 0 replies; 9+ messages in thread
From: Uladzimir Bely @ 2023-03-22 12:29 UTC (permalink / raw)
To: isar-users
Filters that use `rules` are more configurable and allow using
several rules in the chain.
Also, put `image` under `default` section instead of deprecated
global declaration, with image version update to the latest one.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
.gitlab-ci.yml | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index eb38be54..b700015c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,5 @@
-image: ghcr.io/siemens/kas/kas-isar:3.0.2
+default:
+ image: ghcr.io/siemens/kas/kas-isar:3.2.3
variables:
GIT_STRATEGY: clone
@@ -24,22 +25,22 @@ variables:
dev-ci:
<<: *common-build
- except:
- - schedules
+ rules:
+ - if: $CI_PIPELINE_SOURCE != 'schedule'
script:
- scripts/ci_build.sh -T dev
fast-ci:
<<: *common-build
- only:
- - schedules
+ rules:
+ - if: $CI_PIPELINE_SOURCE == 'schedule'
script:
- scripts/ci_build.sh -T fast
full-ci:
<<: *common-build
- only:
- - schedules
+ rules:
+ - if: $CI_PIPELINE_SOURCE == 'schedule'
script:
- PREVIOUS_SHA="$(cat .CI_COMMIT_SHA || true)"
- if [ "$CI_COMMIT_SHA" != "$PREVIOUS_SHA" ]; then
--
2.20.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 4/5] gitlab-ci.yml: Run 'fast' and 'full' only if specific variable set
2023-03-22 12:29 [PATCH v2 0/5] Use `docker-isar` image for maintainer test jobs Uladzimir Bely
` (2 preceding siblings ...)
2023-03-22 12:29 ` [PATCH v2 3/5] gitlab-ci: Switch to `rules` instead of `except` and `only` Uladzimir Bely
@ 2023-03-22 12:29 ` Uladzimir Bely
2023-03-22 12:29 ` [PATCH v2 5/5] gitlab-ci.yml: Add jobs that run with custom docker-isar image Uladzimir Bely
4 siblings, 0 replies; 9+ messages in thread
From: Uladzimir Bely @ 2023-03-22 12:29 UTC (permalink / raw)
To: isar-users
Before the patch, any schedule run both 'fast' and 'full' jobs.
Now, to filter the required job, we should now specify `TESTSUITE`
variable. If not set, schedule will run only 'full' for compatibility
with current CI setups.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
.gitlab-ci.yml | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b700015c..5117519a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -26,21 +26,22 @@ variables:
dev-ci:
<<: *common-build
rules:
- - if: $CI_PIPELINE_SOURCE != 'schedule'
+ - if: $TESTSUITE == 'dev' || $CI_PIPELINE_SOURCE != 'schedule'
script:
- scripts/ci_build.sh -T dev
fast-ci:
<<: *common-build
rules:
- - if: $CI_PIPELINE_SOURCE == 'schedule'
+ - if: $TESTSUITE == 'fast'
script:
- scripts/ci_build.sh -T fast
full-ci:
<<: *common-build
rules:
- - if: $CI_PIPELINE_SOURCE == 'schedule'
+ - if: $TESTSUITE == null && $CI_PIPELINE_SOURCE == 'schedule'
+ - if: $TESTSUITE == 'full'
script:
- PREVIOUS_SHA="$(cat .CI_COMMIT_SHA || true)"
- if [ "$CI_COMMIT_SHA" != "$PREVIOUS_SHA" ]; then
--
2.20.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 5/5] gitlab-ci.yml: Add jobs that run with custom docker-isar image
2023-03-22 12:29 [PATCH v2 0/5] Use `docker-isar` image for maintainer test jobs Uladzimir Bely
` (3 preceding siblings ...)
2023-03-22 12:29 ` [PATCH v2 4/5] gitlab-ci.yml: Run 'fast' and 'full' only if specific variable set Uladzimir Bely
@ 2023-03-22 12:29 ` Uladzimir Bely
4 siblings, 0 replies; 9+ messages in thread
From: Uladzimir Bely @ 2023-03-22 12:29 UTC (permalink / raw)
To: isar-users
This adds possibility to select between `kas-isar` image for building
the project and `docker-isar` one.
By default, if variable `IMAGE` is not set in schedule properties, we
continue using `kas-isar`. Specifying `IMAGE = docker-isar` swtiches CI
to `docker-isar` image that has "avocado" and "qemu-system" packages
preinstalled.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
.gitlab-ci.yml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5117519a..7e28a234 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -23,9 +23,28 @@ variables:
when: always
expire_in: 1 week
+
+.docker-isar: &docker-isar
+ image: ghcr.io/ilbers/docker-isar:3.2.3
+
+
+.use-default-image:
+ rules:
+ - &use-default-image
+ if: $IMAGE
+ when: never
+
+.use-docker-isar-image:
+ rules:
+ - &use-docker-isar-image
+ if: $IMAGE != 'docker-isar'
+ when: never
+
+
dev-ci:
<<: *common-build
rules:
+ - *use-default-image
- if: $TESTSUITE == 'dev' || $CI_PIPELINE_SOURCE != 'schedule'
script:
- scripts/ci_build.sh -T dev
@@ -33,6 +52,7 @@ dev-ci:
fast-ci:
<<: *common-build
rules:
+ - *use-default-image
- if: $TESTSUITE == 'fast'
script:
- scripts/ci_build.sh -T fast
@@ -40,6 +60,7 @@ fast-ci:
full-ci:
<<: *common-build
rules:
+ - *use-default-image
- if: $TESTSUITE == null && $CI_PIPELINE_SOURCE == 'schedule'
- if: $TESTSUITE == 'full'
script:
@@ -52,3 +73,31 @@ full-ci:
key: "$CI_COMMIT_REF_SLUG"
paths:
- .CI_COMMIT_SHA
+
+
+dev-ci-isar:
+ <<: *docker-isar
+ <<: *common-build
+ rules:
+ - *use-docker-isar-image
+ - if: $TESTSUITE == 'dev'
+ script:
+ - scripts/ci_build.sh -T dev
+
+fast-ci-isar:
+ <<: *docker-isar
+ <<: *common-build
+ rules:
+ - *use-docker-isar-image
+ - if: $TESTSUITE == 'fast'
+ script:
+ - scripts/ci_build.sh -T fast
+
+full-ci-isar:
+ <<: *docker-isar
+ <<: *common-build
+ rules:
+ - *use-docker-isar-image
+ - if: $TESTSUITE == 'full'
+ script:
+ - scripts/ci_build.sh -T full
--
2.20.1
^ permalink raw reply [flat|nested] 9+ messages in thread