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

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

                Author: ASF GitHub Bot
            Created on: 22/Apr/20 18:03
            Start Date: 22/Apr/20 18:03
    Worklog Time Spent: 10m 
      Work Description: robertwb commented on a change in pull request #11490:
URL: https://github.com/apache/beam/pull/11490#discussion_r413201320



##########
File path: sdks/go/pkg/beam/runners/universal/runnerlib/stage.go
##########
@@ -17,27 +17,127 @@ package runnerlib
 
 import (
        "context"
+       "io"
+       "os"
        "time"
 
        "github.com/apache/beam/sdks/go/pkg/beam/artifact"
+       "github.com/apache/beam/sdks/go/pkg/beam/core/runtime/graphx"
        "github.com/apache/beam/sdks/go/pkg/beam/internal/errors"
        jobpb "github.com/apache/beam/sdks/go/pkg/beam/model/jobmanagement_v1"
        "github.com/apache/beam/sdks/go/pkg/beam/util/grpcx"
+       "google.golang.org/grpc"
 )
 
 // Stage stages the worker binary and any additional files to the given
 // artifact staging endpoint. It returns the retrieval token if successful.
-func Stage(ctx context.Context, id, endpoint, binary, st string, files 
...artifact.KeyedFile) (retrievalToken string, err error) {
+func Stage(ctx context.Context, id, endpoint, binary, st string) 
(retrievalToken string, err error) {
        ctx = grpcx.WriteWorkerID(ctx, id)
        cc, err := grpcx.Dial(ctx, endpoint, 2*time.Minute)
        if err != nil {
                return "", errors.WithContext(err, "connecting to artifact 
service")
        }
        defer cc.Close()
 
+       err = StageViaPortableApi(ctx, cc, binary, st)
+
+       if err == nil {
+               return "", err
+       } else {

Review comment:
       To me it depends on whether it is "one of two+ options" (in which case 
an explicit else clause is clearer) or "exit early vs. fallback" (in which case 
not having the else is clearer). Removing the else clause for now; hopefully 
soon we'll be able to simply remove the fallback altogether. 




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

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


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

    Worklog Id:     (was: 426248)
    Time Spent: 19h 10m  (was: 19h)

> Update artifact staging and retrieval protocols to be dependency aware.
> -----------------------------------------------------------------------
>
>                 Key: BEAM-9577
>                 URL: https://issues.apache.org/jira/browse/BEAM-9577
>             Project: Beam
>          Issue Type: Improvement
>          Components: beam-model
>            Reporter: Robert Bradshaw
>            Assignee: Robert Bradshaw
>            Priority: Major
>          Time Spent: 19h 10m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to