Skip to content

Commit

Permalink
Release v22.05.2022 (#328)
Browse files Browse the repository at this point in the history
* Add initial eb config files

* Fix import error

* Fix db backend

* Add custom middleware for ELB healthcheck & container commands

* Add container commands for frontend

* Fix eb extension configs

* Fix frontend eb extension config command

* Run npm i as root

* Remove problematic commands

* Increase  eb timeout

* Run frontend build command as root

* Change ec2 instances type to t2.medium

* Changes for new eb environment

* Add aws health  check middleware

* Fix ws connection path & health check middleware
  • Loading branch information
ravisumit33 authored May 22, 2022
1 parent ac126a5 commit 64e278b
Show file tree
Hide file tree
Showing 17 changed files with 956 additions and 324 deletions.
24 changes: 24 additions & 0 deletions .ebextensions/django.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
option_settings:
aws:elasticbeanstalk:application:environment:
DJANGO_SETTINGS_MODULE: mysterio.settings.production
aws:elbv2:listener:80:
DefaultProcess: http
ListenerEnabled: 'true'
Protocol: HTTP
Rules: ws
aws:elbv2:listenerrule:ws:
PathPatterns: /ws/*
Process: websocket
Priority: 1
aws:elasticbeanstalk:environment:process:http:
Port: '80'
Protocol: HTTP
aws:elasticbeanstalk:environment:process:websocket:
Port: '5000'
Protocol: HTTP

container_commands:
02_migrate:
command: "source /var/app/venv/*/bin/activate && python manage.py migrate"
leader_only: true

8 changes: 8 additions & 0 deletions .ebextensions/eb.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
option_settings:
- namespace: aws:elasticbeanstalk:command
option_name: Timeout
value: 2000

option_settings:
aws:ec2:instances:
InstanceTypes: 't2.medium'
9 changes: 9 additions & 0 deletions .ebextensions/frontend.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
container_commands:
01_node_install:
command: "curl -sL https://rpm.nodesource.com/setup_16.x | sudo bash - && sudo yum -y install nodejs"
02_npm_install:
command: "cd frontend && sudo npm install"
03_npm_build:
command: "cd frontend && sudo npm run build"
04_collectstatic:
command: "source /var/app/venv/*/bin/activate && python manage.py collectstatic --noinput"
3 changes: 3 additions & 0 deletions .ebextensions/postgres.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packages:
yum:
postgresql-devel: []
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,8 @@ dmypy.json

# Pyre type checker
.pyre/

# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
9 changes: 8 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[requires]
python_version = "3.8"

[packages]
channels = ">=3.0.4"
channels-redis = ">=3.3.1"
Expand All @@ -14,12 +17,14 @@ Django = ">=3.2.12"
djangorestframework = ">=3.13.1"
django-cors-headers = ">=3.11.0"
whitenoise = ">=5.3.0"
dj-database-url = ">=0.5.0"
python-dotenv = {extras = ["cli"], version = ">=0.19.2"}
dj-rest-auth = {extras = ["with_social"], version = ">=2.2.2"}
google-auth-oauthlib = ">=0.4.6"
google-auth-httplib2 = ">=0.1.0"
djangorestframework-simplejwt = ">=5.0.0"
boto3 = ">=1.22.9"
gunicorn = ">=20.1.0"
dj-database-url = ">=0.5.0"

[dev-packages]
pylint = ">=2.12.2"
Expand All @@ -29,3 +34,5 @@ pre-commit = ">=2.17.0"
django-extensions = ">=3.1.5"
pyparsing = ">=3.0.7"
pydot = ">=1.4.2"
awsebcli = ">=3.20.3"
django-stubs = ">=1.10.1"
Loading

0 comments on commit 64e278b

Please sign in to comment.