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/11/29 14:40:39 UTC

[GitHub] [beam] pabloem commented on a change in pull request #16050: [BEAM-13307][Playground] Support Python SDK

pabloem commented on a change in pull request #16050:
URL: https://github.com/apache/beam/pull/16050#discussion_r758402665



##########
File path: playground/backend/configs/SDK_PYTHON.json
##########
@@ -0,0 +1,6 @@
+{
+  "compile_cmd": "",
+  "run_cmd": "python3",

Review comment:
       ah this is interesting - now that I think about this, we should mention in the README that to update runtime environments, we need to change these config files (we cna leave it for later)

##########
File path: playground/backend/containers/python/Dockerfile
##########
@@ -0,0 +1,51 @@
+###############################################################################
+#  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.
+###############################################################################
+ARG BASE_IMAGE=apache/beam_python3.7_sdk:latest
+ARG GO_BASE_IMAGE=golang:1.17-buster
+FROM $GO_BASE_IMAGE 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

Review comment:
       remove this line?

##########
File path: playground/backend/containers/python/build.gradle
##########
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+
+
+apply plugin: 'org.apache.beam.module'
+apply plugin: 'base'
+applyDockerNature()
+
+def playgroundJobServerProject = "${project.path.replace('-container', '')}"
+
+description = project(playgroundJobServerProject).description + " :: Container"
+
+configurations {
+  dockerDependency
+}
+
+dependencies {
+  dockerDependency project(path: playgroundJobServerProject, configuration: "shadow")
+}
+
+task copyDockerfileDependencies(type: Copy) {
+   copy {
+      from '../../../backend/'
+      into 'build/src'
+      exclude 'containers'
+   }
+   copy {
+      from 'Dockerfile'
+      into 'build/'
+   }
+   copy {
+      from '../../../playground'
+      into 'build/playground'
+   }
+}
+
+docker {
+  name containerImageName(
+          name: project.docker_image_default_repo_prefix + "playground-backend-python",
+          root: project.rootProject.hasProperty(["docker-repository-root"]) ?
+                  project.rootProject["docker-repository-root"] :
+                  project.docker_image_default_repo_root)
+  files "./build/"
+  tags containerImageTags()
+  buildArgs(['BASE_IMAGE': project.rootProject.hasProperty(["base-image"]) ?
+                           project.rootProject["base-image"] :
+                           "apache/beam_python3.7_sdk" ])

Review comment:
       let's also document the places where the Beam container version is chosen in the README (also for later)

##########
File path: settings.gradle.kts
##########
@@ -60,6 +60,7 @@ include(":playground")
 include(":playground:backend")
 include(":playground:frontend")
 include(":playground:backend:containers:java")
+include(":playground:backend:containers:python")

Review comment:
       where is the golang container? is it in review?




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