[ 
https://issues.apache.org/jira/browse/BEAM-13701?focusedWorklogId=711980&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-711980
 ]

ASF GitHub Bot logged work on BEAM-13701:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/Jan/22 11:49
            Start Date: 20/Jan/22 11:49
    Worklog Time Spent: 10m 
      Work Description: KhaninArtur commented on a change in pull request 
#16563:
URL: https://github.com/apache/beam/pull/16563#discussion_r788672842



##########
File path: playground/backend/containers/scio/Dockerfile
##########
@@ -0,0 +1,70 @@
+###############################################################################
+#  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=openjdk:8
+FROM golang:1.17-bullseye 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_scio_backend
+
+FROM $BASE_IMAGE
+ENV SERVER_IP=0.0.0.0
+ENV SERVER_PORT=8080
+ENV APP_WORK_DIR=/opt/playground/backend/
+ENV BEAM_SDK="SDK_SCIO"
+
+# Copy build result
+COPY --from=build /go/bin/server_scio_backend /opt/playground/backend/
+COPY --from=build /go/src/playground/backend/configs 
/opt/playground/backend/configs/
+COPY --from=build /go/src/playground/backend/logging.properties 
/opt/playground/backend/
+COPY --from=build /go/src/playground/backend/new_scio_project.sh 
/opt/playground/backend/
+
+# Install sbt
+RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee 
/etc/apt/sources.list.d/sbt.list &&\
+echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee 
/etc/apt/sources.list.d/sbt_old.list &&\
+curl -sL 
"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823";
 | apt-key add
+RUN apt-get update && apt-get install sbt

Review comment:
       @andreykus, could you please review this part?

##########
File path: 
playground/backend/internal/setup_tools/life_cycle/life_cycle_setuper.go
##########
@@ -143,3 +152,41 @@ func updateJavaLogConfigFile(paths fs_tool.LifeCyclePaths) 
error {
        }
        return nil
 }
+
+func prepareSbtFiles(lc *fs_tool.LifeCycle, pipelineFolder string, workingDir 
string) (*fs_tool.LifeCycle, error) {
+       cmd := exec.Command("sh", filepath.Join(workingDir, 
"new_scio_project.sh"))
+       cmd.Dir = pipelineFolder
+       _, err := cmd.Output()
+       if err != nil {
+               return nil, err
+       }
+
+       sourceFileFolder := filepath.Join(pipelineFolder, projectPath)
+       fileName := lc.Paths.SourceFileName
+       absFileFolderPath, _ := filepath.Abs(sourceFileFolder)
+       absFilePath, _ := filepath.Abs(filepath.Join(absFileFolderPath, 
fileName))
+       absLogFilePath, _ := filepath.Abs(filepath.Join(absFileFolderPath, 
logFileName))
+       projectFolder, _ := filepath.Abs(filepath.Join(pipelineFolder, 
scioProjectName))
+       executableName := lc.Paths.ExecutableName
+
+       _, err = exec.Command("rm", filepath.Join(absFileFolderPath, 
"WordCount.scala")).Output()

Review comment:
       Why is this thing hardcoded? Did you decide to delete this part per the 
conversation below?

##########
File path: 
playground/backend/internal/setup_tools/life_cycle/life_cycle_setuper_test.go
##########
@@ -33,7 +33,6 @@ const (
        javaSourceFileExtension   = ".java"
        javaCompiledFileExtension = ".class"
        pipelinesFolder           = "executable_files"
-       logFileName               = "logs.log"

Review comment:
       Doesn't it ruin any tests?

##########
File path: playground/backend/containers/scio/build.gradle
##########
@@ -0,0 +1,78 @@
+/*
+ * 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/'
+  }

Review comment:
       I believe, this thing leads to the bug, which we fix 
[here](https://github.com/apache/beam/pull/16538).

##########
File path: playground/backend/containers/scio/Dockerfile
##########
@@ -0,0 +1,70 @@
+###############################################################################
+#  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=openjdk:8
+FROM golang:1.17-bullseye 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:
       I think, there is no need for this commented line




-- 
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-unsubscr...@beam.apache.org

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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 711980)
    Time Spent: 40m  (was: 0.5h)

> Support example execution of SCIO code
> --------------------------------------
>
>                 Key: BEAM-13701
>                 URL: https://issues.apache.org/jira/browse/BEAM-13701
>             Project: Beam
>          Issue Type: Sub-task
>          Components: beam-playground
>            Reporter: Daria Malkova
>            Assignee: Daria Malkova
>            Priority: P3
>              Labels: beam-playground-backend, beam-playground-sprint-7
>          Time Spent: 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to