[
https://issues.apache.org/jira/browse/BEAM-7980?focusedWorklogId=299622&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-299622
]
ASF GitHub Bot logged work on BEAM-7980:
----------------------------------------
Author: ASF GitHub Bot
Created on: 22/Aug/19 18:17
Start Date: 22/Aug/19 18:17
Worklog Time Spent: 10m
Work Description: lostluck commented on pull request #9398: [BEAM-7980]
Exactly once artifact retrieval for Python SDK worker pool
URL: https://github.com/apache/beam/pull/9398#discussion_r316819996
##########
File path: sdks/python/container/boot.go
##########
@@ -105,18 +107,57 @@ func main() {
// (2) Retrieve and install the staged packages.
- dir := filepath.Join(*semiPersistDir, "staged")
+ func() {
- files, err := artifact.Materialize(ctx, *artifactEndpoint,
info.GetRetrievalToken(), dir)
- if err != nil {
- log.Fatalf("Failed to retrieve staged files: %v", err)
- }
+ installCompleteFile := filepath.Join(os.TempDir(),
"beam.install.complete")
- // TODO(herohde): the packages to install should be specified
explicitly. It
- // would also be possible to install the SDK in the Dockerfile.
- if setupErr := installSetupPackages(files, dir); setupErr != nil {
- log.Fatalf("Failed to install required packages: %v", setupErr)
- }
+ // skip if install already complete
+ _, err = os.Stat(installCompleteFile)
+ if err == nil {
+ return
+ }
+
+ // lock to guard from concurrent artifact retrieval and
installation,
+ // when called by child processes in a worker pool
+ lock, err := lockfile.New(filepath.Join(os.TempDir(),
"beam.install.lck"))
Review comment:
If it's only used in one place, this is fine as is. It would not be wrong to
move the path definition elsewhere, but it would be indirect.
----------------------------------------------------------------
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: 299622)
Time Spent: 6.5h (was: 6h 20m)
> External environment with containerized worker pool
> ---------------------------------------------------
>
> Key: BEAM-7980
> URL: https://issues.apache.org/jira/browse/BEAM-7980
> Project: Beam
> Issue Type: Improvement
> Components: sdk-py-harness
> Reporter: Thomas Weise
> Assignee: Thomas Weise
> Priority: Major
> Time Spent: 6.5h
> Remaining Estimate: 0h
>
> Augment Beam Python docker image and boot.go so that it can be used to launch
> BeamFnExternalWorkerPoolServicer.
> [https://docs.google.com/document/d/1z3LNrRtr8kkiFHonZ5JJM_L4NWNBBNcqRc_yAf6G0VI/edit#heading=h.lnhm75dhvhi0]
>
--
This message was sent by Atlassian Jira
(v8.3.2#803003)