Skip to content
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

feat(DBZ-7551): avoid overriding MAVEN_DEP_DESTINATION in connect image #367

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

razvanz
Copy link
Contributor

@razvanz razvanz commented Feb 21, 2024

By relying on the KAFKA_CONNECT_PLUGINS_DIR in the docker-maven-download.sh (connect-base image), overwriting the MAVEN_DEP_DESTINATION can be avoided in the connect image.

This prevents the need to revert this override in decendant images, allowing for a clear distinction between KAFKA_CONNECT_PLUGINS_DIR, MAVEN_DEP_DESTINATION and EXTERNAL_LIBS_DIR.

@jpechane
Copy link
Contributor

@razvanz
Copy link
Contributor Author

razvanz commented Feb 21, 2024

@razvanz Hi, this change breaks the release process, please see https://github.com/debezium/debezium/blob/main/jenkins-jobs/pipelines/release/release-pipeline.groovy#L489

From what I gather, only these 2 lines are breaking. MAVEN_DEP_DESTINATION does not appear to be used, so would the PR be valid if I revert those 2 lines?

@Naros
Copy link
Member

Naros commented Feb 22, 2024

@razvanz Hi, this change breaks the release process, please see debezium/debezium@main/jenkins-jobs/pipelines/release/release-pipeline.groovy#L489

From what I gather, only these 2 lines are breaking. MAVEN_DEP_DESTINATION does not appear to be used, so would the PR be valid if I revert those 2 lines?

I don't see any immediate issue, but I defer to @jpechane here. One thing I will add, though, is this should be recorded with a Jira issue and marked with an "add to migration guide" label. This guarantees that we at least add something to the release notes about this change in the smallest chance that users may have their own descendent builds that rely on the directory of MAVEN_DEP_DESTINATION and they should instead rely on KAFKA_CONNECT_PLUGINS_DIR so that their own builds remain consistent.

@@ -17,6 +17,7 @@ set -e
MAVEN_REPO_CENTRAL=${MAVEN_REPO_CENTRAL:-"https://repo1.maven.org/maven2"}
MAVEN_REPOS_ADDITIONAL=${MAVEN_REPOS_ADDITIONAL:-""}
MAVEN_REPO_CONFLUENT=${MAVEN_REPO_CONFLUENT:-"https://packages.confluent.io/maven"}
KAFKA_CONNECT_PLUGINS_DIR=${$KAFKA_CONNECT_PLUGINS_DIR}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should here be really twodollar signs?

Copy link
Member

Choose a reason for hiding this comment

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

What about the case where I want to install to another dir than KAFKA_CONNECT_PLUGINS_DIR but without moving KAFKA_CONNECT_PLUGINS_DIR? I think that is/was the main reason for having it as separate env vars?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should here be really twodollar signs?

No. Fixed!

What about the case where I want to install to another dir than KAFKA_CONNECT_PLUGINS_DIR but without moving KAFKA_CONNECT_PLUGINS_DIR? I think that is/was the main reason for having it as separate env vars?

IMO, the destination directory should be an argument rather than being inferred from the dependency type. This will make this script simpler and it will be easier to follow where libs are downloaded in the docker images.

@jpechane
Copy link
Contributor

@razvanz Hi, yes, the PR can be cleaned up to make it logically correct. But please pay attention to @Naros recommendations about Jira. Thanks a in advance!

@razvanz razvanz changed the title feat: avoid overriding MAVEN_DEP_DESTINATION in connect image feat(DBZ-7551): avoid overriding MAVEN_DEP_DESTINATION in connect image Feb 22, 2024
@razvanz
Copy link
Contributor Author

razvanz commented Feb 22, 2024

@Naros and @jpechane I've created a corresponding JIRA issue and connected it with the title of this PR: https://issues.redhat.com/browse/DBZ-7551

@Naros
Copy link
Member

Naros commented Feb 22, 2024

Hi, @razvanz; please prefix all your commits with the DBZ-7551 issue tag. Thanks!.

By relying on the KAFKA_CONNECT_PLUGINS_DIR in the
docker-maven-download.sh (connect-base image), overwriting the
MAVEN_DEP_DESTINATION can be avoided in the connect image.

This prevents the need to revert this override in decendant images,
allowing for a clear distinction between KAFKA_CONNECT_PLUGINS_DIR,
MAVEN_DEP_DESTINATION and EXTERNAL_LIBS_DIR.
@@ -6,7 +6,6 @@ LABEL maintainer="Debezium Community"
ENV DEBEZIUM_VERSION="2.6.0.Alpha2" \
MAVEN_REPO_CENTRAL="" \
MAVEN_REPOS_ADDITIONAL="" \
MAVEN_DEP_DESTINATION=$KAFKA_CONNECT_PLUGINS_DIR \
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I continue the previous discussion here in this line. In the essence of this PR, aren't we actually talking about this change here? We are now always defaulting to KAFKA_CONNECT_PLUGINS_DIR without any option to install to another destination directory, where previously we could customize.
@jpechane what about special dirs outside KAFKA_CONNECT_PLUGINS_DIR (which are also not lib) things like a scripting package, Apicurio, and other things that sometimes get symlinked into libs or the plugins dir based on env vars? Won't this be affected?

Copy link
Member

Choose a reason for hiding this comment

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

Those are already handled by the EXTERNAL_LIBS_DIR configuration option, which is what apicurio does here and OpenTelemetry does here.

Copy link
Contributor

Choose a reason for hiding this comment

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

As every type of dependency is handled by a seperate function it makes sense to remove the common env var and use only the specific ones.

@jpechane jpechane merged commit 3e5402f into debezium:main Feb 28, 2024
5 checks passed
@jpechane
Copy link
Contributor

@razvanz Applied, thanks.

@rk3rn3r
Copy link
Member

rk3rn3r commented Feb 28, 2024

@jpechane I wonder why this got merged after our recent discussion. Didn't we mean to make the dir configurable by parameter instead of just making the directory fixed to the Kafka plugins dir? Is there a follow-up Jira?

@jpechane
Copy link
Contributor

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.

4 participants