Skip to content

Commit

Permalink
feat(deploy): test deployment to kubernetes azure
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-chervet committed Oct 28, 2024
1 parent 2f7d5da commit a391c1c
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,17 @@ jobs:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: false

- name: Terraform Init
run: terraform init
working-directory: ./deployment/terraform
working-directory: deployment/terraform

- name: Terraform Apply
run: terraform apply -auto-approve
working-directory: ./deployment/terraform
working-directory: deployment/terraform

- name: Setup kubectl
env:
Expand Down
15 changes: 15 additions & 0 deletions production/api/app/redis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import redis

class Redis:
def __init__(self, host, port):
self.host = host
self.port = port
self.client = redis.Redis(host=host, port=port, retry_on_timeout=True, decode_responses=True)

def set_key(self, key:str, data:any):
self.client.set(key, data)
self.client.expire(key, 60*10)


def get_key(self, key:str) -> any:
return self.client.get(key)
31 changes: 30 additions & 1 deletion production/api/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions production/api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ python-multipart = "^0.0.12"
soundfile = "^0.12.1"
librosa = "^0.10.2.post1"
torchaudio = "^2.5.0"
redis = "^5.2.0"


[build-system]
Expand Down
5 changes: 5 additions & 0 deletions production/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@

services:
redis:
image: redis:6.0.9
restart: "no"
ports:
- "6379:6379"
api:
build:
context: ./api
Expand Down

0 comments on commit a391c1c

Please sign in to comment.