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

adding alembic task script #867

Merged
merged 1 commit into from
Dec 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
664 changes: 298 additions & 366 deletions server/api/Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion server/api/code/lacity_data_api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

DB_POOL_MIN_SIZE = config("DB_POOL_MIN_SIZE", cast=int, default=1)
DB_POOL_MAX_SIZE = config("DB_POOL_MAX_SIZE", cast=int, default=16)
DB_ECHO = config("DB_ECHO", cast=bool, default=True)
DB_ECHO = config("DB_ECHO", cast=bool, default=False)
DB_SSL = config("DB_SSL", default=None)
DB_USE_CONNECTION_FOR_REQUEST = config(
"DB_USE_CONNECTION_FOR_REQUEST", cast=bool, default=True
Expand Down
37 changes: 19 additions & 18 deletions server/api/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ aioredis==1.3.1
alembic==1.4.3
async-timeout==3.0.1
asyncpg==0.21.0
attrs==20.2.0
certifi==2020.6.20
attrs==20.3.0
certifi==2020.11.8
chardet==3.0.4
click==7.1.2
click-plugins==1.1.1
cligj==0.5.0
cligj==0.7.1
coverage==5.2.1
fastapi==0.61.1
Fiona==1.8.17
fastapi==0.62.0
Fiona==1.8.18
flake8==3.8.3
geopandas==0.8.1
gino==1.0.1
Expand All @@ -33,42 +33,43 @@ MarkupSafe==1.1.1
mccabe==0.6.1
more-itertools==8.5.0
munch==2.5.0
numpy==1.19.2
numpy==1.19.4
packaging==20.4
pandas==1.1.2
pandas==1.1.4
pluggy==0.13.1
psycopg2-binary==2.8.6
py==1.9.0
pycodestyle==2.6.0
pydantic==1.6.1
pydantic==1.7.3
pyflakes==2.2.0
pyparsing==2.4.7
pyproj==2.6.1.post1
pyproj==3.0.0.post1
pysupercluster==0.7.6
pytest==6.0.2
pytest-asyncio==0.14.0
pytest-cov==2.10.1
python-dateutil==2.8.1
python-editor==1.0.4
python-http-client==3.3.1
pytz==2020.1
pytz==2020.4
redis==3.5.3
requests==2.24.0
requests==2.25.0
requests-async==0.6.2
rfc3986==1.4.0
sendgrid==6.4.7
sentry-sdk==0.17.8
sendgrid==6.4.8
sentry-sdk==0.19.4
Shapely==1.7.1
six==1.15.0
sodapy==2.1.0
SQLAlchemy==1.3.19
SQLAlchemy==1.3.20
starkbank-ecdsa==1.1.0
starlette==0.13.6
tabulate==0.8.7
toml==0.10.1
ujson==3.2.0
urllib3==1.25.10
uvicorn==0.11.8
typing-extensions==3.7.4.3
ujson==4.0.1
urllib3==1.26.2
uvicorn==0.12.3
uvloop==0.14.0
websockets==8.1
zipp==3.2.0
zipp==3.4.0
27 changes: 27 additions & 0 deletions server/aws/alembic_task.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"cluster": "dev-la-311-data-cluster",
"launchType": "FARGATE",
"networkConfiguration": {
"awsvpcConfiguration": {
"subnets": [
"subnet-05a9561c4abba7116",
"subnet-0e7d64a65bc88febe"
],
"securityGroups": [
"sg-00b4654486a1229dd",
"sg-00ec23ab2fde83100",
"sg-0693ebb53e3d1bb45"
],
"assignPublicIp": "ENABLED"
}
},
"overrides": {
"containerOverrides": [
{
"name": "311_data_api",
"command": ["alembic","upgrade","head"]
}
]
},
"taskDefinition": "dev-la-311-data-server"
}
4 changes: 0 additions & 4 deletions server/aws/templates/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@
{ "name": "DB_DSN", "valueFrom": "/${stage}/${region}/DB_DSN" },
{ "name": "SENTRY_URL", "valueFrom": "/${stage}/${region}/SENTRY_URL" },
{ "name": "STAGE", "valueFrom": "/${stage}/${region}/STAGE" }
],
"environment": [
{ "name": "DEBUG", "value": "True" },
{ "name": "CACHE_ENDPOINT", "value": "localhost" }
]
}
]
2 changes: 2 additions & 0 deletions server/docs/useful_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ aws ecs update-service --cluster dev-la-311-data-cluster --service dev-la-311-da

aws ecs register-task-definition --cli-input-json task-definition.json --profile 311user

aws ecs run-task --cli-input-json file://alembic_task.json --profile 311user

aws logs describe-log-groups --profile 311user

aws elbv2 describe-load-balancers --profile 311user
Expand Down