aboutsummaryrefslogtreecommitdiff
path: root/kolla/image/kolla_worker.py
AgeCommit message (Collapse)AuthorFilesLines
2026-09-22Merge "Allow lowercase from"Zuul1-2/+3
2026-09-10Drop support for CentOS Stream 10Michal Nasiadka1-1/+1
Change-Id: I5973943fe83bbb00cfc8623c0cd4d4b98b369315 Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
2026-08-05Add cleanup_repos to revert build_only overridesMichal Nasiadka1-0/+1
Repos marked build_only: true are backed up before handle_repos() overwrites them and restored at the end of each image build, so CI mirror URLs are not baked into the final image. The cleanup RUN was injected into every Dockerfile, not just images that called handle_repos() for those repos. Child images with no backup fell through to "rm -f", deleting the inherited repo file (e.g. debian.sources in bifrost-base, breaking cpio install). Fix by adding a {repo}.enabled sentinel that handle_repos creates when it processes a build_only repo, making the cleanup conditional on that sentinel. Change-Id: Ie5b9970a4575b6258dc238059d3f33ddfe155789 Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
2026-07-30Allow lowercase fromMichal Nasiadka1-2/+3
Change-Id: I42cf2aac795e9f61692deec956de0bedab55086f Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
2026-07-30Move PIP_* env variables to ARG and configMichal Nasiadka1-0/+15
Leaving empty CI template_overrides file in case we need to use it in future. Change-Id: Ic46f1a594bcc330536bc78d93ece10e60622f6d4 Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
2026-07-06Migrate to pyproject.tomlMichal Nasiadka1-0/+3
[tool.setuptools.data-files] does not support recursive directory installation. The old setup.cfg [files] worked because PBR's FilesConfig.expand_globs() used os.walk() to expand docker/*, but this hook is not triggered by the pbr.build PEP-517 backend. Move docker/ into kolla/ and use [tool.setuptools.package-data] instead. Update kolla_worker._get_images_dir() to check the kolla package directory first so both editable and regular installs work. Change-Id: I4fc452c03740ef22ebbb4e8d0d86c4f4783e2d09 Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
2026-06-24kolla-build: fix build-date LABEL invalidating Docker layer cacheMichal Nasiadka1-4/+0
The build-date label was rendered into a LABEL instruction on line 3 of every Dockerfile template, immediately after FROM. Because Docker invalidates the cache for a changed instruction and all subsequent layers, a date change caused a full rebuild of every image on each new calendar day, even when nothing else had changed. Fix this by removing build-date from the Dockerfile templates and applying it as a --label argument at build time via image.labels. Labels passed on the build command line are not part of the Dockerfile cache key, so the date is still recorded in the image metadata without affecting layer caching. Change-Id: I8ef0d85bab1a999a4d09f7cbf0c088ca00fdcf77 Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
2026-06-10kolla-build: Use SandboxedEnvironment to prevent SSTIMichal Nasiadka1-2/+3
Switch from jinja2.Environment to jinja2.sandbox.SandboxedEnvironment to block Server-Side Template Injection attacks. Closes-Bug: #2146056 Change-Id: Iecd1d8dcf99007e3339120961c7c1d0ca12f83d8 Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
2026-03-30Add OCI standard labels to container imagesPiotr Milewski1-3/+71
Currently, Kolla images lack standard metadata, making it difficult to identify their build source, creation time, or exact version solely by inspecting the image artifact. This patch introduces the addition of Open Container Initiative (OCI) standard labels to all generated images. The build process now detects metadata (utilizing `direct_url.json` for pip-installed packages to avoid subprocess calls) and injects the following labels into the container runtime config: * org.opencontainers.image.authors * org.opencontainers.image.created * org.opencontainers.image.description * org.opencontainers.image.licenses * org.opencontainers.image.revision * org.opencontainers.image.source * org.opencontainers.image.title * org.opencontainers.image.url * org.opencontainers.image.version Example output: "Labels": { "org.opencontainers.image.authors": "Kolla Project (https://launchpad.net/kolla)", "org.opencontainers.image.created": "2025-12-22T14:02:47.015819", "org.opencontainers.image.description": "OpenStack Kolla keystone-ssh image", "org.opencontainers.image.licenses": "Apache-2.0", "org.opencontainers.image.revision": "96b54022857ccef8dc6bb11789abe32119827109", "org.opencontainers.image.source": "https://opendev.org/openstack/kolla", "org.opencontainers.image.title": "keystone-ssh", "org.opencontainers.image.url": "https://opendev.org/openstack/kolla", "org.opencontainers.image.version": "master-ubuntu-noble" } This enhancement improves the interoperability of Kolla images with standard container tools and registries that display OCI metadata. Change-Id: I3451940c90180ba91759c839987434e94251e32e Signed-off-by: Piotr Milewski <vurmil@gmail.com>
2025-09-23debian: Use {{ openstack_release_codename }} for extrepoMichal Nasiadka1-0/+3
Change-Id: I5e89a9a241f746a2cbab723ea5fc57ea65ad5ee5 Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
2025-02-18Allow to use configure_user macro for external templatesAndriy Kurilin1-1/+12
Commit 79a234239516b94b1b79c7ddafcc4fbe4e3ba155 introduced an ability to build 'in-house'/'not-built-in' projects with Kolla. This commits extends this feature with an ability to use configure_user macro for 'not-built-in' users. The implementation is done the same way as for 'sources', i.e. engine after registers new section structure as soon as it finds unknown '<project>-user' section. In addition, the documentation and CI are extended to cover ``--docker-dir`` option. Change-Id: I690d9f3829083f2493bf286a1c45764b9699219b
2024-11-15Add mechanism for patching files in containersMichal Arbet1-1/+32
This patch adds a way to patch files in a Docker image built by Kolla. This is very useful for several reasons, specifically: - Custom modifications - The stable branch of some library has a fix but no pip package has been released - Eliminates the need to package your own pip packages - Eliminates the need to invent your own versioning to prevent upstream versioning - Eliminates the need to manage a pip server - In other words, it eliminates the need to get a wheel into the image and install it manually using any method not previously mentioned It is also highly desirable because, although Kolla can replace the source for a service with a custom URL for a tarball or its own Git repo, it cannot do this for dependencies pulled from pip. I would also like to point out that this is a feature with its own code path and works only if the user "inserts" a patch into the folder patches/docker-image/something.patch and creates an analogous series file for patch source code. Simply said, this code will never interfere with the upstream build process since this feature is not intended for use in upstream. It is rather meant for downstream users who know what they are doing. Now they just have an option to patch their images. Everything works on all layers of the Docker image and stores a report of applied patches which can then be seen in /etc. This mechanism is similar as debian patch quilt. Change-Id: I61d0790c5d4d070b7ea9e8c99c0a76ff5d22bf9d
2024-10-24CI: bump hackingMichal Nasiadka1-2/+2
Change-Id: I5f2177b7c2edc0e35ed2e8e9bdfc4be2f262309f
2024-09-19Switch to Dynamic Python Version DetectionMichal Arbet1-8/+0
This commit removes the hardcoded KOLLA_DISTRO_PYTHON_VERSION and replaces it with dynamic Python version detection during container images build. Dockerfiles and scripts now use general python3 references, simplifying maintenance and ensuring compatibility with future Python versions. Test cases relying on distro_python_version were also cleaned up. Change-Id: I891749598247a5e951ed4a873b16acfd0566f59c
2024-02-21Move curl sources to sources.pyMichal Nasiadka1-0/+1
Move most curl sources to sources.py, so it can be automatically updated in future. This also makes overriding the versions/locations/sha256 easier. Change-Id: Ib3497fe96162ae190e5c113cacaaa3ef8334f590
2023-12-21Merge "Summary JSON file"Zuul1-0/+20
2023-08-28Transition to DockerClientMichal Nasiadka1-2/+2
Change to use docker.DockerClient instead of the low level docker.APIClient. Signed-off-by: Konstantin Yarovoy <konstantin.yarovoy@tietoevry.com> Change-Id: I88842c17d8e6ddbe89b984c7b5e0367ed356fa50
2023-08-18Move to Debian 12 'bookworm'Marcin Juszkiewicz1-1/+1
We move to use some components from distribution instead of 3rdparty repos. At least for now - this may/will change later. Packages from Debian: - Erlang 25.2 - MariaDB 10.11 Some Ubuntu/jammy repositories are used in places where there is not (yet) Debian/bookworm one. openvswitch-netcontrold image fails as it needs to be converted to use virtualenv - added into unbuildable images for now. See https://etherpad.opendev.org/p/kolla-bobcat-ptg#L199 for more information. Depends-On: https://review.opendev.org/891946 Change-Id: I45b5a5980fb2318f1aab23a3a6aaf0922563b171
2023-04-27Summary JSON fileMark Goddard1-0/+20
Add support for writing the build summary to a JSON file. This is more machine-friendly than the current approach of writing to standard output at the end of the build. The file is configured via [DEFAULT] summary_json_file. Change-Id: I9868af5d00977750d0673fc48f8863a99f878dc8
2022-11-08Add a way to add other container enginesMarcin Juszkiewicz1-16/+17
Add engine adapter module to allow additon of other container engines, create one common EngineClient that would be called in all other modules. Based on patch by Konstantin Yarovoy <konstantin.yarovoy@tietoevry.com> Change-Id: Ice6467086bd292af086322afc3fc4e869d89eefa
2022-10-27Fix incorrect type conversion for cmd option '--docker-dir'Radoslaw Smigielski1-2/+3
kolla-build cmd '--docker-dir' option specified a default value of an empty list, this was causing a warning on tox genconfig. Change-Id: I204a067d76395ef5ad4d3ce23243f196eab3bdd5 Closes-Bug: #1827146
2022-10-06Move KollaWorker stuff to separate fileMarcin Juszkiewicz1-0/+764
As part of kolla/image/ refactoring we move KollaWorker related classes into own file. Based on patch by Konstantin Yarovoy <konstantin.yarovoy@tietoevry.com> Change-Id: I55c3f6b34631048b2463b02e6ea611d7e4c1a912