33 Commits

Author SHA1 Message Date
Leonardo Fagundes Luz Serrano
6e24ea853b patch-iso: Secondary ISO input
To generate the pre-patched ISO, take some content
from a secondary input ISO.

Specifically, all ISO content should be taken from 24.09 GA,
expect for the "patches", "kickstart" and "upgrades" folders.

The ostree_repo remains the same as it is, being taken
from "ostree_base"

Test Plan:
pass - Mock pipeline

Story: 2011318
Task: 51506

Depends-On: https://review.opendev.org/c/starlingx/root/+/938229

Change-Id: I3cc5151c97cf374cf04586c29f76528f83bd6658
Signed-off-by: Leonardo Fagundes Luz Serrano <Leonardo.FagundesLuzSerrano@windriver.com>
2024-12-27 23:29:58 +00:00
Dostoievski Batista
0215b0dcbc Change ISO and ostree used by the patch-iso step
This change adds the stage build-iso to the patch pipeline, change the
ISO used by the create-prepatched-iso script and specify the ostree
repository to be use as base.

Test plan:
    PASS: Run complete patch pipeline with success

Depends-On: https://review.opendev.org/c/starlingx/root/+/936975
Closes-Bug: 2090871

Change-Id: Ia0b47fb9a18e4747c4983e09b144691d27c173e2
Signed-off-by: Dostoievski Batista <dostoievski.albinobatista@windriver.com>
2024-12-06 15:37:20 -03:00
Dostoievski Batista
0cf05c13c6 Add patch signing to the pipeline
This change allows the user to select if he wants to sign the patch
using the SIGN_PATCH variable, when set to True it will automatically
add the "--remote-sign" option to the patch-builder script and export
the env variables, SIGNING_USER and SIGNING_SERVER, from the build.conf

Test plan:
    PASS: Run entire patch pipeline with SIGN_PATCH enable

Story: 2010676
Task: 51404

Change-Id: I7e895f30ea64a517a3555117250a4f00f8b6dfe1
Signed-off-by: Dostoievski Batista <dostoievski.albinobatista@windriver.com>
2024-12-04 12:26:38 -03:00
Igor Frazzon
77d0f85383 fix: archive-prerequisites fails in build config
This changes remove from Jenkins Pipeline the post step
archive-prerequisites.sh from the step "download-prerequisites".

TESTS
========================
* Run entire monolithic Jenkins Pipeline with success.
* Re-run monolithic with a fix and make sure it finished success.

Closes-Bug: 2028880
Change-Id: I157e532b86ff10df9e13463eca732f58845b3db4
2024-10-11 14:06:38 -03:00
Dostoievski Batista
0eec407738 Add jenkins pipeline for patch creation
This change adds support for creating a patch on top of specified build
state using Jenkins:
- patch-monolithic: Main job where all the stages are listed and called.
- ostree-pull: Part where we pull the ostree from the remote build home.
- patch-make: Part where "patch-builder" is executed and the patch gets
    created.
- patch-iso: Part where the "create-prepatched-iso" is executed and the
    pre-patched ISO is created.
- publish-patch: Part where the publish directory for the pre-patched
    ISO and patch is created.
We also update the build-packages part to support "reuse_maximum" option
when running build-pkgs.

Test plan:
    PASS: Run full monolithic pipeline
    PASS: Run full patch-monolithic pipeline

Story: 2010226
Task: 50700

Change-Id: I7c7d688f2c568532a0b23844dcfd81349ca96476
Signed-off-by: Dostoievski Batista <dostoievski.albinobatista@windriver.com>
2024-09-11 14:50:05 -03:00
suyash
928e9a9a77 Added BUILD_RT Parameter in publish-log.pipeline
To publish realtime log to mirror.starlingx.windriver.com.
BUILD_RT information is required, so adding this parameter.

Test-Plan:
PASS - Run jenkins job to verify publish-log part.
PASS - Check if package log file exists.

Closes-bug: 2071355
Change-Id: Ibb185df1b4c6ad7f5f488062f4f489744a03a6b8
Signed-off-by: suyash <suyash.srivastava@windriver.com>
2024-07-05 17:47:34 +05:30
suyash
17314970c0 Added publish-stx-logs.sh script to pipeline.
We need to publish sufficient logs to mirror.starlingx.windriver.com
to allow debugging of a build problem. The current publish-logs step of
jenkins pipeline only concerns itself with jenkins logs.
This new script will be executed as part of publish-logs step.

Test-Plan:
PASS - Run jenkins job to verify publish-log part.
PASS - Check if package log file exists.

Closes-bug: 2071355
Change-Id: I0c884e4817134e7b11dc13a0364ba90af18a4d5d
Signed-off-by: suyash <suyash.srivastava@windriver.com>
2024-06-28 19:11:05 +05:30
Davlet Panech
bba927d30c Separate building & starting of containers
Separate the build step from startup for environment containers. Build
step is very slow, and we want to be able to start the containers
without rebuilding when troubleshooting Jenkins jobs.

TESTS
==============================
Run both steps from Jenkins

Story: 2010226
Task: 49212

Depends-On: https://review.opendev.org/c/starlingx/tools/+/902792
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: I3462de0a9550310c931cbed2555de1b3a6bc53f9
2023-12-06 14:32:34 -05:00
Davlet Panech
1c1371cc5a Add step for building stx-remote-cli tarball
This step was missed when we created these scripts for Debian.

Story: 2010226
Task: 48670

Change-Id: I73f90b5a018fc32b39ab6d265acfbbb7fc275415
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
2023-08-24 16:51:09 -04:00
Davlet Panech
8078abccbc Login to docker hub + better docker configuration
This patch contains improvements that avoid hitting DockerHub download
rate limits. Add logic to login to DockerHub at various stages in the
build.

* New config option DOCKER_CONFIG specifies a directory with docker CLI
  configuration files and defaults to $HOME/.docker. This env var is
  recognized by docker CLI and is used whenever Jenkins scripts in this
  repo access docker on the host, eg when running rsync within a
  container.

* Old config option DOCKER_CONFIG_FILE is now deprecated in favor of
  $DOCKER_CONFIG/config.json ; but still supported with a warning. If
  specified, it will be used only to authenticate app container builds.

* New sub-job: docker-host-login: execute "docker login" before doing
  anything else. This makes sure host docker daemon and subsequent
  "docker build" etc are authenticated. This step, and all subsequent
  docket operations, used configuration specified by $DOCKER_CONFIG.
  Builds using different credentials will not interfere with each
  other.

* Rename  DOCKER_REGISTRY_PUSH_LOGIN_LIST => DOCKER_REGISTRY_LOGIN_LIST
  Old name is still supported with a warning. Always login to these
  registries within the builder container, rather than only before
  pushing app containers. The intent is for this parameter to contain
  "docker.io" in most situations; otherwise we will use anonymous access
  to DockerHub, which may hit the download rate limit more frequently.

* If DOCKER_REGISTRY_LOGIN_LIST contains "docker.io", add
  "--dockerhub-login" when calling "stx-init-env". This makes sure we
  additionally authenticate minikube's embedded docker daemon used
  to build/pull builder images in that environment.

LIMITATIONS
=================

K8s itself may pull images anonymously from docker hub. This can happen
only with the images that we don't build ourselves, used for running
some of the builder containers, ie "nginx" and "docker" images, and only
if they are not already in the local docker's cache.

TESTING
=================
Set DOCKER_CONFIG to a custom directory with a config.json file.
Set DOCKER_REGISTRY_LOGIN_LIST="docker.io SOME_OTHER_REPO". Run a build
and make sure docker credentials are copied and applied inside the build
container.

Story: 2010055
Task: 48436

Change-Id: I23bf9817cce3ed833fa605d6448f9ef600e056b0
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
2023-07-31 10:25:36 -04:00
Davlet Panech
c05051c5e6 Create latest-iso-build symlink in archive area
This patch creates or updates the symlink "latest_iso_build" in the
archive and publish areas, immediately after the ISO build succeeds, but
before the other stages (docker images etc).

This allows external users to reference that path to download the latest
ISO, even if the overall build had failed due to docker image build
errors.

TESTS
================================================
Run a build where on of the docker images fails to compile
Make sure the new ISO build symlink gets created, even though the
overall build fails.

Story: 2010226
Task: 47978

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: Idd57b4e0bbe0f231f83304a600496a48a71fba9f
2023-05-15 15:14:28 -04:00
Davlet Panech
04f9dea597 build-iso: better ISO & secureboot signing config
* Jenkins scripts:
- remove POST_ISO_SIGNING job parameter, as ISO signing is controled
  by build.conf, as originally intended.

* build.conf:
- rename SIGN_ISO => SIGN_ISO_FORMAL to better reflect purpose. ISOs
  are always signed, with developer keys (SIGN_ISO_FORMAL=false) or
  the signing server (SIGN_ISO_FORMAL=true).
- add SECUREBOOT_FORMAL - whether to generate secureboot signatures
  using the signing server (true), or not to generate them at all
  (false)

* Added code in job_utils.sh to set the defaults for these new config
  options as necessary, in case the job runs against an older build.conf
  that still has the obsolete BUILD_ISO option.

TESTS
========================
* Make sure SIGN_ISO_FORMAL==true calls "build-image --no-sign"
  followed by "sign_iso_formal.sh"
* Make sure SIGN_ISO_FORMAL==false calls "build-image" not
  followed by "sign_iso_formal.sh" and the dev-key based ISO signature
  gets created
* Make sure SECUREBOOT_FORMAL==true calls calls the secureboot script
* Make sure SECUREBOOT_FORMAL==false does not call the secureboot script
* Test with both the new parameters undefined, but SIGN_ISO defined,
  and make sure they aquire expected defaults

Story: 2010226
Task: 47777

Depends-On: https://review.opendev.org/c/starlingx/root/+/879206
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: I928de97fefc70b3062820547d1256c2a3ce106e8
2023-04-05 20:13:16 -04:00
Scott Little
186fc0af4c Adapt to new secureboot signing code
1) Register an ssh-key allowing access to the signing server
from within LAT.

2) Provide a means to bypass poat iso build signing, as the
signing should have oddured within LAT.

Story: 2009221
Task: 47358

Signed-off-by: Scott Little <scott.little@windriver.com>
Change-Id: If450ed2f67ef3e094f8370d9857c8bdf506a9571
2023-03-10 10:12:02 -05:00
Davlet Panech
7481a3b257 Better error handling for docker image sub-jobs
Currently Jenkinsfile ignores failures in sub-jobs related to docker
images (base image, wheels, etc). If they fail, the overall build
remains successful. This allows docker-related build problems remain
unnoticed.

Make this behavior conditional on a job parameter.

TESTS
==============================================
* A build where there are no docker-related errors (overall: SUCCESS)
* A build where wheels fail and SUPPRESS_DOCKER_IMAGE_BUILD_ERRORS is
  true (overall: SUCCESS)
* A build where wheels fail and SUPPRESS_DOCKER_IMAGE_BUILD_ERRORS is
  false (overall: FAIL)

Story: 2009895
Task: 47280

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: I16ac4f63033ecbc78c647c4da105d550fe2facc4
2023-02-03 16:48:11 -05:00
Scott Little
61547aeba8 Independent control of use of docker cache for builder containers
Signed-off-by: Scott Little <scott.little@windriver.com>
Change-Id: I1c00af1efb695aea7908ec415266a0f53e8444a5
2022-10-13 09:51:22 -04:00
Scott Little
72e948f751 Parameter passing to enable parallel builds and package reuse feature
Signed-off-by: Scott Little <scott.little@windriver.com>
Change-Id: I4cfe0b25480d379299c498979712b9c099ca5912
2022-10-12 15:42:26 -04:00
Davlet Panech
36303c05eb New parameter BUILD_HELM_CHARTS
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: I7ffa52b69bbfd9374829a67b6d13ed4b3a790b48
2022-10-07 12:31:19 -04:00
Davlet Panech
5fdfe8c26e PATCH_LIST: workaround for Jenkins bugs
Some versions of Jenkins crash when a multi-line parameter is empty.
Solution: set PATCH_LIST to "-" by default, and treat it as empty.

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: I7bd8f994debbfe86bc914ce469b81518ca13ea4a
2022-10-06 11:25:51 -04:00
Davlet Panech
4790af343d Allow builds to include patches
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: Ie2a417ffdce816e016659794b890936d2864d869
2022-10-03 11:40:29 -04:00
Davlet Panech
38308c6d6d Always publish image lists & latest build link
Many docker images failed to compile in StarlingX, and we never publish
the latest_docker_image_build symlink & the last build's image lists on
CENGN. As a result there's no fixed URL where we could download the
latest sucessfully-built image tags.

This patch always publishes the symlink + lists, even if some docker
images fail to compile. This is temporary until most/all problems with
stx images are resolved.

Also: try building both distroless & debian images before giving up, so
that as many build errors as possible show up in the logs

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: If18ca2c7d83db520201b6027b970431c4161ac51
2022-09-06 19:43:13 -04:00
Davlet Panech
6a038b4871 New Jenkins parameter: SHELL_XTRACE
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: Ic9c5756d3a4d0aaf103133f831c33a5d44d5efe7
2022-09-02 15:18:53 -04:00
Davlet Panech
e9e78fb22c Freeze jenkins git ref for part jobs
Main job resolves this repo's current commit, then passes that exact
commit SHA to each sub-job. This is to make sure all executed sub-jobs
are consistent with each other.

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: I20842b29accc9102fc98f63ca775b9988746e975
2022-09-02 13:27:47 -04:00
Davlet Panech
54e3620275 Publish logs even for aborted builds
This is required for the CENGN build cleanup scripts to work reliably.

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: Iec8f58a4c9ff995ebff5563b4817843cd7467f19
2022-09-02 12:50:31 -04:00
Davlet Panech
cfb8429646 Publish docker images even if the build fails
This makes sure we have (partial) image lists in the publish dir,
even if some images failed to build.

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: I1ffe33ac305d617dfca84fed2dad55322cfe5b47
2022-08-31 10:06:09 -04:00
Davlet Panech
9aab4bf431 New build step: build-export-dir
New set of scripts for generating & publlishing the "export" directory.

It allows one to specify a custom command to populate a directory with
arbitrary files, at the end of the build.

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: Ic071f395b4c1ef5ffe8a373564074e0a399ae6b8
2022-08-30 21:29:32 -04:00
Davlet Panech
70b5f57491 Ignore docker image build errors in main build
Currently errors in docker image builds fail the entire build. Docker
images are in flux, and are likely to cause every build to fail.

Workaround: don't fail the main build if some docker images failed (but
print out a warning in Jenkins log).

Changes:
- Ignore docker image build errors with a warning
- Misc changes to scripts to make sure various steps happen in the right
  order

Story: 2010226
Task: 46146

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: Ib8869ce263731f7bce3157890c303ec5cec59fde
2022-08-29 17:23:49 -04:00
Davlet Panech
c029bd2f60 Publish latest img link + rename script
* Publish "latest_docker_image_build" symlink on success
* Rename record-build-status.sh => create-latest-symlkinks.sh to better
  reflect purpose

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: Ifd938ebb6943b287b61993999f514e9f773faaa4
2022-08-22 17:25:30 -04:00
Davlet Panech
354f428724 New parameter BUILD_DOCKER_BASE_IMAGE
Story: 2010226
Task: 46050

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: I4bf59ed34e24687831db3ae87aa2b126ed0c4003
2022-08-19 19:02:59 -04:00
Davlet Panech
be58140638 Add license and copyright
Story: 2010226
Task: 46011

Change-Id: I721f1509637b910c05e4151eeb7ad7e1cb8db119
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
2022-08-15 14:16:07 -04:00
Davlet Panech
ee100b99a6 CENGN compatibility + misc changes
* moved lib/ => scripts/lib/
* moved pipelines/vars => vars/

* lib/job_utils.sh: protect /home/{localdisk,loadbuild}
* lib/publish_utils.sh: don't copy xattrs when publishing
* pipelines/monolithic.Jenkinsfile: print BUILD_OUTPUT_HOME_URL
  & PUBLISH_URL at the end
* pipelines/parts/*.Jenkinsfile: add missing job parameters
* scripts/00_junk: deleted unused directory
* scripts/{build,archive}-helm-charts.sh: don't clobber helm
  charts output with multiple invocations
* scripts/build-docker*.sh: omit --registry if not defined
* scripts/docker-login.sh:
  - handle empty registry (ie docker.io)
  - fix $DOCKER_CONFIG_FILE being absolute
* scripts/print-config.sh:
  - also print PUBLISH_URL
* scripts/record-build-status.sh:
  - add missing function "same_path"

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
2022-08-11 09:49:08 -04:00
Davlet Panech
8f1d5605c1 Allow overriding of helm charts app name
- New parameter BUILD_HELM_CHARTS
- build.conf: new parameter HELM_CHART_APPS
- monolithic.Jenkinsfile: separate out docker image steps into
  individual stages

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
2022-08-10 16:03:45 -04:00
Luis Sampaio
0f3d72e68d Declare BUILD_ISO for sub-jobs
This commit declares the BUILD_ISO variable in the
publish-package and build-packages sub jobs.

Signed-off-by: Luis Sampaio <luis.sampaio@windriver.com>
2022-08-10 16:03:45 -04:00
Davlet Panech
a70033aec7 Multi-part build Jenkins pipelines for StarlingX
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
2022-08-10 16:03:43 -04:00