Story #7815
closedAs a plugin writer, pulpcore ensures that a job working directory is set/removed properly
100%
Description
Motivation¶
At the moment, it's plugin's responsibility to be sure that any temporary files it's working with are stored in the directory dedicated to a running job. It's done by using the content manager WorkingDirectory
.
The context manager doesn't support nesting which causes a usability problem.
Plugin writer needs to carefully create and recreate the working directory every time it deals with files to avoid nesting (e.g. stages API uses WorkingDirectory so some nesting can come from the using of pulpcore code).
Suggestion¶
- let tasking management in pulpcore take care of managing the working directory for every job (even if it doesn't need it)
- raise DeprecationWarning for the context manager
WorkingDirectory
- make the context manager
WorkingDirectory
no-op since pulpcore sets the directory for any job - file a task to remove the deprecation and the context manager on Y+1 version of pulpcore
Related issues
Updated by mdellweg about 4 years ago
- Groomed changed from No to Yes
- Sprint Candidate changed from No to Yes
Updated by dalley almost 4 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to dalley
- Parent issue set to #7469
Necessary in order to do auto-publish-and-distribute, which may have multiple working directories.
Updated by pulpbot almost 4 years ago
- Status changed from ASSIGNED to POST
Updated by dalley almost 4 years ago
- Blocks Story #7469: as a Pulp File user, I can have my repository auto published and distributed added
Updated by dalley almost 4 years ago
- Blocks Story #6353: As a user, I can mirror RPM repository content and metadata added
Updated by dalley almost 4 years ago
In the implementation, I went with a slightly different approach. Instead of making WorkingDirectory a no-op, I just fixed the issue preventing them from nesting. I think we still want manual WorkingDirectorys because we plugin writers may have any number of reasons to want a clean one, and we can't enforce that if we only have a single, shared working directory for the entire task. We've seen issues recently with the migration plugin where sub-repo publishing had errors seemingly caused by sharing WorkingDirectory with the publish of the outer repo.
Added by dalley almost 4 years ago
Added by dalley almost 4 years ago
Revision 35598c05 | View on GitHub
Tasks get a working directory by default
Updated by dalley almost 4 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulpcore|35598c0591f23242879b46cde63d6da9549c5d53.
Updated by ipanova@redhat.com almost 4 years ago
- Sprint/Milestone set to 3.11.0
Updated by ipanova@redhat.com almost 4 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Enable nesting WorkingDirectory()
re: #7815 https://pulp.plan.io/issues/7815