Skip to content

Move move_files to a broadcast model. #2946

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

Merged
merged 10 commits into from
Jun 16, 2017
Merged

Move move_files to a broadcast model. #2946

merged 10 commits into from
Jun 16, 2017

Conversation

ericholscher
Copy link
Member

This will require an update to the Settings in prod, to default a
RemotePuller instead of the DoubleRemotePuller

@ericholscher ericholscher added the PR: work in progress Pull request is not ready for full review label Jun 12, 2017
@ericholscher ericholscher changed the base branch from master to gthank-master June 12, 2017 20:52
@ericholscher ericholscher changed the base branch from gthank-master to master June 14, 2017 21:33
@ericholscher ericholscher added PR: ready for review and removed PR: work in progress Pull request is not ready for full review labels Jun 14, 2017
@ericholscher ericholscher requested a review from agjohnson June 14, 2017 22:07
@agjohnson
Copy link
Contributor

Looks like tests are failing. I'll set this back to WIP until ready for review.

@agjohnson agjohnson added PR: work in progress Pull request is not ready for full review and removed PR: ready for review labels Jun 15, 2017
@ericholscher ericholscher added PR: ready for review and removed PR: work in progress Pull request is not ready for full review labels Jun 15, 2017
@ericholscher
Copy link
Member Author

Tested fixed.

Copy link
Contributor

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

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

Looks good! This feels like a good amount of cruft to clean up and refactor.

@@ -163,7 +163,7 @@ def save(self, *args, **kwargs): # pylint: disable=arguments-differ
def delete(self, *args, **kwargs): # pylint: disable=arguments-differ
from readthedocs.projects import tasks
log.info('Removing files for version %s', self.slug)
tasks.clear_artifacts.delay(version_pk=self.pk)
broadcast(type='app', task=tasks.clear_artifacts, args=[self.pk])
broadcast(type='app', task=tasks.symlink_project, args=[self.project.pk])
Copy link
Contributor

Choose a reason for hiding this comment

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

If we were using a newer version of celery, this would be a good case for chaining the tasks:
http://docs.celeryproject.org/en/latest/userguide/canvas.html#chains

I'd like to use more celery features, if we can get around to upgrading celery at some point.

Copy link
Member Author

Choose a reason for hiding this comment

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

Aye. Would be useful for a few things.

@@ -909,7 +909,7 @@ def remove_dir(path):
shutil.rmtree(path, ignore_errors=True)


@task(queue='web')
@task()
def clear_artifacts(version_pk):
"""Remove artifacts from the web servers"""
Copy link
Contributor

Choose a reason for hiding this comment

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

If not running on just the web queue, docs need updating here.

Copy link
Member Author

Choose a reason for hiding this comment

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

It will still only work on the web servers, but instead run on the web0[1-4] queues instead of the generic web queue.

@ericholscher ericholscher merged commit d3c1e8a into master Jun 16, 2017
@stsewd stsewd deleted the broadcast-fixes branch August 15, 2018 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants