Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Allows worker to start successfully in both dev and dev_with_worker #1250

Merged
merged 3 commits into from
Sep 2, 2022

Conversation

eastandwestwind
Copy link
Contributor

@eastandwestwind eastandwestwind commented Sep 2, 2022

Purpose

Allows worker to start successfully for both dev and dev_with_worker nox commands

Changes

  • Don't override FIDESOPS__EXECUTION__WORKER_ENABLED config in docker-compose
  • Use detach flag for starting up worker in separate container- https://docs.docker.com/engine/reference/commandline/compose_up/#description. This starts the worker container in the background and doesn't block the creation of fidesops container. Only downside is logs aren't visible in main shell where the nox commands are used, but you'll need to docker logs [container-id] to see celery logs.

Checklist

  • Update CHANGELOG.md file
    • Merge in main so the most recent CHANGELOG.md file is being appended to
    • Add description within the Unreleased section in an appropriate category. Add a new category from the list at the top of the file if the needed one isn't already there.
    • Add a link to this PR at the end of the description with the PR number as the text. example: #1
  • Applicable documentation updated (guides, quickstart, postman collections, tutorial, fidesdemo, database diagram.
  • If docs updated (select one):
    • documentation complete, or draft/outline provided (tag docs-team to complete/review on this branch)
    • documentation issue created (tag docs-team to complete issue separately)
  • Good unit test/integration test coverage
  • This PR contains a DB migration. If checked, the reviewer should confirm with the author that the down_revision correctly references the previous migration before merging
  • The Run Unsafe PR Checks label has been applied, and checks have passed, if this PR touches any external services

Ticket

Fixes #1249

build(session, "dev")
session.notify("teardown")
session.run("docker-compose", "up", "worker", "--wait", external=True)
session.run("docker-compose", "up", "--detach", "worker", external=True)
Copy link
Contributor Author

@eastandwestwind eastandwestwind Sep 2, 2022

Choose a reason for hiding this comment

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

using the "--wait" flag properly: session.run("docker-compose", "up", "--wait", "worker", external=True) resulted in fidesops container never starting. This is because the wait flag will block until the current container exits (https://docs.docker.com/engine/reference/commandline/wait/). Celery container should not exit.

@seanpreston seanpreston merged commit 4d4c9c4 into main Sep 2, 2022
@seanpreston seanpreston deleted the 1249-fix-worker-nox-commands branch September 2, 2022 18:42
sanders41 pushed a commit that referenced this pull request Sep 22, 2022
…1250)

* Allows worker to start successfully in both dev and dev_with_worker

* update changelog

* formatting
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Worker not starting with nox dev and nox dev_with_worker
2 participants