Skip to content

feat: move patch apply logic to patchable #1032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Apr 24, 2025

Conversation

dervoeti
Copy link
Member

Description

This is a draft PR to solve #677. I replaced the apply_patches.sh script with Patchable for Zookeeper and Druid.

We decided in https://github.com/stackabletech/decisions/issues/44 that all sources should be mirrored on Github (to be implemented by #1011).

My idea was that we can just reuse the existing checkout logic, since it does exactly what we want: checkout a repo at a specific commit and apply a bunch of .patch files on top of it. In this PR, the original Apache repositories are used, those would need to be replaced by our mirror repos.

I added an optional flag --images_repo_root to manually specify a custom root for the images repo instead of relying on the auto-detection that Patchable currently does. We could also just use the auto-detection, but then we'd probably need to run git init && touch .patchable before running the patchable checkout command inside the container, which is a bit awkward. The extra flag isn't super pretty either though and I couldn't get around using PathBuf in the implementation, hence I made this a draft PR to serve as a PoC. This is just one way we could replace the patch scripts with Patchable. Maybe this can be solved in a more elegant way, I didn't find one yet though.

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes
- [ ] Changes are OpenShift compatible
- [ ] All added packages (via microdnf or otherwise) have a comment on why they are added
- [ ] Things not downloaded from Red Hat repositories should be mirrored in the Stackable repository and downloaded from there
- [ ] All packages should have (if available) signatures/hashes verified
- [ ] Add an entry to the CHANGELOG.md file
- [ ] Integration tests ran successfully
TIP: Running integration tests with a new product image

The image can be built and uploaded to the kind cluster with the following commands:

bake --product <product> --image-version <stackable-image-version>
kind load docker-image <image-tagged-with-the-major-version> --name=<name-of-your-test-cluster>

See the output of bake to retrieve the image tag for <image-tagged-with-the-major-version>.

@dervoeti dervoeti requested a review from nightkr March 18, 2025 11:53
@dervoeti dervoeti force-pushed the feat/move-patch-apply-logic-to-patchable branch from 2d20b52 to 1efa478 Compare March 21, 2025 12:34
@dervoeti dervoeti force-pushed the feat/move-patch-apply-logic-to-patchable branch from 1efa478 to bdc6dfd Compare March 21, 2025 12:35
@dervoeti dervoeti requested a review from nightkr March 21, 2025 14:06
@dervoeti
Copy link
Member Author

@nightkr It's ready for another round of feedback 🙂 Once it's in a good shape I'll start adapting the patch processes of the other products.

Copy link
Member

@nightkr nightkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Largely LGTM

@dervoeti dervoeti marked this pull request as ready for review March 31, 2025 10:49
@dervoeti dervoeti requested a review from nightkr March 31, 2025 10:49
@dervoeti
Copy link
Member Author

@nightkr I migrated all Dockerfiles now and tested all builds using the latest versions of the product, worked fine.

dervoeti added 3 commits April 9, 2025 15:06
…into feat/move-patch-apply-logic-to-patchable
…into feat/move-patch-apply-logic-to-patchable
…into feat/move-patch-apply-logic-to-patchable
@dervoeti dervoeti requested a review from nightkr April 14, 2025 15:35
Copy link
Member

@nightkr nightkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if it builds for you.

@dervoeti dervoeti added this pull request to the merge queue Apr 24, 2025
Merged via the queue into main with commit 5bf5149 Apr 24, 2025
3 checks passed
@dervoeti dervoeti deleted the feat/move-patch-apply-logic-to-patchable branch April 24, 2025 13:59
labrenbe pushed a commit that referenced this pull request May 8, 2025
* wip

* Update druid/Dockerfile

Co-authored-by: Natalie Klestrup Röijezon <[email protected]>

* fix: remove unnecessary check / shadow repo root var

* fix: druid src path

* fix: druid src path

* feat: introduce stackable-devel image

* fix: use PathBuf in ProductVersionContext

* chore: align zookeeper patch directory structure

* fix: stackable-devel dnf and shell config

* chore: switch patch process in other products

* fix: hive build

* fix: trino build

* fix: spark build

* chore: make hadolint happy

* fix: remove hbase intermediate sources / remove unnecessary and operator

* fix: permissions in patchable build process

* chore: remove unnecessary curl command in build process

* chore: move adding of JMX config and start-metastore script from builder stage to final stage

* chore: remove git repo in trino and hbase-operator-tools to avoid maven commit plugin bug

---------

Co-authored-by: Natalie Klestrup Röijezon <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request May 19, 2025
* build nifi-opa-plugin from source with workaround

* add changelog entry

* add patch

* build nifi-opa-plugin from branch feat/reworked-opa-response

* Update nifi/Dockerfile

Co-authored-by: Malte Sander <[email protected]>

* chore(⏲): Use fast download mirrors (#1061)

* chore: Use fast download mirrors

* chore: Show download progress bar

* chore: Improve gpg key warning message

* chore: Show upload progress bar

Thanks to <https://bashupload.com/how_to_upload_progress_curl>

* Apply suggestions from code review

Co-authored-by: Techassi <[email protected]>

* chore: Make output more consistent

---------

Co-authored-by: Techassi <[email protected]>

* chore(⏲): Add missing tool update tasks to templates (#1062)

* chore(issue_templates): Use YY.M.X placeholders

* chore(issue_templates): Remove tasklists

:sob:

* chore(issue_templates): Add missing tool update tasks for cyclonedx and auditable

* feat: move patch apply logic to patchable (#1032)

* wip

* Update druid/Dockerfile

Co-authored-by: Natalie Klestrup Röijezon <[email protected]>

* fix: remove unnecessary check / shadow repo root var

* fix: druid src path

* fix: druid src path

* feat: introduce stackable-devel image

* fix: use PathBuf in ProductVersionContext

* chore: align zookeeper patch directory structure

* fix: stackable-devel dnf and shell config

* chore: switch patch process in other products

* fix: hive build

* fix: trino build

* fix: spark build

* chore: make hadolint happy

* fix: remove hbase intermediate sources / remove unnecessary and operator

* fix: permissions in patchable build process

* chore: remove unnecessary curl command in build process

* chore: move adding of JMX config and start-metastore script from builder stage to final stage

* chore: remove git repo in trino and hbase-operator-tools to avoid maven commit plugin bug

---------

Co-authored-by: Natalie Klestrup Röijezon <[email protected]>

* fix: add missing patchable config for Kafka 3.8.0 (#1065)

* fix(pr-template): Fix the rendering of the list (#1073)

* feat: make image namespace a workflow input (default sdp) (#1072)

* feat: make image namespace a workflow input (default sdp)

* feat: add registry namespace input to build workflows and remove default

* ci(mirror): Include image name and version in run-name (#1089)

* ci(mirror): Include image and version in run-name

* chore: Use colon

* fix: spark connect client Harbor credentials (#1088)

* fix: spark connect client Harbor credentials (#1092)

* feat: connect client image includes JupyterLab (#1071)

* feat: install demo dependencies

* spark-connect-client is now built directly off of spark-k8s

* run pre-commit hooks

* fix shellcheck sc2102

* chore: Bump tools ahead of 25.7.0 (#1090)

* chore(jmx_exporter): Bump products to use 1.2.0

* chore(tools): Bump kubectl (1.33.0 and yq (4.45.2)

* chore(cyclonedx-bom): Bump to 6.0.0

* chore: Update changelog

* chore: Changelog formatting

* chore(java): Add JDK 24 (#1097)

* chore(java): Add JDK 24

* chore: Update changelog

* chore(vector): Bump to 0.46.1 (#1098)

* chore(vector): Bump to 0.46.1

* chore(vector): Bump products to use 0.46.1

* chore(zookeeper): Remove 3.9.2 (#1093)

* chore: Changelog formatting

* chore(zookeeper): Remove 2.9.2

* chore: Update changelog

* chore: Update changelog

* chore(ubi-rust-builders): Update container images ahead of Stackable Release 25.7.0 (#1091)

* chore(ubi-rust-builders): Remove ubi8-rust-builder

* chore(ubi-rust-builders): Update base image and use protoc 30.2

* Apply suggestions from code review

Co-authored-by: Techassi <[email protected]>
Co-authored-by: Sebastian Bernauer <[email protected]>

---------

Co-authored-by: Techassi <[email protected]>
Co-authored-by: Sebastian Bernauer <[email protected]>

* chore(opa): Update versions ahead of 25.7.0 (#1103)

* chore(opa): Remove 0.67.1

* chore(opa): Remove legacy bundle-builder

* chore(opa): Bump ubi9 base image

* chore(opa): Add 1.4.2

* fix(opa): Manually install Go version

NOTE: The dnf package was 1.23.6 and OPA required 1.23.8
NOTE: I tried making the version paramaterized, but bake wouldn't allow
it (it worked fine with `docker build` and `docker build xbuild`).

* ci(mirror): Add golang

* chore(opa): Use mirrored golang image

* chore(opa): Parameterise golang container version

* chore: Update changelog

* fix: Bump vector to 0.46.1 for java-base:24 (#1104)

* chore(superset): Add 4.1.2 (#1102)

* chore(superset): Add 4.1.2

* fix(superset): Remove invalid parts of the file

* chore: Update changelog

* feat(nifi): Add nifi-iceberg-bundle (#1060)

* feat(nifi): Add nifi-iceberg-bundle

* changelog

* Add SBOM to final image

* Use version 0.0.1

* hadolint

* Bump to 0.0.2

* Bump to 0.0.3

* fix(nifi): Delete correct intermediate folder (#1106)

* fix(nifi): Delete correct intermediate folder

* changelog

* fix Dockerfile

* build nifi opa plugin from tag

* Update CHANGELOG.md

Co-authored-by: Malte Sander <[email protected]>

* fix hadolint

* Update nifi/Dockerfile

Co-authored-by: Malte Sander <[email protected]>

---------

Co-authored-by: Malte Sander <[email protected]>
Co-authored-by: Nick <[email protected]>
Co-authored-by: Techassi <[email protected]>
Co-authored-by: Lukas Krug <[email protected]>
Co-authored-by: Natalie Klestrup Röijezon <[email protected]>
Co-authored-by: Razvan-Daniel Mihai <[email protected]>
Co-authored-by: Sebastian Bernauer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants