pavel-avilov commented on a change in pull request #16484:
URL: https://github.com/apache/beam/pull/16484#discussion_r790917634
##########
File path: playground/backend/cmd/server/controller.go
##########
@@ -294,3 +299,29 @@ func (controller *playgroundController)
GetPrecompiledObjectLogs(ctx context.Con
response := pb.GetPrecompiledObjectLogsResponse{Output: logs}
return &response, nil
}
+
+// GetDefaultPrecompiledObject returns the default precompile object for sdk.
+func (controller *playgroundController) GetDefaultPrecompiledObject(ctx
context.Context, info *pb.GetDefaultPrecompiledObjectRequest)
(*pb.GetDefaultPrecompiledObjectResponse, error) {
+ switch info.Sdk {
+ case pb.Sdk_SDK_UNSPECIFIED, pb.Sdk_SDK_SCIO:
+ logger.Errorf("GetDefaultPrecompiledObject(): unimplemented
sdk: %s\n", info.Sdk)
+ return nil, errors.InvalidArgumentError("Error during
preparing", "Sdk is not implemented yet: %s", info.Sdk.String())
+ }
+
+ defaultPrecompiledObjects, err := controller.cacheService.GetValue(ctx,
uuid.Nil, cache.DefaultPrecompiledObjects)
Review comment:
Done.
##########
File path: playground/backend/internal/environment/environment_service.go
##########
@@ -178,10 +178,12 @@ func ConfigureBeamEnvs(workDir string) (*BeamEnvs, error)
{
sdk = pb.Sdk_SDK_PYTHON
case pb.Sdk_SDK_SCIO.String():
sdk = pb.Sdk_SDK_SCIO
+ default:
+ return nil, errors.New("incorrect value of sdk in the
environment")
}
}
if sdk == pb.Sdk_SDK_UNSPECIFIED {
- return nil, errors.New("env BEAM_SDK must be specified in the
environment variables")
+ return NewBeamEnvs(sdk, nil, preparedModDir,
numOfParallelJobs), nil
Review comment:
Done.
--
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]