From e1ec2aff6b05ff04ba69e65d981e592cd2f594be Mon Sep 17 00:00:00 2001 From: Ivan Rublev Date: Fri, 21 Jun 2024 08:56:58 +0200 Subject: [PATCH] Fix elastic url --- .github/workflows/fly.yml | 45 +++++++++++++++++++++++++++++++++++++++ fly.toml | 4 ++-- 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/fly.yml diff --git a/.github/workflows/fly.yml b/.github/workflows/fly.yml new file mode 100644 index 0000000..fdeb58d --- /dev/null +++ b/.github/workflows/fly.yml @@ -0,0 +1,45 @@ +name: Fly Deploy +on: + push: + branches: + - 'master' +env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} +jobs: + test: + name: Run tests + runs-on: ubuntu-latest + env: + STREAMLIT_SERVER_PORT: 8080 + STREAMLIT_SERVER_COOKIE_SECRET: 00000000-0000-0000-0000-000000000000 + OPENAI_API_KEY: nnn + steps: + - uses: actions/checkout@v4 + - name: Restore asdf cache + id: asdf-cache + uses: actions/cache@v4 + with: + path: ~/.asdf + key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }} + - name: Install asdf + uses: asdf-vm/actions/install@v3 + - name: Restore poetry cache + id: poetry-cache + uses: actions/cache@v4 + with: + path: ~/.cache/pypoetry + key: ${{ runner.os }}-poetry-${{ hashFiles('pyproject.toml') }} + - name: Install Dependencies + run: make deps + - name: Run Linter + run: make lint + - name: Run Tests + run: make test_once + deploy: + name: Deploy to fly.io + runs-on: ubuntu-latest + needs: test + steps: + - uses: actions/checkout@v4 + - uses: superfly/flyctl-actions/setup-flyctl@master + - run: flyctl deploy --remote-only diff --git a/fly.toml b/fly.toml index 0171b66..0ab9881 100644 --- a/fly.toml +++ b/fly.toml @@ -18,8 +18,8 @@ kill_timeout = '5s' wait_timeout = '10m0s' [env] - ELASTIC_URL = 'llm-pdf-elastic.internal' - HOST = 'http://llm-pdf.fly.dev:19200' + ELASTIC_URL = 'http://llm-pdf-elastic.internal:9200' + HOST = 'llm-pdf.fly.dev' STREAMLIT_SERVER_PORT = '8080' [http_service]