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/21 23:11:04 UTC

[GitHub] [beam] pabloem commented on a change in pull request #15770: [BEAM-13095][Playground] Using working directory from environment in LifeCycle instead of using hardcoded backend directory

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



##########
File path: playground/backend/internal/fs_tool/fs.go
##########
@@ -53,23 +51,19 @@ type LifeCycle struct {
 }

Review comment:
       Can you add some more explicit documentation about the `Folder`, `Extension` and `LifeCycle` types - if possible for each member, so that it's easier to understand what they are used for

##########
File path: playground/backend/internal/fs_tool/fs.go
##########
@@ -53,23 +51,19 @@ type LifeCycle struct {
 }
 
 // NewLifeCycle returns a corresponding LifeCycle depending on the given SDK.
-func NewLifeCycle(sdk pb.Sdk, pipelineId uuid.UUID) (*LifeCycle, error) {
+func NewLifeCycle(sdk pb.Sdk, pipelineId uuid.UUID, workingDir string) (*LifeCycle, error) {

Review comment:
       do we assume that the `workingDir` has to already exist and be configured before creating a `LifeCycle`? Can we document this please?

##########
File path: playground/backend/internal/fs_tool/java_fs.go
##########
@@ -21,14 +21,14 @@ import (
 )
 
 const (
-	javaBaseFileFolder          = parentBaseFileFolder + "/executable_files"
+	javaBaseFileFolder          = "executable_files"
 	javaExecutableFileExtension = "java"
 	javaCompiledFileExtension   = "class"
 )
 
 // newJavaLifeCycle creates LifeCycle with java SDK environment.
-func newJavaLifeCycle(pipelineId uuid.UUID) *LifeCycle {
-	baseFileFolder := fmt.Sprintf("%s_%s", javaBaseFileFolder, pipelineId)
+func newJavaLifeCycle(pipelineId uuid.UUID, workingDir string) *LifeCycle {
+	baseFileFolder := fmt.Sprintf("%s/%s/%s", workingDir, javaBaseFileFolder, pipelineId)

Review comment:
       It seems that the `filepath` package can perform these joins of directory/file names: https://pkg.go.dev/path/filepath#Join
   
   You don't need to make the change in all code files, but can you make the change in this one file?




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