Skip to content

Commit

Permalink
Merge branch 'master' into lipsync_pricing_limits
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderGi committed Jul 2, 2024
2 parents 5faaf7e + 957abe0 commit 39bf060
Show file tree
Hide file tree
Showing 122 changed files with 4,717 additions and 3,994 deletions.
6 changes: 2 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ APP_BASE_URL=http://localhost:3000
API_BASE_URL=http://localhost:8080
ADMIN_BASE_URL=http://localhost:8000

GS_BUCKET_NAME=dara-c1b52.appspot.com
GCP_PROJECT=dara-c1b52
GCP_REGION=us-central1

PGHOST=127.0.0.1
PGPORT=5432
PGUSER=gooey
PGDATABASE=gooey
PGPASSWORD=gooey

STRIPE_PRODUCT_IDS='{"creator": "prod_Q9x4USwPZXAjDr", "business": "prod_Q9YfjAsk4kq5o3", "addon": "prod_Pz8hAslLzckWRw"}'
PAYPAL_PLAN_IDS='{"basic": "P-7EE20432AK666360GMYZFNBQ", "premium": "P-35W68839HF2588719MYZFN5Y", "creator": "P-3T117524WS380863NMZIH36Y", "business": "P-5D3735626S133783GMZIH4MI"}'
97 changes: 97 additions & 0 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Python tests

on: [ push, workflow_dispatch ]

jobs:
test:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [ "3.10.12" ]
poetry-version: [ "1.8.3" ]

# Service containers to run with `test`
services:
# https://docs.github.com/en/actions/using-containerized-services/creating-postgresql-service-containers
postgres:
# Docker Hub image
image: postgres:15.2
# Provide the password for postgres
env:
POSTGRES_DB: gooey
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
# Set health checks to wait until postgres has started
options: >-
--name postgres
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
# https://docs.github.com/en/actions/using-containerized-services/creating-redis-service-containers
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 6379 on service container to the host
- 6379:6379
steps:
# https://remarkablemark.org/blog/2022/05/12/github-actions-postgresql-increase-max-connections-and-shared-buffers/
- name: Increase max_connections
run: >-
docker exec -i postgres bash << EOF
sed -i -e 's/max_connections = 100/max_connections = 10000/' /var/lib/postgresql/data/postgresql.conf
EOF
- name: Restart postgres
run: >-
docker restart postgres
&& while ! docker exec postgres pg_isready; do sleep 5; done
- name: Install system dependencies
run: >-
sudo apt-get update && sudo apt-get install -y --no-install-recommends
libpoppler-cpp-dev
python3-opencv
postgresql-client
libzbar0
- uses: actions/checkout@v4

- name: Setup Python, Poetry and Dependencies
uses: packetcoders/action-setup-cache-python-poetry@main
with:
python-version: ${{matrix.python-version}}
poetry-version: ${{matrix.poetry-version}}
install-args: --only main

- name: Run tests
env:
PGHOST: localhost
PGPORT: 5432
PGDATABASE: gooey
PGUSER: postgres
PGPASSWORD: password
REDIS_URL: redis://localhost:6379/0
REDIS_CACHE_URL: redis://localhost:6379/1
APP_BASE_URL: http://localhost:3000
API_BASE_URL: http://localhost:8080
ADMIN_BASE_URL: http://localhost:8000
GCP_PROJECT: ${{ vars.GCP_PROJECT }}
GCP_REGION: ${{ vars.GCP_REGION }}
GOOGLE_APPLICATION_CREDENTIALS_JSON: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }}
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
ELEVEN_LABS_API_KEY: ${{ secrets.ELEVEN_LABS_API_KEY }}
AZURE_SPEECH_REGION: ${{ secrets.AZURE_SPEECH_REGION }}
AZURE_SPEECH_KEY: ${{ secrets.AZURE_SPEECH_KEY }}
AZURE_FORM_RECOGNIZER_ENDPOINT: ${{ secrets.AZURE_FORM_RECOGNIZER_ENDPOINT }}
AZURE_FORM_RECOGNIZER_KEY: ${{ secrets.AZURE_FORM_RECOGNIZER_KEY }}
TEST_SLACK_TEAM_ID: ${{ secrets.TEST_SLACK_TEAM_ID }}
TEST_SLACK_USER_ID: ${{ secrets.TEST_SLACK_USER_ID }}
TEST_SLACK_AUTH_TOKEN: ${{ secrets.TEST_SLACK_AUTH_TOKEN }}
run: |
poetry run ./scripts/run-tests.sh
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN wget -qO- 'https://poppler.freedesktop.org/poppler-23.07.0.tar.xz' | tar -xJ
&& rm -rf poppler-23.07.0

# install latest pandoc - https://github.com/jgm/pandoc/releases
RUN wget -qO pandoc.deb 'https://github.com/jgm/pandoc/releases/download/3.1.13/pandoc-3.1.13-1-amd64.deb' \
RUN wget -qO pandoc.deb 'https://github.com/jgm/pandoc/releases/download/3.2/pandoc-3.2-1-amd64.deb' \
&& dpkg -i pandoc.deb \
&& rm pandoc.deb

Expand Down Expand Up @@ -65,4 +65,5 @@ HEALTHCHECK CMD \
|| bash -c 'poetry run celery -A celeryapp inspect ping -d celery@$HOSTNAME' \
|| exit 1

CMD poetry run ./scripts/run-prod.sh
ENTRYPOINT ["poetry", "run"]
CMD ["./scripts/run-prod.sh"]
201 changes: 0 additions & 201 deletions LICENSE

This file was deleted.

Loading

0 comments on commit 39bf060

Please sign in to comment.