Skip to content

Commit

Permalink
prepares file structure to deploy to elastic beanstalk
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-McAdam committed Jun 10, 2020
1 parent 50a5ce6 commit d7c1e10
Show file tree
Hide file tree
Showing 10 changed files with 233 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.DS_Store
.env

Pipfile
Pipfile.lock

# kelli's file
secrets.ipynb

Expand Down
7 changes: 6 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ verify_ssl = true
pandas = "*"
arrow = "*"
beautifulsoup4 = "*"
boto3 = "*"
elasticsearch = {extras = ["async"],version = "*"}
requests = "*"
requests-aws4auth = "*"
flatten-dict = "*"
pytest = "*"
snapshottest = "*"
pytest-sugar = "*"
pytest-cov = "*"
fastapi = "*"
uvicorn = "*"
gunicorn = "*"

[requires]
python_version = "3.8"
python_version = "3.7"
192 changes: 190 additions & 2 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn startup:app -w 4 -k uvicorn.workers.UvicornWorker
6 changes: 3 additions & 3 deletions etl/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from etl.extract import merge_all_apis
from etl.transform import transform_df
from etl.load import query
from extract import merge_all_apis
from transform import transform_df
from load import query


def main():
Expand Down
6 changes: 5 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ pandas
arrow
beautifulsoup4
boto3
elasticsearch
elasticsearch[async]
requests
requests-aws4auth
flatten-dict
fastapi
uvicorn
gunicorn


# test requirements
pytest
Expand Down
Empty file added src/app/__init__.py
Empty file.
23 changes: 23 additions & 0 deletions src/app/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from fastapi import FastAPI
from fastapi.responses import HTMLResponse
from fastapi.middleware.cors import CORSMiddleware

app = FastAPI()

app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)

@app.get("/")
async def root():
"""
Kondoboard Cron Deployed
"""
return HTMLResponse("""
<h1>Kondoboard Cron Deployed</h1>
<p>Go to <a href="/docs">/docs</a> for documentation.</p>
""")
Empty file added src/tests/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions startup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# startup shim - points to the application in src/app/main.py
from src.app.main import app

0 comments on commit d7c1e10

Please sign in to comment.