Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace enqueue_with_reservation with dispatch for pulpcore 3.14.0 compat #821

Merged
merged 9 commits into from
Jul 13, 2021

Conversation

alikins
Copy link
Contributor

@alikins alikins commented Jul 6, 2021

Replace enqueue_with_reservation() with dispatch()

Primary difference is that enqueue_with_reservation()
returns an 'rq' job, and 'rq' support is being removed
in pulpcore.

The new 'dispatch()' returns a pulpcore.plugin.models.Task
object. dispatch() also no longer supports the 'options' arg.

pulpcore 3.13 removes 'enqueue_with_reservation'
https://docs.pulpproject.org/pulpcore/changes.html#id96

pulpcore 3.12.0 deprecated 'enqueue_with_reservation'
https://docs.pulpproject.org/pulpcore/changes.html#id152

See https://docs.pulpproject.org/pulpcore/plugins/api-reference/tasking.html#pulpcore.plugin.tasking.dispatch
for docs on dispatch().

More explanation of the diff between enqueue_with_reservation()
and dispatch() can be seen at:
pulp/pulpcore@753e4dd
and https://pulp.plan.io/issues/8496

Issue: AAH-706

@alikins alikins added the area/tasks Affects galaxy_ng/app/tasks/ label Jul 6, 2021
@alikins alikins changed the title Replace enqueue_with_reservation with dispatch Replace enqueue_with_reservation with dispatch for pulpcore 3.14.0 compat Jul 6, 2021
@rochacbruno
Copy link
Member

alikins added a commit to alikins/galaxy_ng that referenced this pull request Jul 6, 2021
pulpcore 3.14 replaces the 'rq' based tasking system with
'pulpcore-worker'

So no longer need a service for 'resource-manager' on the
docker-compose dev env tooling. Removed it from
Makefile, the docker-compose.yml for each profile, and the
'start-resource-manager' invoked by the 'resource-manager'
docker container.

Required PR: ansible#821

No-Issue
alikins added a commit to alikins/galaxy_ng that referenced this pull request Jul 6, 2021
See https://github.com/pulp/pulpcore/blob/master/docs/components.rst#distributed-tasking-system-tech-preview

Remove use if pulpcore 'resource-manager' for pulp 3.14

pulpcore 3.14 replaces the 'rq' based tasking system with
'pulpcore-worker'

So no longer need a service for 'resource-manager' on the
docker-compose dev env tooling. Removed it from
Makefile, the docker-compose.yml for each profile, and the
'start-resource-manager' invoked by the 'resource-manager'
docker container.

Required PR: ansible#821

No-Issue
alikins added a commit to alikins/galaxy_ng that referenced this pull request Jul 6, 2021
alikins added a commit to alikins/galaxy_ng that referenced this pull request Jul 6, 2021
See https://github.com/pulp/pulpcore/blob/master/docs/components.rst#distributed-tasking-system-tech-preview

Remove use if pulpcore 'resource-manager' for pulp 3.14

pulpcore 3.14 replaces the 'rq' based tasking system with
'pulpcore-worker'

So no longer need a service for 'resource-manager' on the
docker-compose dev env tooling. Removed it from
Makefile, the docker-compose.yml for each profile, and the
'start-resource-manager' invoked by the 'resource-manager'
docker container.

Required PR: ansible#821

No-Issue
alikins added a commit to alikins/galaxy_ng that referenced this pull request Jul 7, 2021
Required PR: ansible#821
Required PR: ansible#824

Issue: AAH-708
Copy link
Member

@rochacbruno rochacbruno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The upgrade of dependencies made migration to break

File "/usr/local/lib/python3.6/site-packages/galaxy_ng/app/migrations/0017_populate_repos_and_remotes.py", line 104, in populate_initial_repos
    "pulp_type": "ansible.ansible"

we need a fix for that migration as part of this PR to make the CI to pass.

__fake__.DoesNotExist: AnsibleDistribution matching query does not exist.

@alikins
Copy link
Contributor Author

alikins commented Jul 9, 2021

@rochacbruno

we need a fix for that migration as part of this PR to make the CI to pass.

fake.DoesNotExist: AnsibleDistribution matching query does not exist.

hmm, interesting. Did not expect that.

AnsibleDistribution no longer exists?

@rochacbruno
Copy link
Member

@alikins the entity exists, but the SQL query made on the migration is failing for some reason. Did we changed something on get_or_create logic?

alikins added a commit to alikins/galaxy_ng that referenced this pull request Jul 13, 2021
See https://github.com/pulp/pulpcore/blob/master/docs/components.rst#distributed-tasking-system-tech-preview

Remove use if pulpcore 'resource-manager' for pulp 3.14

pulpcore 3.14 replaces the 'rq' based tasking system with
'pulpcore-worker'

So no longer need a service for 'resource-manager' on the
docker-compose dev env tooling. Removed it from
Makefile, the docker-compose.yml for each profile, and the
'start-resource-manager' invoked by the 'resource-manager'
docker container.

Required PR: ansible#821

No-Issue
Primary difference is that enqueue_with_reservation()
returns an 'rq' job, and 'rq' support is being removed
in pulpcore.

The new 'dispatch()' returns a pulpcore.plugin.models.Task
object. dispatch() also no longer supports the 'options' arg.

pulpcore 3.13 removes 'enqueue_with_reservation'
https://docs.pulpproject.org/pulpcore/changes.html#id96

pulpcore 3.12.0 deprecated 'enqueue_with_reservation'
https://docs.pulpproject.org/pulpcore/changes.html#id152

See https://docs.pulpproject.org/pulpcore/plugins/api-reference/tasking.html#pulpcore.plugin.tasking.dispatch
for docs on dispatch().

More explaination of the diff between enqueue_with_reservation()
and dispatch() can be seen at:
pulp/pulpcore@753e4dd
and https://pulp.plan.io/issues/8496

Issue: AAH-706
See https://github.com/pulp/pulpcore/blob/master/docs/components.rst#distributed-tasking-system-tech-preview

Remove use if pulpcore 'resource-manager' for pulp 3.14

pulpcore 3.14 replaces the 'rq' based tasking system with
'pulpcore-worker'

So no longer need a service for 'resource-manager' on the
docker-compose dev env tooling. Removed it from
Makefile, the docker-compose.yml for each profile, and the
'start-resource-manager' invoked by the 'resource-manager'
docker container.

Required PR: ansible#821

No-Issue
Not sure why, but replacing the Models.objects with one
using the 'db_alias', AnsibleDistribution.objects.get()
and get_or_create() fail with invalid query which raises
a DoesNotExist from a get_or_create()

Then it seems like something in the error handling is walking
over the models and triggering some recursion storm that seems
to get stuck in django lifecycle land.

For more detail, see:
https://issues.redhat.com/browse/AAH-706?focusedCommentId=16423461&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16423461

Issue: AAH-706
'enqueue_with_reservation' has been replaced with 'dispatch'
in pulpcore 3.14. So stop mocking it.

Issue: AAH-706
Based on pulp/pulp_ansible@946c356
some of the generated API names have changed.

Update to use the (correct?) new name.

Issues: AAH-706
Copy link
Member

@rochacbruno rochacbruno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Waiting to hear from @cutwater related to the appSRE failure.

@chouseknecht chouseknecht merged commit c491613 into ansible:master Jul 13, 2021
chouseknecht pushed a commit that referenced this pull request Jul 13, 2021
See https://github.com/pulp/pulpcore/blob/master/docs/components.rst#distributed-tasking-system-tech-preview

Remove use if pulpcore 'resource-manager' for pulp 3.14

pulpcore 3.14 replaces the 'rq' based tasking system with
'pulpcore-worker'

So no longer need a service for 'resource-manager' on the
docker-compose dev env tooling. Removed it from
Makefile, the docker-compose.yml for each profile, and the
'start-resource-manager' invoked by the 'resource-manager'
docker container.

Required PR: #821

No-Issue
alikins added a commit to alikins/galaxy_ng that referenced this pull request Jul 13, 2021
chouseknecht pushed a commit that referenced this pull request Jul 14, 2021
awcrosby added a commit to awcrosby/galaxy_ng that referenced this pull request Jul 20, 2021
awcrosby added a commit to awcrosby/galaxy_ng that referenced this pull request Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tasks Affects galaxy_ng/app/tasks/
Projects
None yet
3 participants