Story #7815
closed
As a plugin writer, pulpcore ensures that a job working directory is set/removed properly
Status:
CLOSED - CURRENTRELEASE
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
- Groomed changed from No to Yes
- Sprint Candidate changed from No to Yes
- Sprint changed from Sprint 88 to Sprint 89
- 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.
- Status changed from ASSIGNED to POST
- Sprint/Milestone set to 3.10.0
- Sprint/Milestone deleted (
3.10.0)
- Parent issue deleted (
#7469)
- Blocks Story #7469: as a Pulp File user, I can have my repository auto published and distributed added
- Blocks Story #6353: As a user, I can mirror RPM repository content and metadata added
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.
- Sprint changed from Sprint 89 to Sprint 90
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
- Sprint/Milestone set to 3.11.0
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Also available in: Atom
PDF
Enable nesting WorkingDirectory()
re: #7815 https://pulp.plan.io/issues/7815