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

Deploy celery as a separate cloud.gov application #2592

Closed
8 tasks
jtimpe opened this issue Jun 27, 2023 · 2 comments
Closed
8 tasks

Deploy celery as a separate cloud.gov application #2592

jtimpe opened this issue Jun 27, 2023 · 2 comments
Assignees
Labels
P2 Needed – Can wait indefinitely

Comments

@jtimpe
Copy link

jtimpe commented Jun 27, 2023

Per #2347 (comment)

Description:

Deploying celery as a separate application alleviates the application server and allows each to be independently scalable. This (roughly) requires:

  1. Deploy redis as a separate service

    1. See draft pr allowing django/celery to communicate with an external redis service as a broker.
    2. Remove redis-related lines from gunicorn_start.sh
      set -e
      
      echo "REDIS_SERVER"
      echo "redis local: $REDIS_SERVER_LOCAL"
      if [[ "$REDIS_SERVER_LOCAL" = "TRUE" || "$CIRCLE_JOB" = "backend-owasp-scan" ]]; then
          echo "Run redis server on docker"
      else
          echo "Run redis server locally"
          export LD_LIBRARY_PATH=/home/vcap/deps/0/lib/:/home/vcap/deps/1/lib:$LD_LIBRARY_PATH
          ( cd  /home/vcap/deps/0/bin/; ./redis-server /home/vcap/app/redis.conf &)
      fi
    3. Remove redis from deployed application dependencies apt.yml
    4. Remove REDIS_URI env manifest.buildpack.yml
    5. Deploy redis in cloud.gov and bind to application deployment using circleci
  2. Deploy celery as separate cloud.gov application, with its own manifest

    1. Make a copy manifest.buildpack.yml (named manifest.celery.yml or similar)
    2. Update the command in the new manifest to run a script starting celery, removing these lines from gunicorn_start.sh
      celery -A tdpservice.settings worker -c 1 &
      sleep 5
      # TODO: Uncomment the following line to add flower service when memory limitation is resolved
      celery -A tdpservice.settings --broker=$REDIS_URI flower &
      celery -A tdpservice.settings beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler &
    3. Deploy the new celery application in cloud.gov using circleci
      • must be bound to all same services as main application
      • copy/abstract logic in deploy-backend.sh - env var logic needs to exist for both celery/app, cf push new manifest

Acceptance Criteria:
Create a list of functional outcomes that must be achieved to complete this issue

  • Celery is deployed as its own cloud.gov application, changes are deployed via circle ci
  • Redis is deployed as a standalone cloud.gov service, bound to both celery and the main application
  • Testing Checklist has been run and all tests pass
  • README is updated, if necessary

Tasks:
Create a list of granular, specific work items that must be completed to deliver the desired outcomes of this issue

  • Task 1
  • Task 2
  • Task 3
  • Run Testing Checklist and confirm all tests pass

Notes:
Add additional useful information, such as related issues and functionality that isn't covered by this specific issue, and other considerations that will be helpful for anyone reading this

  • Note 1
  • Note 2
  • Note 3

Supporting Documentation:
Please include any relevant log snippets/files/screen shots

  • Doc 1
  • Doc 2

Open Questions:
Please include any questions or decisions that must be made before beginning work or to confidently call this issue complete

  • Open Question 1
  • Open Question 2
@George-Hudson
Copy link

PR here: #2773

@robgendron robgendron added the Refined Ticket has been refined at the backlog refinement label Apr 23, 2024
@robgendron robgendron added P1 Low Priority - Nice to Have P2 Needed – Can wait indefinitely and removed P1 Low Priority - Nice to Have labels Jul 30, 2024
@lhuxraft lhuxraft removed the Refined Ticket has been refined at the backlog refinement label Nov 25, 2024
@lhuxraft
Copy link
Collaborator

lhuxraft commented Dec 3, 2024

Jan to create a follow-on ticket to capture work that is left to do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Needed – Can wait indefinitely
Projects
None yet
Development

No branches or pull requests

4 participants