[
https://issues.apache.org/jira/browse/BEAM-5440?focusedWorklogId=273613&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-273613
]
ASF GitHub Bot logged work on BEAM-5440:
----------------------------------------
Author: ASF GitHub Bot
Created on: 09/Jul/19 00:32
Start Date: 09/Jul/19 00:32
Worklog Time Spent: 10m
Work Description: sambvfx commented on pull request #8982: [BEAM-5440]
Pass docker run options to SDK harness containers
URL: https://github.com/apache/beam/pull/8982#discussion_r301354179
##########
File path:
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/environment/DockerEnvironmentFactory.java
##########
@@ -136,6 +138,10 @@ public RemoteEnvironment createEnvironment(Environment
environment) throws Excep
dockerArgsBuilder.add("--rm");
}
+ if (!dockerOptions.isEmpty()) {
+ dockerArgsBuilder.addAll(Arrays.asList(dockerOptions.split("\\s+")));
Review comment:
Are you suggesting we attempt to keep the flags in sync with our own json
structure? i.e.
```python
{
'volumes': ['/Volumes/mnt/foo:/Volumes/mnt/foo',
'/Volumes/mnt/bar:/Volumes/mnt/bar'],
'user': 'sambvfx',
'env': {'<Environment variables 1>': '<ENV_VAL>'},
}
```
I don't think that design is very maintainable. There are nearly 100 flags
for `docker run [OPTIONS]`. This JSON structure would have to be understood and
properly unpacked by the `DockerEnvironmentFactory` - increasing the complexity
of the code there.
The JSON approach would also make it nearly impossible to provide as
argparse flags to the SDK. Which currently looks like this:
```
python -m mymodule --runner PortableRunner --job_endpoint localhost:8099
--environment_type DOCKER --environment_config "-v
/Volumes/mnt/foo:/Volumes/mnt/foo -v /Volumes/mnt/bar:/Volumes/mnt/bar --user
sambvfx MY_CONTAINER_NAME"
```
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 273613)
Time Spent: 1.5h (was: 1h 20m)
> Add option to mount a directory inside SDK harness containers
> -------------------------------------------------------------
>
> Key: BEAM-5440
> URL: https://issues.apache.org/jira/browse/BEAM-5440
> Project: Beam
> Issue Type: New Feature
> Components: java-fn-execution, sdk-java-core
> Reporter: Maximilian Michels
> Priority: Major
> Labels: portability, portability-flink
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> While experimenting with the Python SDK locally, I found it inconvenient that
> I can't mount a host directory to the Docker containers, i.e. the input must
> already be in the container and the results of a Write remain inside the
> container. For local testing, users may want to mount a host directory.
> Since BEAM-5288 the {{Environment}} carries explicit environment information,
> we could a) add volume args to the {{DockerPayload}}, or b) provide a general
> Docker arguments field.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)