diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..7573fb0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.DS_Store +*.mp3 +__pycache__ + diff --git a/.github/workflows/fly-deploy.yml b/.github/workflows/fly-deploy.yml new file mode 100644 index 0000000..b0c246e --- /dev/null +++ b/.github/workflows/fly-deploy.yml @@ -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 }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..59a3b25 --- /dev/null +++ b/Dockerfile @@ -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"] + diff --git a/fly.toml b/fly.toml new file mode 100644 index 0000000..b60a135 --- /dev/null +++ b/fly.toml @@ -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 diff --git a/requirements.txt b/requirements.txt index 96b9cdc..1cbcf5d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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