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

Switch status API to RQ #960

Merged
merged 1 commit into from May 14, 2018
Merged

Switch status API to RQ #960

merged 1 commit into from May 14, 2018

Conversation

bmbouter
Copy link
Member

@bmbouter bmbouter commented Apr 20, 2018

The attribute name in the status API changed when RQ with Redis replaced
AMQP brokers like RabbitMQ.

This PR is meant to be used with these core and pulp_file PRs:

pulp/pulp#3454
pulp/pulp_file#72

bmbouter pushed a commit to bmbouter/pulp that referenced this pull request Apr 20, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request Apr 20, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
@dralley
Copy link
Contributor

dralley commented Apr 20, 2018

This PR should be renamed and the scope expanded a bit, I think. The pulp-smash settings create command probably should be modified, along with the settings file it outputs. There is no longer any need for the broker settings nor asking the user if they are using Qpid.

@nixocio
Copy link

nixocio commented Apr 23, 2018

@dralley , please, can you file an smash issue providing more details, and outlining the requested changes?

@dralley
Copy link
Contributor

dralley commented Apr 23, 2018

@kersommoura #965

bmbouter pushed a commit to bmbouter/pulp that referenced this pull request Apr 23, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request Apr 23, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request Apr 23, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request Apr 23, 2018
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request Apr 23, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request Apr 23, 2018
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request Apr 23, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request Apr 23, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
@Ichimonji10
Copy link
Contributor

Ichimonji10 commented Apr 24, 2018

As @dralley correctly points out, some changes to the config file and CLI are in order. The issue that was filed is helpful. In the mean time, this particular test case does need to be updated.

I've refactored the test case targeted by this PR, making this PR out of date. See 7f8daac. Sorry about that. I made the refactor before seeing this. Thankfully, this PR can still be quite simple. Here's all that this PR needs to consist of:

diff --git a/pulp_smash/tests/pulp3/pulpcore/api_v3/test_status.py b/pulp_smash/tests/pulp3/pulpcore/api_v3/test_status.py
index 9204e73..512336d 100644
--- a/pulp_smash/tests/pulp3/pulpcore/api_v3/test_status.py
+++ b/pulp_smash/tests/pulp3/pulpcore/api_v3/test_status.py
@@ -21,7 +21,7 @@ STATUS = {
             'type': 'object',
             'properties': {'connected': {'type': 'boolean'}},
         },
-        'messaging_connection': {
+        'redis_connection': {
             'type': 'object',
             'properties': {'connected': {'type': 'boolean'}},
         },
@@ -92,7 +92,7 @@ class StatusTestCase(unittest.TestCase, utils.SmokeTest):
         """
         validate(status, STATUS)
         self.assertTrue(status['database_connection']['connected'])
-        self.assertTrue(status['messaging_connection']['connected'])
+        self.assertTrue(status['redis_connection']['connected'])
         self.assertEqual(status['missing_workers'], [])
         self.assertNotEqual(status['online_workers'], [])
         self.assertNotEqual(status['versions'], [])

Copy link
Contributor

@Ichimonji10 Ichimonji10 left a comment

Choose a reason for hiding this comment

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

Deal with refactored test case.

@bmbouter
Copy link
Member Author

No problem at all I can rebase. I'll do that soon. Thank you @Ichimonji10. I'm also considering relabeling it back to 'tasking_connection' or something like that which was a feedback point from another PR. The thinking is that RQ can support other backends (at some point for instance etcd is on their roadmap). I'll make that change with my rebase too.

bmbouter pushed a commit to bmbouter/pulp that referenced this pull request Apr 26, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request Apr 27, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request Apr 27, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
@bmbouter bmbouter closed this Apr 27, 2018
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request Apr 27, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
@bmbouter bmbouter reopened this Apr 27, 2018
@bmbouter
Copy link
Member Author

@Ichimonji10 I pushed a rebased change. What else needs to be done in this PR to make it ready for merging?

Copy link
Contributor

@Ichimonji10 Ichimonji10 left a comment

Choose a reason for hiding this comment

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

LGTM. I assume that the changes were tested against a modified Pulp application. When this is merged, make sure to merge the corresponding Pulp PRs at the same time, as this change breaks currently passing tests.

The attribute name in the status API changed when RQ with Redis replaced
AMQP brokers like RabbitMQ.

This PR is meant to be used with these core and pulp_file PRs:

pulp/pulp#3454
pulp/pulp_file#72
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request May 7, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request May 7, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request May 7, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request May 7, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request May 8, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request May 8, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request May 8, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request May 14, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request May 14, 2018
This PR does the following:

* port travis to RQ
* remove all celery references
* install, systemd docs updates
* create a custom RQ worker method for Pulp's needs
* ports the status API to report on the Redis connection
* port orphan cleanup tasks to work with RQ
* port all pulp tasks to RQ
* handle fatal error exception recording on tasks
* replace apply_async_with_reservation to enqueue_with_reservation
* task cancellation kills a running task correctly
* work discovery, normal shutdown, and crash shutdown tested
* adds settings for Redis connection to settings files
* removes celery as a dependency
* adds rq as a dependency

There is a devel repo PR here to be used by `vagrant up` when testing
this PR: pulp/devel#146

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp_file#72
@bmbouter bmbouter merged commit ed2626a into pulp:master May 14, 2018
@bmbouter bmbouter deleted the switch-to-rq branch May 14, 2018 18:19
daviddavis pushed a commit to daviddavis/pulp_file that referenced this pull request May 14, 2019
* Updates Travis to use RQ worker runners
* Remove usage of Celery
* port apply_async_with_reservation to enqueue_with_reservation

Required PR: pulp/pulp-smash#960
Required PR: pulp/pulp#3454
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants