-
Notifications
You must be signed in to change notification settings - Fork 1
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
Setup Dev Deployment Infrastructure #23
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I just had a couple thoughts that might be worth considering as you add the initial job.
|
||
## Decision | ||
|
||
We will use Celery as the task queue for this project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be help to have a brief description of "why Celery" (vs alternatives) in here also.
nad_ch/config.py
Outdated
STORAGE_PATH = os.getenv("STORAGE_PATH") | ||
DATABASE_URL_LOCAL = os.getenv("DATABASE_URL_LOCAL") | ||
QUEUE_BROKER_URL_LOCAL = os.getenv("QUEUE_BROKER_URL_LOCAL") | ||
QUEUE_BACKEND_URL_LOCAL = os.getenv("QUEUE_BACKEND_URL_LOCAL") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of separate variables for, eg DATABASE_URL_LOCAL
and DATABASE_URL
, perhaps DATABASE_URL
could be defined inside an if condition for these kind of cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There could perhaps also be separate modules for each environment. Here's one way to do that: https://github.com/18F/FAC-Distiller/blob/main/distiller/settings/__init__.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach is much, much better--thank you for providing an example.
self.app.worker_main(argv=["worker", "--loglevel=info"]) | ||
|
||
|
||
class LocalTaskQueue: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! I could also see maybe wanting an in-memory broker for unit tests.
Changes include:
manifest-dev.yml
ApplicationContext
Session
object on instantiation: this makes it easier to set up a fakeSession
for testing