Skip to content

Commit

Permalink
Merge pull request #69 from tukcomCD2024/build/#68-backend-fastapi-cicd
Browse files Browse the repository at this point in the history
Build/#68 Fastapi CI/CD 설정
  • Loading branch information
yeonjy authored Apr 17, 2024
2 parents d25a040 + 94770e5 commit f48323c
Show file tree
Hide file tree
Showing 4 changed files with 281 additions and 6 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Set Docker-compose.yml
uses: microsoft/variable-substitution@v1
with:
files: ./backend/core/docker-compose.yml
files: ./backend/docker-compose.yml
env:
services.rabbitmq.environment.RABBITMQ_DEFAULT_USER: ${{ secrets.RABBITMQ_DEFAULT_USER }}
services.rabbitmq.environment.RABBITMQ_DEFAULT_PASS: ${{ secrets.RABBITMQ_DEFAULT_PASS }}
Expand All @@ -66,8 +66,20 @@ jobs:
- name: Docker build & push to docker repo
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -f Dockerfile -t ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }} .
docker push ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }}
docker build -f Dockerfile -t ${{ secrets.DOCKER_USERNAME }}/${{ secrets.CORE_DOCKER_REPO }} .
docker push ${{ secrets.DOCKER_USERNAME }}/${{ secrets.CORE_DOCKER_REPO }}
docker build -f Dockerfile -t ${{ secrets.DOCKER_USERNAME }}/${{ secrets.AI_DOCKER_REPO }} .
docker push ${{ secrets.DOCKER_USERNAME }}/${{ secrets.AI_DOCKER_REPO }}
# # FastAPI를 빌드하고 푸시
# - name: Build and push Docker image
# uses: docker/build-push-action@v5
# with:
# context: ./backend/ai_response_processor
# file: ./backend/ai_response_processor/Dockerfile
# push: true
# tags: ${{ secrets.DOCKER_USERNAME }}/${{ secrets.AI_DOCKER_REPO }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down
11 changes: 11 additions & 0 deletions backend/ai_response_processor/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.11

WORKDIR /code

COPY ./requirements.txt /code/requirements.txt

RUN pip install --no-cache-dir -r /code/requirements.txt

COPY ./app /code/app

CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
244 changes: 241 additions & 3 deletions backend/ai_response_processor/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,244 @@
aiofiles==23.2.1
aiohttp==3.8.5
aiosignal==1.3.1
altair==5.1.1
annotated-types==0.5.0
antlr4-python3-runtime==4.9.3
anyio==3.7.1
appnope==0.1.3
asttokens==2.4.0
async-timeout==4.0.3
attrs==23.1.0
backcall==0.2.0
backoff==2.2.1
bcrypt==4.0.1
beautifulsoup4==4.12.2
black==23.9.1
blinker==1.6.2
blis==0.7.10
Brotli==1.1.0
cachetools==5.3.1
catalogue==2.0.9
certifi==2023.7.22
cffi==1.15.1
chardet==5.2.0
charset-normalizer==3.2.0
chroma-hnswlib==0.7.3
chromadb==0.4.11
click==8.1.7
coloredlogs==15.0.1
comm==0.1.4
confection==0.1.3
contourpy==1.1.1
cryptography==41.0.4
cycler==0.11.0
cymem==2.0.8
dataclasses-json==0.5.14
debugpy==1.8.0
decorator==5.1.1
dill==0.3.7
dnspython==2.4.2
duckduckgo-search==3.8.5
EbookLib==0.18
effdet==0.4.1
elastic-transport==8.4.0
elasticsearch==8.9.0
email-validator==2.0.0.post2
emoji==2.8.0
et-xmlfile==1.1.0
executing==1.2.0
faiss-cpu==1.7.4
fastapi==0.110.0
ffmpeg==1.4
ffmpeg-python==0.2.0
filelock==3.12.4
filetype==1.2.0
flatbuffers==23.5.26
fonttools==4.42.1
frozenlist==1.4.0
fsspec==2023.9.1
future==0.18.3
gitdb==4.0.10
GitPython==3.1.35
gpt4all==2.0.2
greenlet==3.0.0
h11==0.14.0
h2==4.1.0
hpack==4.0.0
html2text==2020.1.16
httpcore==0.18.0
httptools==0.6.0
httpx==0.25.0
huggingface-hub==0.16.4
humanfriendly==10.0
hyperframe==6.0.1
idna==3.4
importlib-metadata==6.8.0
importlib-resources==6.0.1
install==1.3.5
iopath==0.1.10
ipykernel==6.25.2
ipython==8.15.0
itsdangerous==2.1.2
jedi==0.19.0
Jinja2==3.1.2
joblib==1.3.2
jsonpatch==1.33
jsonpointer==2.4
jsonschema==4.19.0
jsonschema-specifications==2023.7.1
jupyter_client==8.3.1
jupyter_core==5.3.1
kiwisolver==1.4.5
langchain==0.0.332
python-dotenv==1.0.0
langcodes==3.3.0
langsmith==0.0.52
layoutparser==0.3.4
loguru==0.7.2
lxml==4.9.3
manifest-ml==0.0.1
Markdown==3.4.4
markdown-it-py==3.0.0
MarkupSafe==2.1.3
marshmallow==3.20.1
matplotlib==3.8.0
matplotlib-inline==0.1.6
mdurl==0.1.2
monotonic==1.6
mpmath==1.3.0
msg-parser==1.2.0
multidict==6.0.4
murmurhash==1.0.10
mypy-extensions==1.0.0
nest-asyncio==1.5.8
networkx==3.1
nltk==3.8.1
numexpr==2.8.5
numpy==1.25.2
olefile==0.46
omegaconf==2.3.0
onnx==1.14.1
onnxruntime==1.16.0
openai==0.28.0
uvicorn==0.28.0
opencv-python==4.8.0.76
openpyxl==3.1.2
orjson==3.9.9
overrides==7.4.0
packaging==23.1
pandas==2.1.0
parso==0.8.3
pathspec==0.11.2
pathy==0.10.2
pdf2image==1.16.3
pdfminer.six==20221105
pdfplumber==0.10.2
pexpect==4.8.0
pickleshare==0.7.5
pika==1.3.2
fastapi==0.110.0
Pillow==9.5.0
pinecone-client==2.2.4
platformdirs==3.10.0
playwright==1.39.0
portalocker==2.8.2
posthog==3.0.2
preshed==3.0.9
prompt-toolkit==3.0.39
protobuf==4.24.3
psutil==5.9.5
ptyprocess==0.7.0
pulsar-client==3.3.0
pure-eval==0.2.2
pyarrow==13.0.0
pycocotools==2.0.7
pycparser==2.21
pydantic==1.10.12
pydantic_core==2.6.3
pydeck==0.8.0
pydub==0.25.1
pyee==11.0.1
Pygments==2.16.1
Pympler==1.0.1
pypandoc==1.11
pyparsing==3.1.1
pypdf==3.16.2
pypdfium2==4.20.0
PyPika==0.48.9
pytesseract==0.3.10
python-dateutil==2.8.2
python-docx==0.8.11
python-dotenv==1.0.0
python-iso639==2023.6.15
python-magic==0.4.27
python-multipart==0.0.6
python-pptx==0.6.21
pytube==11.0.2
pytz==2023.3.post1
pytz-deprecation-shim==0.1.0.post0
PyYAML==6.0.1
pyzmq==25.1.1
rapidfuzz==3.3.1
redis==5.0.0
referencing==0.30.2
regex==2023.8.8
requests==2.31.0
rich==13.5.2
rpds-py==0.10.2
safetensors==0.3.3
scikit-learn==1.3.1
scipy==1.11.3
sentence-transformers==2.2.2
sentencepiece==0.1.99
six==1.16.0
smart-open==6.4.0
smmap==5.0.0
sniffio==1.3.0
socksio==1.0.0
soupsieve==2.5
spacy==3.6.1
spacy-legacy==3.0.12
spacy-loggers==1.0.5
SQLAlchemy==2.0.22
sqlitedict==2.1.0
srsly==2.4.7
stack-data==0.6.2
starlette==0.36.3
streamlit==1.27.2
sympy==1.12
tabulate==0.9.0
tenacity==8.2.3
thinc==8.1.12
threadpoolctl==3.2.0
tiktoken==0.5.1
timm==0.9.7
tokenizers==0.14.0
toml==0.10.2
toolz==0.12.0
torch==2.0.1
torchvision==0.15.2
tornado==6.3.3
tqdm==4.66.1
traitlets==5.10.0
transformers==4.34.0
typer==0.9.0
typing-inspect==0.9.0
typing_extensions==4.10.0
tzdata==2023.3
tzlocal==4.3.1
ujson==5.8.0
unstructured==0.10.16
unstructured-inference==0.6.6
unstructured.pytesseract==0.3.12
urllib3==1.26.16
uvicorn==0.28.0
uvloop==0.19.0
validators==0.22.0
wasabi==1.1.2
watchdog==3.0.0
watchfiles==0.20.0
wcwidth==0.2.6
websockets==11.0.3
wikipedia==1.4.0
xlrd==2.0.1
XlsxWriter==3.1.5
yarl==1.9.2
zipp==3.16.2
14 changes: 14 additions & 0 deletions backend/core/docker-compose.yml → backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,22 @@ services:
depends_on:
- redis
- rabbitmq
- ai_server
networks:
- app-tier

ai_server:
container_name: ai-response-processor
image: "limyeonjy/ai-response-processor"
ports:
- "8000:8000"
volumes:
- ./app:/code/app
depends_on:
- rabbitmq
networks:
- app-tier

redis:
image: redis:latest
container_name: redis
Expand Down

0 comments on commit f48323c

Please sign in to comment.