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

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

                Author: ASF GitHub Bot
            Created on: 06/Feb/20 21:41
            Start Date: 06/Feb/20 21:41
    Worklog Time Spent: 10m 
      Work Description: chamikaramj commented on pull request #10621: 
[BEAM-9056] Staging artifacts from environment
URL: https://github.com/apache/beam/pull/10621#discussion_r376097045
 
 

 ##########
 File path: 
runners/portability/java/src/main/java/org/apache/beam/runners/portability/PortableRunner.java
 ##########
 @@ -203,11 +146,33 @@ public PipelineResult run(Pipeline pipeline) {
           prepareJobResponse.getArtifactStagingEndpoint();
       String stagingSessionToken = prepareJobResponse.getStagingSessionToken();
 
+      ImmutableList.Builder<StagedFile> filesToStageBuilder = 
ImmutableList.builder();
+      for (Map.Entry<String, RunnerApi.Environment> entry :
+          pipelineProto.getComponents().getEnvironmentsMap().entrySet()) {
+        for (RunnerApi.ArtifactInformation info : 
entry.getValue().getDependenciesList()) {
+          if 
(BeamUrns.getUrn(RunnerApi.StandardArtifacts.Types.FILE).equals(info.getUrn())) 
{
+            RunnerApi.ArtifactFilePayload filePayload;
+            try {
+              filePayload = 
RunnerApi.ArtifactFilePayload.parseFrom(info.getPayload());
+            } catch (InvalidProtocolBufferException e) {
+              throw new RuntimeException("Error parsing artifact file 
payload.", e);
+            }
+            filesToStageBuilder.add(
+                StagedFile.of(new File(filePayload.getLocalPath()), 
filePayload.getStagedName()));
+          } else {
+            throw new RuntimeException(
+                String.format("expect file artifact type but %s", 
info.getUrn()));
 
 Review comment:
   "Unsupported artifact type ..." might be a better error here.
 
----------------------------------------------------------------
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: 383176)
    Time Spent: 40m  (was: 0.5h)

> Staging artifacts from environment
> ----------------------------------
>
>                 Key: BEAM-9056
>                 URL: https://issues.apache.org/jira/browse/BEAM-9056
>             Project: Beam
>          Issue Type: Sub-task
>          Components: java-fn-execution
>            Reporter: Heejong Lee
>            Assignee: Heejong Lee
>            Priority: Major
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> staging artifacts from artifact information embedded in environment proto.
> detail: 
> https://docs.google.com/document/d/1L7MJcfyy9mg2Ahfw5XPhUeBe-dyvAPMOYOiFA1-kAog



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

Reply via email to