Project

Profile

Help

Story #8231

As a plugin writer, I will use Python's tempfile facilities instead of pulpcore.plugin.WorkingDirectory

Added by bmbouter 10 months ago. Updated 9 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

Motivation

Pulp is duplicated the stdlib's tempfile module with its from pulpcore.plugin.tasking.WorkingDirectory facilities. In an effort to add, not duplicate value we should remove this so that plugins can use the tempfile module directly.

Recap of current functionality

The tasking system (with 3.10 at least) already creates a working directory in /var/lib/pulp/cache/ and changes dir into it. It's namespaced by worker and task name so for example: ``. <--- put example here

Plugin Experience

So plugins already have a working directory. If they need more they can create subdirectories using the tempfile facilities. Those would be nesteded in an area that is already theirs.

Docs for plugin writers

Along with this story a new section should be added to the plugin writers guide called Working Directories. It should include docs that identify:

  • that each task gets a clean, unique working directory, and it's set as the current working directory by the time their task code gets called
  • If plugin writers need additional working directories, they should use the tempfile package to create more. These likely should be subdirectories of the one the tasking system provided for them.
  • An example of creating a sub-dir of the working directory created by the tasking system.

Related issues

Precedes Pulp - Task #8354: Remove deprecated WorkingDirectoyCLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 7a6a5232 View on GitHub
Added by mdellweg 9 months ago

Deprecate WorkingDirectory

Additionally document the use of tempfile.TemporaryDirectory.

fixes #8231 https://pulp.plan.io/issues/8231

History

#1 Updated by bmbouter 10 months ago

  • Description updated (diff)

#2 Updated by ipanova@redhat.com 9 months ago

  • Sprint/Milestone changed from 3.11.0 to 3.12.0

#3 Updated by mdellweg 9 months ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to mdellweg

#4 Updated by pulpbot 9 months ago

  • Status changed from ASSIGNED to POST

#5 Updated by mdellweg 9 months ago

  • Sprint/Milestone changed from 3.12.0 to 3.11.0

#6 Updated by mdellweg 9 months ago

  • Precedes Task #8354: Remove deprecated WorkingDirectoy added

#7 Updated by mdellweg 9 months ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

#8 Updated by ipanova@redhat.com 9 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF