Skip to content

Commit

Permalink
Merge pull request #418 from noharm-ai/develop
Browse files Browse the repository at this point in the history
v4.14-beta
  • Loading branch information
marceloarocha authored Dec 2, 2024
2 parents ffbcf20 + f5884ed commit ee6c53a
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 22 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@ jobs:
run: |
python mobile.py &
sleep 10
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: sa-east-1
- name: Run Coverage Report
env:
CACHE_BUCKET_ID: ${{ secrets.CACHE_BUCKET_ID }}
CACHE_BUCKET_KEY: ${{ secrets.CACHE_BUCKET_KEY }}
CACHE_BUCKET_NAME: ${{ secrets.CACHE_BUCKET_NAME }}
run: python -m pytest --cov-report xml --cov=.
- name: Submit Coverage Report
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ jobs:
psql -h localhost -U postgres -d noharm -a -f database/noharm-newuser.sql -v ON_ERROR_STOP=1
psql -h localhost -U postgres -d noharm -a -f database/noharm-triggers.sql -v ON_ERROR_STOP=1
psql -h localhost -U postgres -d noharm -a -f database/noharm-insert.sql -v ON_ERROR_STOP=1
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: sa-east-1
- name: Run Python Tests
env:
CACHE_BUCKET_ID: ${{ secrets.CACHE_BUCKET_ID }}
CACHE_BUCKET_KEY: ${{ secrets.CACHE_BUCKET_KEY }}
CACHE_BUCKET_NAME: ${{ secrets.CACHE_BUCKET_NAME }}
CACHE_BUCKET_NAME: ${{ secrets.CACHE_BUCKET_NAME }}
run: python -m pytest -v
deploy:
needs: [build]
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ jobs:
psql -h localhost -U postgres -d noharm -a -f database/noharm-newuser.sql -v ON_ERROR_STOP=1
psql -h localhost -U postgres -d noharm -a -f database/noharm-triggers.sql -v ON_ERROR_STOP=1
psql -h localhost -U postgres -d noharm -a -f database/noharm-insert.sql -v ON_ERROR_STOP=1
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: sa-east-1
- name: Run Python Tests
env:
CACHE_BUCKET_ID: ${{ secrets.CACHE_BUCKET_ID }}
CACHE_BUCKET_KEY: ${{ secrets.CACHE_BUCKET_KEY }}
CACHE_BUCKET_NAME: ${{ secrets.CACHE_BUCKET_NAME }}
CACHE_BUCKET_NAME: ${{ secrets.CACHE_BUCKET_NAME }}
run: python -m pytest -v
deploy:
needs: [build]
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ jobs:
psql -h localhost -U postgres -d noharm -a -f database/noharm-newuser.sql -v ON_ERROR_STOP=1
psql -h localhost -U postgres -d noharm -a -f database/noharm-triggers.sql -v ON_ERROR_STOP=1
psql -h localhost -U postgres -d noharm -a -f database/noharm-insert.sql -v ON_ERROR_STOP=1
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: sa-east-1
- name: Run Python Tests
env:
CACHE_BUCKET_ID: ${{ secrets.CACHE_BUCKET_ID }}
CACHE_BUCKET_KEY: ${{ secrets.CACHE_BUCKET_KEY }}
CACHE_BUCKET_NAME: ${{ secrets.CACHE_BUCKET_NAME }}
CACHE_BUCKET_NAME: ${{ secrets.CACHE_BUCKET_NAME }}
run: python -m pytest -v
deploy:
needs: [build]
Expand Down
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class Config:
VERSION = "v4.13-beta"
VERSION = "v4.14-beta"
FRONTEND_VERSION = "4.0.10"
ENV = getenv("ENV") or NoHarmENV.DEVELOPMENT.value
SECRET_KEY = getenv("SECRET_KEY") or "secret_key"
Expand Down
6 changes: 1 addition & 5 deletions services/admin/admin_ai_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,7 @@ def get_factors(conversions):


def _get_client():
return boto3.client(
"s3",
aws_access_key_id=Config.CACHE_BUCKET_ID,
aws_secret_access_key=Config.CACHE_BUCKET_KEY,
)
return boto3.client("s3")


def _get_model(model_name):
Expand Down
6 changes: 1 addition & 5 deletions services/reports/reports_cache_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@


def _get_client():
return boto3.client(
"s3",
aws_access_key_id=Config.CACHE_BUCKET_ID,
aws_secret_access_key=Config.CACHE_BUCKET_KEY,
)
return boto3.client("s3")


def get_resource_name(report, schema, filename="current"):
Expand Down

0 comments on commit ee6c53a

Please sign in to comment.