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

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

                Author: ASF GitHub Bot
            Created on: 24/Jan/19 01:14
            Start Date: 24/Jan/19 01:14
    Worklog Time Spent: 10m 
      Work Description: charlesccychen commented on pull request #7563: 
[BEAM-6464] Enable docker environment for SDK workers.
URL: https://github.com/apache/beam/pull/7563#discussion_r250432572
 
 

 ##########
 File path: sdks/python/apache_beam/runners/portability/artifact_service.py
 ##########
 @@ -0,0 +1,122 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+"""Implementation of the Arrtifact{Staging,Retrieval}Service.
+
+The staging service here can be backed by any beam filesystem.
+"""
+
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function
+
+import hashlib
+import os
+import random
+import re
+
+from apache_beam.io import filesystems
+from apache_beam.portability.api import beam_artifact_api_pb2
+from apache_beam.portability.api import beam_artifact_api_pb2_grpc
+
+
+class BeamFilesystemArtifactService(
+    beam_artifact_api_pb2_grpc.ArtifactStagingServiceServicer,
+    beam_artifact_api_pb2_grpc.ArtifactRetrievalServiceServicer):
+
+  _DEFAULT_CHUNK_SIZE = 10 << 20  # 10mb
+
+  def __init__(self, root, chunk_size=_DEFAULT_CHUNK_SIZE):
+    self._root = root
+    self._chunk_size = chunk_size
+
+  def _sha256(self, string):
+    return hashlib.sha256(string.encode('utf-8')).hexdigest()
+
+  def _mkdir(self, retrieval_token):
+    dir = os.path.join(self._root, retrieval_token)
 
 Review comment:
   This will not give the correct path separator, say on Windows, and using the 
GCS filesystem (this is the case for os.path.join throughout).
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 189253)
    Time Spent: 1h  (was: 50m)

> PortableRunner should run dockerized SDK workers
> ------------------------------------------------
>
>                 Key: BEAM-6464
>                 URL: https://issues.apache.org/jira/browse/BEAM-6464
>             Project: Beam
>          Issue Type: New Feature
>          Components: sdk-py-core
>            Reporter: Robert Bradshaw
>            Assignee: Ahmet Altay
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> These can be controlled by the environment variable. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to