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

Elastic Beanstalk Support #1867

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Elastic Beanstalk Support #1867

wants to merge 10 commits into from

Conversation

chigby
Copy link
Contributor

@chigby chigby commented Jun 14, 2024

This draft pull request should not be merged yet. It is unfinished and requires some more work on the Amazon Elastic Beanstalk (EB) environment and configuration before it will, in addition to other potential code changes to this repo.

Some changes so far (see individual commits for more detail):

  • EB environment setup (ignore files, extension file settings for configuring the base machine's packages and the settings for our actual WSGI process).
  • Adding an eb_production.py file which mimics our production settings with EB-specific changes. If/when we decide to run the actual site on EB, these settings should probably find their way into the regular production/dev settings files as necessary and the eb_ prefixed file removed.

I've been attempting to get this branch running on EB using the command line tool and running some commands. These commands often call for an environment name, and the one I'm using is newamerica-cms-dev.

  • eb console -- opens the web page for the stats and configuration of the environment.
  • eb deploy <environment name> -- deploys the current state of the source tree to the environment. When you make changes to the code, whether or not they're committed in git, this command will send those to EB to try and run
  • eb logs <environment name> -- shows the logs for the environment. Sometimes, this commands fails for me with a 400 error, which is weird since the thing issuing the request is also created by Amazon. In those cases, sometimes the logs are available on the eb console page (sometimes they aren't though).
  • eb open <environment name> -- opens URL that the environment is running on. This should be the actual wagtail instance URL. But I haven't gotten it to actually load anything beyond an error page because the configuration isn't correct yet.

The current state of the newamerica-cms-dev environment is: the console says it's "ok" but the site won't load and I can't add a database (from the left sidebar of the console's Configuration option, then Networking and Databases) without getting these errors:

Service:AmazonCloudFormation, Message:Stack named 'awseb-e-mqm28pkquz-stack' aborted operation. Current state: 'UPDATE_ROLLBACK_COMPLETE' Reason: null
Creating RDS database security group named: awseb-e-mqm28pkquz-stack-awsebrdsdbsecuritygroup-ox7kcrhn7822 failed Reason: Internal Failure

My current theory is that creating the database also creates an RDS security group, but the user I'm running as might not have permission to do so. I can't confirm this though, and I've poked around in the users and permissions areas of AWS and not found anything obviously helpful.

chigby added 10 commits May 31, 2024 10:02
The 5.x branch is the only one that's compatible with python
3.11 (which our EB env uses).
In an attempt to get the site to stand up in the Elastic
Beanstalk (EB) environment, I'm attempting to remove non-Django
services that aren't configured yet.  These should be re-enabled as
the components of the EB infrastructure are activated.
Our procfile has worker/celery related code, so I removed it because
that piece of the infrastructure wasn't ready yet and so the service
was crashing.  Attempting to apply the same settings (or similar ones
recommended in the docs) via a config file in `.ebextensions/`.
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.

1 participant