diff --git a/.github/workflows/development.yaml b/.github/workflows/development.yaml index 4f57e3e..0666ff1 100644 --- a/.github/workflows/development.yaml +++ b/.github/workflows/development.yaml @@ -39,7 +39,6 @@ jobs: name: Performance and Load Testing runs-on: ubuntu-latest environment: testing - needs: unit_testing steps: - name: Checkout @@ -109,7 +108,6 @@ jobs: name: Vulnerability Scanning runs-on: ubuntu-latest environment: testing - needs: performance_and_load_testing steps: - name: Checkout diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml index dc6704d..302e233 100644 --- a/.github/workflows/production.yaml +++ b/.github/workflows/production.yaml @@ -39,7 +39,7 @@ jobs: needs: testing env: - version: '1.0' + version: latest service: ml-service region: asia-southeast2 project_id: ${{ secrets.GOOGLE_PROJECT }} @@ -110,7 +110,7 @@ jobs: id: deploy-cloud-run with: service: ml-service - image: gcr.io/${{ secrets.GOOGLE_PROJECT }}/ml-service:1.0 + image: gcr.io/${{ secrets.GOOGLE_PROJECT }}/ml-service:latest region: asia-southeast2 flags: | --cpu=4 @@ -118,17 +118,17 @@ jobs: --cpu-boost --memory=4Gi --timeout=800 - --concurrency=80 + --concurrency=80 --min-instances=0 --max-instances=13 --project=${{ secrets.GOOGLE_PROJECT }} --allow-unauthenticated --vpc-egress=private-ranges-only - --vpc-connector=projects/${{ secrets.GOOGLE_PROJECT }}/locations/asia-southeast2/connectors/ml-service-connector + --vpc-connector=projects/${{ secrets.GOOGLE_PROJECT }}/locations/asia-southeast2/connectors/ml-service-connector --service-account=${{ secrets.CLOUD_RUN_SA }} env_vars: | - VERSION=$version + VERSION=v1 JWT_ACCESS_TOKEN_SECRET=${{ secrets.JWT_ACCESS_TOKEN_SECRET }} JWT_REFRESH_TOKEN_SECRET=${{ secrets.JWT_REFRESH_TOKEN_SECRET }} JWT_ALGORITHM=${{ secrets.JWT_ALGORITHM }} @@ -140,5 +140,8 @@ jobs: POSTGRES_PASS=${{ secrets.POSTGRES_PASS }} POSTGRES_DB=${{ secrets.POSTGRES_DB }} - - name: 'Cloud Run URL Output' - run: 'echo "${{ steps.deploy-cloud-run.outputs.url }}"' + - name: Cloud Run URL Output + run: echo "${{ steps.deploy-cloud-run.outputs.url }}" + + - name: Send Discord Notification + run: echo "send notification" diff --git a/src/configurations/databases/postgresql.py b/src/configurations/databases/postgresql.py index 056a21e..56bb7ec 100644 --- a/src/configurations/databases/postgresql.py +++ b/src/configurations/databases/postgresql.py @@ -12,6 +12,10 @@ class Engines: def __init__(self) -> None: # IP Engine self.ip_engine: Engine = create_engine( + pool_size = 10, + pool_timeout = 5, + max_overflow = 10, + pool_recycle = 3600, url = ( f'postgresql+psycopg2://' + f'{os.getenv("POSTGRES_USER")}:{os.getenv("POSTGRES_PASS")}' + @@ -22,7 +26,11 @@ def __init__(self) -> None: # UNIX Socket Engine self.unix_sock_engine: Engine = create_engine( - engine.url.URL.create( + pool_size = 10, + pool_timeout = 5, + max_overflow = 10, + pool_recycle = 3600, + url = engine.url.URL.create( drivername = 'postgresql+psycopg2', username = f'{os.getenv("POSTGRES_USER")}', password = f'{os.getenv("POSTGRES_PASS")}', diff --git a/src/services/ml_services/__pycache__/nlp_service.cpython-39.pyc b/src/services/ml_services/__pycache__/nlp_service.cpython-39.pyc index 57b1271..5ae3035 100644 Binary files a/src/services/ml_services/__pycache__/nlp_service.cpython-39.pyc and b/src/services/ml_services/__pycache__/nlp_service.cpython-39.pyc differ diff --git a/src/utilities/__pycache__/nlp_utils.cpython-39.pyc b/src/utilities/__pycache__/nlp_utils.cpython-39.pyc index 4c6a63a..cff7403 100644 Binary files a/src/utilities/__pycache__/nlp_utils.cpython-39.pyc and b/src/utilities/__pycache__/nlp_utils.cpython-39.pyc differ