Project

Profile

Help

Story #7815

closed

As a plugin writer, pulpcore ensures that a job working directory is set/removed properly

Added by ttereshc over 3 years ago. Updated about 3 years ago.

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

100%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Sprint:
Sprint 90
Quarter:

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

Blocks File Support - Story #7469: as a Pulp File user, I can have my repository auto published and distributedCLOSED - CURRENTRELEASEdalley

Actions
Blocks RPM Support - Story #6353: As a user, I can mirror RPM repository content and metadataCLOSED - CURRENTRELEASEdalley

Actions
Actions #1

Updated by mdellweg over 3 years ago

  • Groomed changed from No to Yes
  • Sprint Candidate changed from No to Yes
Actions #2

Updated by dalley over 3 years ago

  • Sprint set to Sprint 88
Actions #3

Updated by rchan about 3 years ago

  • Sprint changed from Sprint 88 to Sprint 89
Actions #4

Updated by dalley about 3 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.

Actions #5

Updated by pulpbot about 3 years ago

  • Status changed from ASSIGNED to POST
Actions #6

Updated by dalley about 3 years ago

  • Sprint/Milestone set to 3.10.0
Actions #7

Updated by dalley about 3 years ago

  • Sprint/Milestone deleted (3.10.0)
Actions #8

Updated by dalley about 3 years ago

  • Parent issue deleted (#7469)
Actions #9

Updated by dalley about 3 years ago

  • Blocks Story #7469: as a Pulp File user, I can have my repository auto published and distributed added
Actions #10

Updated by dalley about 3 years ago

  • Blocks Story #6353: As a user, I can mirror RPM repository content and metadata added
Actions #11

Updated by dalley about 3 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.

Actions #12

Updated by rchan about 3 years ago

  • Sprint changed from Sprint 89 to Sprint 90

Added by dalley about 3 years ago

Revision 425acafb | View on GitHub

Enable nesting WorkingDirectory()

re: #7815 https://pulp.plan.io/issues/7815

Added by dalley about 3 years ago

Revision 35598c05 | View on GitHub

Tasks get a working directory by default

closes: #7815 https://pulp.plan.io/issues/7815

Actions #13

Updated by dalley about 3 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #14

Updated by ipanova@redhat.com about 3 years ago

  • Sprint/Milestone set to 3.11.0
Actions #15

Updated by ipanova@redhat.com about 3 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF