-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into SNOW-172-feat#51/Swagger
- Loading branch information
Showing
23 changed files
with
498 additions
and
451 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: ai | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
push: | ||
branches: | ||
- develop | ||
paths: | ||
- "AI/**" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./AI/roop | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
username: ${{ secrets.DOCKER_ID }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Run scripts in server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
key: ${{ secrets.KEY }} | ||
host: ${{ secrets.AI_HOST }} | ||
username: ${{ secrets.USER_NAME }} | ||
script: ${{ secrets.AI_SCRIPT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,6 @@ d_id/conf.yaml | |
shotstack/conf.yaml | ||
s3/conf.yaml | ||
elevenlabs/conf.yaml | ||
|
||
# 환경변수 파일 | ||
*.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
FROM python:3.10 | ||
FROM python:3.10 AS builder | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
ARG CACHEBUST=1 | ||
WORKDIR /app | ||
COPY . ./ | ||
|
||
VOLUME ./image:./image | ||
COPY requirements.* ./ | ||
|
||
RUN pip install --upgrade pip | ||
RUN pip install --no-cache-dir -r ./requirements.txt | ||
|
||
COPY . ./ | ||
|
||
FROM python:3.10-slim AS deployer | ||
|
||
RUN apt-get update | ||
RUN apt-get -y install ffmpeg | ||
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages | ||
COPY --from=builder /app /app | ||
|
||
RUN pip install -r ./requirements.txt | ||
WORKDIR /app | ||
|
||
CMD ["python3", "app.py"] | ||
CMD ["python3", "app.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM python:3.10 AS builder | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
ARG CACHEBUST=1 | ||
WORKDIR /app | ||
COPY requirements* ./ | ||
|
||
RUN apt-get update && apt-get -y install ffmpeg | ||
|
||
RUN pip install --upgrade pip | ||
RUN pip install --no-cache-dir -r ./requirements-celery.txt | ||
|
||
COPY . ./ | ||
|
||
FROM python:3.10-slim AS deployer | ||
|
||
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages | ||
COPY --from=builder /app /app | ||
|
||
RUN apt-get update && apt-get -y install ffmpeg | ||
RUN pip install --no-cache-dir celery | ||
|
||
WORKDIR /app | ||
|
||
CMD ["celery", "-A", "tasks", "worker", "--loglevel=info"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import os | ||
from dotenv import load_dotenv | ||
|
||
BASE_DIR = os.path.dirname(os.path.dirname(__file__)) | ||
|
||
|
||
class Config: | ||
_instance = None | ||
|
||
DEBUG = False | ||
DID_API_KEY = None | ||
ELEVENLABS_API_KEY = None | ||
SHOT_STACK_API_KEY = None | ||
AWS_ACCESS_KEY_ID = None | ||
AWS_SECRET_ACCESS_KEY = None | ||
AWS_S3_BUCKET_REGION = None | ||
AWS_S3_BUCKET_NAME = None | ||
|
||
def __new__(cls): | ||
if cls._instance is None: | ||
cls._instance = super().__new__(cls) | ||
|
||
load_dotenv() | ||
|
||
cls._instance.DID_API_KEY = os.environ.get("D-ID_API_KEY") | ||
cls._instance.ELEVENLABS_API_KEY = os.environ.get("ELEVENLABS_API_KEY") | ||
cls._instance.SHOT_STACK_API_KEY = os.environ.get("SHOT_STACK_API_KEY") | ||
cls._instance.AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID") | ||
cls._instance.AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY") | ||
cls._instance.AWS_S3_BUCKET_REGION = os.environ.get("AWS_S3_BUCKET_REGION") | ||
cls._instance.AWS_S3_BUCKET_NAME = os.environ.get("AWS_S3_BUCKET_NAME") | ||
return cls._instance | ||
|
||
# 사용 예시: | ||
# config = Config() | ||
# print(config.ID_API_KEY) |
Oops, something went wrong.