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

Google CSE 키값 추가 배포 #89

Merged
merged 18 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 11 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
8 changes: 5 additions & 3 deletions .github/workflows/deploy-ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ jobs:
DB_NAME=${{ secrets.DB_NAME }}
DB_PORT=${{ secrets.DB_PORT }}
OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}
GOOGLE_CSE_ID=${{ secrets.GOOGLE_CSE_ID }}
GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }}
USER_AGENT=${{ secrets.USER_AGENT }}
cache-from: type=gha
cache-to: type=gha,mode=min,ignore-error=true

Expand Down Expand Up @@ -129,7 +132,6 @@ jobs:
if [ "$CURRENT_TASK_DEF_ARN" != "$NEW_TASK_DEF_ARN" ]; then
echo "Deployment failed."
exit 1
fi

- name: Post Slack Channel that Build Success
if: success()
Expand All @@ -139,7 +141,7 @@ jobs:
channel-id: ${{ env.PROGRESS_SLACK_CHANNEL }}
payload: |
{
"text": ":white_check_mark: *Gyeongdan FastAPI ${{ github.ref_name }}* 배포가 성공했습니다.",
"text": ":pedro: *Gyeongdan FastAPI ${{ github.ref_name }}* 배포가 성공했습니다.",
"blocks": [
{
"type": "section",
Expand Down Expand Up @@ -177,7 +179,7 @@ jobs:
channel-id: ${{ env.PROGRESS_SLACK_CHANNEL }}
payload: |
{
"text": ":x: *Gyeongdan FastAPI ${{ github.ref_name }}* 배포가 실패했습니다.",
"text": ":typingcat: *Gyeongdan FastAPI ${{ github.ref_name }}* 배포가 실패했습니다.",
"blocks": [
{
"type": "section",
Expand Down
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[MASTER]
init-hook='import sys;sys.path.extend(["$(pipenv --venv)/lib/python3.x/site-packages", "."])'
[MESSAGES CONTROL]
disable=C0114,C0115,C0116,R0903,E0401,W0622,C0103,R0913,C0301
disable=C0114,C0115,C0116,R0903,E0401,W0622,C0103,R0913,C0301,C0413
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ FROM --platform=linux/amd64 python:3.11.4-slim-bookworm
WORKDIR /app

RUN apt-get update && \
apt-get install -y --no-install-recommends gcc libpq-dev libatlas-base-dev && \
apt-get install -y --no-install-recommends gcc libpq-dev libatlas-base-dev libomp-dev && \
pip install --no-cache-dir pipenv

COPY Pipfile Pipfile.lock ./
RUN pipenv install --deploy --ignore-pipfile
RUN pipenv install --deploy --ignore-pipfile && \
pipenv run pip install --no-binary lightfm lightfm

RUN apt-get purge -y --auto-remove gcc && \
rm -rf /var/lib/apt/lists/*
Expand All @@ -23,13 +24,19 @@ ARG DB_PASSWORD
ARG DB_NAME
ARG DB_PORT
ARG OPENAI_API_KEY
ARG GOOGLE_CSE_ID
ARG GOOGLE_API_KEY
ARG USER_AGENT

ENV DB_HOST=${DB_HOST}
ENV DB_USER=${DB_USER}
ENV DB_PASSWORD=${DB_PASSWORD}
ENV DB_NAME=${DB_NAME}
ENV DB_PORT=${DB_PORT}
ENV OPENAI_API_KEY=${OPENAI_API_KEY}
ENV GOOGLE_CSE_ID=${GOOGLE_CSE_ID}
ENV GOOGLE_API_KEY=${GOOGLE_API_KEY}
ENV USER_AGENT=${USER_AGENT}

RUN chmod +x ./entrypoint.sh

Expand Down
5 changes: 4 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import asyncio
import warnings

warnings.filterwarnings("ignore", category=UserWarning, module="lightfm")

from dotenv import load_dotenv
from fastapi import FastAPI
Expand All @@ -9,8 +12,8 @@
LoggingMiddleware,
)
from app.router.generate_simple_article_router import simple_article_router
from app.router.user_type_router import user_type_router
from app.router.send_email_service_router import send_email_service_router
from app.router.user_type_router import user_type_router
from app.service.news_scheduling_service import schedule_task

app = FastAPI()
Expand Down