[ https://issues.apache.org/jira/browse/BEAM-8402?focusedWorklogId=339568&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-339568 ]
ASF GitHub Bot logged work on BEAM-8402: ---------------------------------------- Author: ASF GitHub Bot Created on: 06/Nov/19 19:56 Start Date: 06/Nov/19 19:56 Worklog Time Spent: 10m Work Description: chadrik commented on pull request #9811: [BEAM-8402] Create a class hierarchy to represent environments URL: https://github.com/apache/beam/pull/9811#discussion_r343297664 ########## File path: sdks/python/apache_beam/transforms/environments.py ########## @@ -0,0 +1,394 @@ +# +# 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. +# + +"""Environments concepts. + +For internal use only. No backwards compatibility guarantees.""" + +from __future__ import absolute_import + +import json + +from google.protobuf import message + +from apache_beam.portability import common_urns +from apache_beam.portability import python_urns +from apache_beam.portability.api import beam_runner_api_pb2 +from apache_beam.portability.api import endpoints_pb2 +from apache_beam.utils import proto_utils + +__all__ = ['Environment', + 'DockerEnvironment', 'ProcessEnvironment', 'ExternalEnvironment', + 'EmbeddedPythonEnvironment', 'EmbeddedPythonGrpcEnvironment', + 'SubprocessSDKEnvironment', 'RunnerAPIEnvironmentHolder'] + + +class Environment(object): + """Abstract base class for environments. + + Represents a type and configuration of environment. + Each type of Environment should have a unique urn. + """ Review comment: let's add the internal warning here too. ---------------------------------------------------------------- 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: 339568) Time Spent: 2.5h (was: 2h 20m) > Create a class hierarchy to represent environments > -------------------------------------------------- > > Key: BEAM-8402 > URL: https://issues.apache.org/jira/browse/BEAM-8402 > Project: Beam > Issue Type: New Feature > Components: sdk-py-core > Reporter: Chad Dombrova > Assignee: Chad Dombrova > Priority: Major > Time Spent: 2.5h > Remaining Estimate: 0h > > As a first step towards making it possible to assign different environments > to sections of a pipeline, we first need to expose environment classes to the > pipeline API. Unlike PTransforms, PCollections, Coders, and Windowings, > environments exists solely in the portability framework as protobuf objects. > By creating a hierarchy of "native" classes that represent the various > environment types -- external, docker, process, etc -- users will be able to > instantiate these and assign them to parts of the pipeline. The assignment > portion will be covered in a follow-up issue/PR. -- This message was sent by Atlassian Jira (v8.3.4#803005)