[
https://issues.apache.org/jira/browse/BEAM-4778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16545665#comment-16545665
]
Ryan Williams commented on BEAM-4778:
-------------------------------------
A couple notes about present and future here, from chatting with [~angoenka]:
* there are few hard constraints between the lifecycles of jobs, jobs'
artifacts, and job-servers:
** jobs can outlive job-servers and vice-versa
** we want to let jobs' artifacts outlive both the job and the job-server,
e.g. in [~angoenka]'s [portable-VR-test
work|https://github.com/apache/beam/pull/5935/files]:
*** each test-case sets up and tears down artifact-\{staging,retrieval}
services, and stages+retrieves the same ≈150MB of artifacts (O(100) times)
*** we'd like each artifact-server-pair to be able to detect+serve artifacts
that were sitting around in their directory when they started
**** as [~jkff] mentioned above, that will require tracking artifacts by their
hash (MD5) _in addition to_ the existing per-job tracking, or
**** flattening the per-job folder hierarchy so that artifacts are only
content-addressed in one flat directory
**** my instinct is to go with the former for now
*** finally, we'll want to end the portable-VR gradle task by actually
deleting the staged-artifact directory that was reused across test-cases
Current state of work:
* [#5958|https://github.com/apache/beam/pull/5958] allows setting the
job-server to GC each job's artifacts when the job finishes
** this at least allows for stopping the disk-leakage
Planned/Future work:
* content-addressing artifacts for reuse across jobs
* detecting artifacts that exist at artifact-\{staging,retrieval}-server
startup, and \{avoiding re-staging, serving} them (resp.)
* deleting all staged artifacts at in gradle at the end of a VR-test run
> Less wasteful ArtifactStagingService
> ------------------------------------
>
> Key: BEAM-4778
> URL: https://issues.apache.org/jira/browse/BEAM-4778
> Project: Beam
> Issue Type: Bug
> Components: runner-core
> Reporter: Eugene Kirpichov
> Assignee: Ryan Williams
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> [https://github.com/apache/beam/blob/master/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/artifact/BeamFileSystemArtifactStagingService.java]
> is the main implementation of ArtifactStagingService.
> It stages artifacts into a directory; and in practice the passed staging
> session token is such that the directory is different for every job. This
> leads to 2 issues:
> * It doesn't get cleaned up when the job finishes or even when the
> JobService shuts down, so we have disk space leaks if running a lot of jobs
> (e.g. a suite of ValidatesRunner tests)
> * We repeatedly re-stage the same artifacts. Instead, ideally, we should
> identify that some artifacts don't need to be staged - based on knowing their
> md5. The artifact staging protocol has rudimentary support for this but may
> need to be modified.
> CC: [~angoenka]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)