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

Setup Dev Deployment Infrastructure #23

Merged
merged 10 commits into from
Jan 24, 2024
Merged

Setup Dev Deployment Infrastructure #23

merged 10 commits into from
Jan 24, 2024

Conversation

akuny
Copy link
Collaborator

@akuny akuny commented Jan 24, 2024

Changes include:

  • Draft GitHub Action workflow to deploy app to remote dev environment
  • Define dev deployment environment in manifest-dev.yml
  • Add ADR rationalizing use of Celery
  • Refactor so that environment-specific configuration variables are always passed to infrastructure code by ApplicationContext
  • Refactor repositories so that they take a SQLAlchemy Session object on instantiation: this makes it easier to set up a fake Session for testing
  • Rework entry points and include a dummy web server (required in order to deploy to remote dev)

@akuny akuny requested a review from danielnaab January 24, 2024 14:38
Copy link
Collaborator

@danielnaab danielnaab left a 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.
Copy link
Collaborator

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")
Copy link
Collaborator

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?

Copy link
Collaborator

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

Copy link
Collaborator Author

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:
Copy link
Collaborator

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.

@akuny akuny merged commit 7d85e95 into main Jan 24, 2024
1 check passed
@akuny akuny deleted the dev-deployment branch January 24, 2024 20:15
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