damccorm commented on code in PR #30605:
URL: https://github.com/apache/beam/pull/30605#discussion_r1522087790
##########
sdks/python/expansion-service-container/boot.go:
##########
@@ -145,9 +145,20 @@ func launchExpansionServiceProcess() error {
args := []string{"-m", expansionServiceEntrypoint, "-p",
strconv.Itoa(*port), "--fully_qualified_name_glob", "*"}
- if *requirements_file != "" {
- log.Printf("Received the requirements file %v",
*requirements_file)
- updatedRequirementsFileName, err :=
getUpdatedRequirementsFile(*requirements_file, *dependencies_dir)
+ // Requirements file with dependencies to install.
+ // Note that we have to look for the requirements file in the dependencies
+ // volume here not the requirements file at the top level. Latter provides
+ // Beam dependencies.
+ dependencies_requirements_file := filepath.Join(*dependencies_dir,
*requirements_file)
+ dependencies_requirements_file_exists := false
+ if _, err := os.Stat(dependencies_requirements_file); err == nil {
+ dependencies_requirements_file_exists = true
+ }
+
+ // We only try to install dependencies, if the requirements file exists.
+ if dependencies_requirements_file_exists {
Review Comment:
The indentation here seems off, this should be in line with the comment,
right?
Non-blocking for this PR, but seems like we should catch this with a go fmt
check. It would be good to bring all the boot.go files under
https://github.com/apache/beam/blob/986f67fd92b27dee0c95c5965de98ba6f84a0143/.github/workflows/go_tests.yml#L61
##########
sdks/python/expansion-service-container/boot.go:
##########
@@ -145,9 +145,20 @@ func launchExpansionServiceProcess() error {
args := []string{"-m", expansionServiceEntrypoint, "-p",
strconv.Itoa(*port), "--fully_qualified_name_glob", "*"}
- if *requirements_file != "" {
- log.Printf("Received the requirements file %v",
*requirements_file)
- updatedRequirementsFileName, err :=
getUpdatedRequirementsFile(*requirements_file, *dependencies_dir)
+ // Requirements file with dependencies to install.
+ // Note that we have to look for the requirements file in the dependencies
+ // volume here not the requirements file at the top level. Latter provides
+ // Beam dependencies.
+ dependencies_requirements_file := filepath.Join(*dependencies_dir,
*requirements_file)
+ dependencies_requirements_file_exists := false
+ if _, err := os.Stat(dependencies_requirements_file); err == nil {
+ dependencies_requirements_file_exists = true
+ }
+
+ // We only try to install dependencies, if the requirements file exists.
+ if dependencies_requirements_file_exists {
Review Comment:
For this pr, could you run `go fmt boot.go`
##########
.github/trigger_files/beam_PostCommit_TransformService_Direct.json:
##########
Review Comment:
Lets add content here and check it in like
https://github.com/apache/beam/commit/97f8dae92f2a3477dee35c38ab55d31bbc63ca63
for consistency
--
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]