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 30, 2024
1 parent 01f74d8 commit 7208854
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion production/api/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ async def receive_audio_chunk(
from redis_client import redis_factory_get
from http_service import http_service_factory_get
from app_settings import app_settings_factory_get
import msgpack
if client_id not in clients:
clients[client_id] = {
"sse_messages": []
Expand All @@ -200,7 +201,9 @@ async def receive_audio_chunk(
}
# generate id
chunk_id = str(uuid.uuid4())
redis_instance.set_key(chunk_id, str(chunk))
# Sérialisation avec MessagePack
chunk_packed = msgpack.packb(chunk, use_bin_type=True)
redis_instance.set_key(chunk_id, chunk_packed)

http_service = http_service_factory_get()()
response = await http_service.post( app_settings.url_slimfaas + "/async-function/ia-worker/transcribe", data={"chunk_id": chunk_id})
Expand Down
2 changes: 1 addition & 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 @@ -22,6 +22,7 @@ librosa = "^0.10.2.post1"
torchaudio = "^2.5.0"
redis = "^5.2.0"
httpx = "^0.27.2"
msgpack = "^1.1.0"


[build-system]
Expand Down
5 changes: 4 additions & 1 deletion production/ia-worker/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ async def receive_audio_chunk(
):
from redis_client import redis_factory_get
from app_settings import app_settings_factory_get
import msgpack
app_settings = app_settings_factory_get()()
redis_instance = redis_factory_get(app_settings.redis_host, app_settings.redis_port)()
chunk_data = redis_instance.get_key(chunk_id)
chunk = ast.literal_eval(chunk_data)

# Désérialisation avec MessagePack
chunk = msgpack.unpackb(chunk_data, raw=False)

content = io.BytesIO(chunk["content_bytes"])
chunk_index = chunk["chunk_index"]
Expand Down
2 changes: 1 addition & 1 deletion production/ia-worker/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/ia-worker/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ librosa = "^0.10.2.post1"
torchaudio = "^2.5.0"
redis = "^5.2.0"
httpx = "^0.27.2"
msgpack = "^1.1.0"


[build-system]
Expand Down

0 comments on commit 7208854

Please sign in to comment.