Skip to content

Commit

Permalink
chore: deploy configs
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethnym committed Jul 21, 2024
1 parent 49910ec commit f73f98d
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
*.mp3
__pycache__

18 changes: 18 additions & 0 deletions .github/workflows/fly-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/

name: Fly Deploy
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
concurrency: deploy-group # optional: ensure only one action runs at a time
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM python:3.9

WORKDIR /code

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

RUN python --version
RUN pip3 --version

RUN pip3 install torch==2.1.0 -f https://download.pytorch.org/whl/cu111/torch_stable.html && \
pip3 install setuptools wheel && \
pip3 install --no-cache-dir -r /code/requirements.txt -f https://download.pytorch.org/whl/cu111/torch_stable.html

COPY . /code

CMD ["fastapi", "run", "server.py", "--port", "8000"]

22 changes: 22 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# fly.toml app configuration file generated for infinifi on 2024-07-21T22:09:32+01:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'infinifi'
primary_region = 'lhr'

[build]

[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ['app']

[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
torchtext==0.16.0
torchaudio==2.1.0
audiocraft==1.3.0
fastapi==0.111.1
modal==0.63.84
torch==2.1.0
torchaudio==2.1.0

0 comments on commit f73f98d

Please sign in to comment.