Skip to content

Commit

Permalink
feat: 전체적인 구조 수정 & 6기 Product Serving 강의 커리큘럼 맞춤 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
zzsza committed Jan 28, 2024
1 parent 47b4019 commit 5beb763
Show file tree
Hide file tree
Showing 140 changed files with 27 additions and 880,995 deletions.
1 change: 1 addition & 0 deletions 01-batch-serving(airflow)/data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

12 changes: 6 additions & 6 deletions 01-batch-serving(airflow)/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
image: postgres:13
environment:
- POSTGRES_USER=airflow
- POSTGRES_PASSWORD=1234
- POSTGRES_PASSWORD=!boostcamp-aitech!
volumes:
- ./data:/var/lib/postgresql/data
restart: always
Expand All @@ -27,11 +27,11 @@ services:
airflow db init && \
airflow users create \
--username admin \
--password 1234 \
--firstname heumsi \
--lastname jeon \
--password !boostcamp-aitech! \
--firstname kyle \
--lastname byeon \
--role Admin \
--email heumsi@naver.com \
--email snugyun01@gmail.com \
"
restart: on-failure
networks:
Expand Down Expand Up @@ -72,7 +72,7 @@ services:
- airflow-init
image: codercom/code-server:4.0.1
environment:
- PASSWORD=1234
- PASSWORD=!boostcamp-aitech!
- HOST=0.0.0.0
- PORT=8888
volumes:
Expand Down
12 changes: 6 additions & 6 deletions 01-batch-serving(airflow)/docker-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $ docker run \
--network airflow \
-v $(pwd)/data:/var/lib/postgresql/data \
-e POSTGRES_USER=airflow \
-e POSTGRES_PASSWORD=1234 \
-e POSTGRES_PASSWORD=!boostcamp-aitech! \
postgres:13
```

Expand Down Expand Up @@ -70,11 +70,11 @@ $ docker run \
airflow db init && \
airflow users create \
--username admin \
--password 1234 \
--firstname heumsi \
--lastname jeon \
--password !boostcamp-aitech! \
--firstname seongyun \
--lastname byeon \
--role Admin \
--email heumsi@naver.com \
--email snugyun01@gmail.com \
"
```

Expand Down Expand Up @@ -141,7 +141,7 @@ $ docker run -it --name code-server \
-d \
-v "$(pwd)/dags:/home/coder/project" \
-p 8888:8888 \
-e PASSWORD=1234 \
-e PASSWORD=!boostcamp-aitech! \
-e HOST=0.0.0.0 \
-e PORT=8888 \
codercom/code-server:4.0.2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
from fastapi import FastAPI
import uvicorn
from contextlib import asynccontextmanager

app = FastAPI()
import uvicorn
from fastapi import FastAPI
from loguru import logger

items = {}


@app.on_event("startup")
def startup_event():
print("Start Up Event")
@asynccontextmanager
async def lifespan(app: FastAPI):
logger.info("Start Up Event")
items["foo"] = {"name": "Fighters"}
items["bar"] = {"name": "Tenders"}

yield

@app.on_event("shutdown")
def shutdown_event():
print("Shutdown Event!")
logger.info("Shutdown Event!")
with open("log.txt", mode="a") as log:
log.write("Application shutdown")


app = FastAPI(lifespan=lifespan)


@app.get("/items/{item_id}")
def read_items(item_id: str):
return items[item_id]


if __name__ == '__main__':
uvicorn.run(app, host="0.0.0.0", port=8000)


if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)
89 changes: 0 additions & 89 deletions new/cv_serving/.dockerignore

This file was deleted.

163 changes: 0 additions & 163 deletions new/cv_serving/.gitignore

This file was deleted.

14 changes: 0 additions & 14 deletions new/cv_serving/Dockerfile

This file was deleted.

Loading

0 comments on commit 5beb763

Please sign in to comment.