Abacn commented on code in PR #28756:
URL: https://github.com/apache/beam/pull/28756#discussion_r1344647578


##########
buildSrc/src/main/groovy/org/apache/beam/gradle/BeamDockerPlugin.groovy:
##########
@@ -0,0 +1,325 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.gradle
+
+import java.util.regex.Pattern
+import org.gradle.api.GradleException
+import org.gradle.api.Plugin
+import org.gradle.api.Project
+import org.gradle.api.Task
+import org.gradle.api.file.CopySpec
+import org.gradle.api.logging.LogLevel
+import org.gradle.api.logging.Logger
+import org.gradle.api.logging.Logging
+import org.gradle.api.tasks.Copy
+import org.gradle.api.tasks.Delete
+import org.gradle.api.tasks.Exec
+
+/**
+ * A gradle plug-in interacting with docker. Originally replicated from

Review Comment:
   We have to vendor the following gradle plugins
   
   - com.palantir.docker -> BeamDockerPlugin
   - com.palantir.docker-run -> BeamDockerRunPlugin
   
   Due to
   - v0.34.0 used gradle internal API that incompatible with gradle 8
   - v0.35.0 requries Java11; recompile from src does not work either because 
the plugin depends on other palantir dependencies which also requires Java11
   - palantir/gradle-docker is now marked as `Disclaimer: This Repo is now 
Defunct`, "although we will keep it working, no new features are accepted"
   
   We can choose another plugin, but it would require substantial change to the 
code base, and the risk of support stopped on any third party plugin remains
   
   If palantir/gradle-docker still get maintained and beam eventually drops 
Java 8 support, we can still come back to this plugin.
   
   Fortunately beam only uses moderate functionality in palantir/gradle-docker 
so vendor is straightforward. The artifact provides  3 plugins
   
   - com.palantir.docker
   - com.palantir.docker-run
   - com.palantir.docker-compose
   
   beam only uses the first two. The third is the most complicated one and 
depends on gradle internal APIs; in docker plugin, there is a `dockerfileZip` 
task also involves gradle internal API. Beam uses neither - and there are not 
included in this PR
   
   The two vendored plugins here then get rid of gradle internal APIs and work 
with Gradle 8 while keep build with Java 8.
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to