Story #7815
As 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
Associated revisions
Revision 35598c05
View on GitHub
Tasks get a working directory by default
History
#2
Updated by dalley about 2 months ago
- Sprint set to Sprint 88
#3
Updated by rchan about 1 month ago
- Sprint changed from Sprint 88 to Sprint 89
#9
Updated by dalley 29 days ago
- Blocks Story #7469: as a Pulp File user, I can have my repository auto published and distributed added
#10
Updated by dalley 29 days ago
- Blocks Story #6353: As a user, I can mirror RPM repository content and metadata added
#11
Updated by dalley 29 days 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.
#13
Updated by dalley 21 days ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulpcore|35598c0591f23242879b46cde63d6da9549c5d53.
Please register to edit this issue
Enable nesting WorkingDirectory()
re: #7815 https://pulp.plan.io/issues/7815