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


##########
sdks/java/ml/inference/build.gradle:
##########
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+plugins {
+  id("org.apache.beam.module")
+}
+applyJavaNature(
+  automaticModuleName: 'org.apache.beam.sdk.ml.inference'
+)
+provideIntegrationTestingDependencies()
+enableJavaPerformanceTesting()
+
+description = "Apache Beam :: SDKs :: Java :: ML :: Inference"
+ext.summary = "Java ML inference module"
+
+dependencies {

Review Comment:
   same here.



##########
sdks/java/ml/inference/openai/build.gradle.kts:
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+plugins {
+  id("org.apache.beam.module")
+  id("java")
+}
+description = "Apache Beam :: SDKs :: Java :: ML :: Inference :: OpenAI"
+
+dependencies {
+  implementation(project(":sdks:java:ml:inference:remote"))
+  implementation(project(":sdks:java:core"))
+
+  implementation("com.openai:openai-java:4.3.0")
+  implementation("com.fasterxml.jackson.core:jackson-core:2.20.0")

Review Comment:
   ```suggestion
     implementation library.java.jackson_databind
   ```
   
   in general we prefer `library.java...` if the dependency is managed by 
BeamModulePlugins



##########
sdks/java/ml/build.gradle:
##########
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+plugins { id 'org.apache.beam.module' }
+applyJavaNature(
+  automaticModuleName: 'org.apache.beam.sdk.ml',
+)
+provideIntegrationTestingDependencies()
+enableJavaPerformanceTesting()
+
+description = "Apache Beam :: SDKs :: Java :: ML"
+ext.summary = "Java ML module"
+
+dependencies {

Review Comment:
   Gradle views module as plain folders. No need to create this parent module 
if it is empty (just delete this file)
   
   also there is already a sdks/java/extensions/ml. It may cause confusion. I 
would suggest we put 
   
   sdks/java/ml/inference -> sdks/java/extensions/ml/inference
   
   for deduplication.



##########
settings.gradle.kts:
##########
@@ -383,3 +383,8 @@ include("sdks:java:extensions:sql:iceberg")
 findProject(":sdks:java:extensions:sql:iceberg")?.name = "iceberg"
 include("examples:java:iceberg")
 findProject(":examples:java:iceberg")?.name = "iceberg"
+
+include("sdks:java:ml:remoteinference")
+include("sdks:java:ml:inference")
+include("sdks:java:ml:inference:remote")
+include("sdks:java:ml:inference:openai")

Review Comment:
   ```suggestion
   include("sdks:java:extensions:ml:inference:remote")
   include("sdks:java:extensions:ml:inference:openai")
   ```
   
   and move under `"sdks:java:extensions:ml"`



##########
sdks/java/ml/inference/openai/build.gradle.kts:
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+plugins {
+  id("org.apache.beam.module")
+  id("java")
+}
+description = "Apache Beam :: SDKs :: Java :: ML :: Inference :: OpenAI"
+
+dependencies {
+  implementation(project(":sdks:java:ml:inference:remote"))
+  implementation(project(":sdks:java:core"))
+
+  implementation("com.openai:openai-java:4.3.0")
+  implementation("com.fasterxml.jackson.core:jackson-core:2.20.0")
+
+  testImplementation(project(":runners:direct-java"))
+  testImplementation("org.slf4j:slf4j-simple:2.0.9")

Review Comment:
   Use these:
   
   testRuntimeOnly project(path: ":runners:direct-java", configuration: 
"shadow")
   testImplementation library.java.slf4j_api
   testRuntimeOnly library.java.slf4j_simple
   testImplementation library.java.junit



##########
sdks/java/ml/inference/openai/build.gradle.kts:
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+plugins {
+  id("org.apache.beam.module")
+  id("java")
+}
+description = "Apache Beam :: SDKs :: Java :: ML :: Inference :: OpenAI"
+
+dependencies {
+  implementation(project(":sdks:java:ml:inference:remote"))
+  implementation(project(":sdks:java:core"))

Review Comment:
   ```suggestion
     implementation project(path: ":sdks:java:core", configuration: "shadow")
   ```



-- 
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