Project

Profile

Help

Issue #632

closed

Consumer rpm bind sycnrhonous or awareness of completion

Added by jon.shanks@gmail.com about 9 years ago. Updated about 5 years ago.

Status:
CLOSED - NOTABUG
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Description of problem:
When the pulp-consumer runs an rpm repo bind command to bind to a specific repository, there is no way of knowing whether or not the task has completed from the server prospective, you can identify whether or not the task was sent successfully but not when it is complete. As it's asynchronous and the message returns form the server onto the queue for goferd to pickup and then deal with the repo creation, you can't really tell when the repos are actually created to proceed to some installations of rpms.

It would be good if either it was syncrhonous and returns a success on the completion of the repo file i.e. maybe it should be pulp_<repo_name>.repo for each repo creation as oppose one static pulp.repo file for each task it completes, (which would be the preferred for me) or maybe just returns an ID you can then track wiht a query pulp-consumer rpm task --id <id> to see whether it's success or waiting but that itself is quite tiresome as it would mean then wrapping around a loop until success before proceeding for each creation.

The reason for this is because i have a provider / type for pulp and it can create the repos by grabbing hiera data merging it into an array list and then iterates , if they dont already exist on the box already it will then use pulp-consumer to bind to that repo. The issue is that it's possible i proceed with other tasks in puppet that expect those repos to be there and in some instances they are not created quick enough and so i have had to put a sleep in there which is arbitary and i have no visibility of when the repos are created to proceed.

Version-Release number of selected component (if applicable):

How reproducible:
very, it's explained above.

Steps to Reproduce:
1.
2.
3.

Actual results:

Expected results:
all info above

Additional info:
all info above

+ This bug was cloned from Bugzilla Bug #1171188 +

Actions #1

Updated by jortel@redhat.com about 9 years ago

Looks like the REST reply for bind/unbind does not include the agent related tasks in spawned_tasks. We need to fix this.

+ This comment was cloned from Bugzilla #1171188 comment 1 +

Actions #2

Updated by bmbouter about 9 years ago

  • Severity changed from High to 3. High
Actions #3

Updated by jortel@redhat.com almost 9 years ago

  • Subject changed from Consumer rpm bind sycnrhonous or awareness of completino to Consumer rpm bind sycnrhonous or awareness of completion
  • Status changed from NEW to ASSIGNED
  • Assignee set to jortel@redhat.com
Actions #4

Updated by jortel@redhat.com almost 9 years ago

Looks like the spawned tasks are included in the REST API call.

Here is an example:

2015-04-21 15:46:38,707 - INFO - Response body :
 {
  "spawned_tasks": [
    {
      "_href": "/pulp/api/v2/tasks/04e63490-91cd-4534-8705-1452db2f89fe/",
      "task_id": "04e63490-91cd-4534-8705-1452db2f89fe"
    }
  ],
  "result": {
    "notify_agent": true,
    "repo_id": "jeff",
    "deleted": false,
    "_ns": "consumer_bindings",
    "_id": {
      "$oid": "5536b72ee1382349c3593088"
    },
    "consumer_id": "jeff",
    "consumer_actions": [],
    "binding_config": {},
    "distributor_id": "yum_distributor",
    "id": "5536b72ee1382349c3593088"
  },
  "error": null
}

Then

$ pulp-admin tasks details --task-id=04e63490-91cd-4534-8705-1452db2f89fe
+----------------------------------------------------------------------+
                              Task Details
+----------------------------------------------------------------------+

Operations:       agent_bind
Resources:        jeff (consumer), jeff (repository), yum_distributor
                  (repository_distributor)
State:            Successful
Start Time:       2015-04-21T20:46:38Z
Finish Time:      2015-04-21T20:46:38Z
Result:           
  Details:     
    Yum Distributor: 
      Details:   
      Repo Id:   jeff
      Succeeded: True
  Num Changes: 0
  Reboot:      
    Details:   
    Scheduled: False
  Succeeded:   True
Task Id:          04e63490-91cd-4534-8705-1452db2f89fe
Progress Report:

From the API perspective, it seems that the following flow would be sufficient:

  1. API call to bind.
  2. Wait for spawned task to complete (as demonstrated above)
  3. Run your puppet

Is this sufficient?

Actions #5

Updated by jortel@redhat.com almost 9 years ago

  • Status changed from ASSIGNED to CLOSED - NOTABUG

Please re-open if the current supported functionality is not sufficient.

Actions #6

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF