You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/10/26 00:36:50 UTC

[GitHub] [beam] tvalentyn commented on a change in pull request #15751: [BEAM-12939][Playground] Backend app - Docker container

tvalentyn commented on a change in pull request #15751:
URL: https://github.com/apache/beam/pull/15751#discussion_r736059302



##########
File path: playground/backend/containers/java/build.gradle
##########
@@ -0,0 +1,45 @@
+/*
+ * 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 'com.bmuschko.docker-remote-api' version '6.7.0'
+}
+import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage

Review comment:
       FWIW, we are using a different plugin in other parts of Beam:
   
   https://github.com/apache/beam/blob/fd4eb15d659e82bd370bd8d7cd7cb5f8fd174cbd/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy#L1804
   
   Example: https://github.com/apache/beam/blob/243128a8fc52798e1b58b0cf1a271d95ee7aa241/runners/flink/job-server-container/flink_job_server_container.gradle#L55
   
   Do you have thoughts about pros/cons for these plugins? there may be some advantage to sticking to one of them.
   

##########
File path: playground/backend/containers/java/Dockerfile
##########
@@ -16,4 +16,36 @@
 # limitations under the License.
 ###############################################################################
 
-#Dokerfile to set up the Beam Java SDK
\ No newline at end of file
+FROM golang:1.17-buster AS build
+
+# Setup Go Environment
+ENV GOPATH /go
+ENV PATH $GOPATH/bin:$PATH
+RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
+RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1 &&\
+    go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1
+
+# Prepare Application
+COPY src /go/src/playground/backend
+COPY playground /go/src/playground/playground
+WORKDIR /go/src/playground/backend
+
+# Build Application
+RUN go mod download &&\
+    go mod tidy &&\ 
+    cd cmd/server &&\
+    go build -o /go/bin/server_java_backend 
+
+FROM apache/beam_java8_sdk:2.33.0

Review comment:
       How do we plan to update the versions? Would it make sense to make them external (passed via ARG)?




-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org