Upgraded modules, added commit id to build process, unified env variables
This commit is contained in:
1 parent
8a3630aca4
commit
86e09e8aea
7 files changed
+47
-36
No files matched your search
@@ -36,7 +36,9 @@ jobs:
|
||||
|
||||
- name: Build and Push Docker Image
|
||||
run: |
|
||||
docker build -t ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }} .
|
||||
docker build \
|
||||
--build-arg COMMIT_ID=$(echo "${{ github.sha }}" | cut -c1-7) \
|
||||
-t ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }} .
|
||||
docker push ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }}
|
||||
|
||||
- name: Clone ops-deployment repo
|
||||
|
||||
@@ -36,7 +36,9 @@ jobs:
|
||||
|
||||
- name: Build and Push Docker Image
|
||||
run: |
|
||||
docker build -t ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }} .
|
||||
docker build \
|
||||
--build-arg COMMIT_ID=$(echo "${{ github.sha }}" | cut -c1-7) \
|
||||
-t ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }} .
|
||||
docker push ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }}
|
||||
|
||||
- name: Clone ops-deployment repo
|
||||
|
||||
@@ -11,5 +11,9 @@ FROM nvcr.io/nvidia/distroless/python:3.12-v4.1.6
|
||||
COPY --from=builder /install /usr/local
|
||||
COPY --from=builder /app /app
|
||||
WORKDIR /app
|
||||
|
||||
ARG COMMIT_ID=unknown
|
||||
ENV COMMIT_ID=$COMMIT_ID
|
||||
|
||||
ENTRYPOINT ["python", "rabbitmq_handler.py"]
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ ignore = ["E501"]
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
known-first-party = ["db_module", "metrics_server", "rabbitmq_handler", "secret_manager",
|
||||
"simple_logger_handler", "uvicorn_logger_config", "validator"]
|
||||
"simple_logger_handler"]
|
||||
|
||||
[tool.ruff.format]
|
||||
indent-style = "tab"
|
||||
|
||||
+23
-21
@@ -1,25 +1,27 @@
|
||||
--extra-index-url https://git.gansejunge.com/api/packages/notifier/pypi/simple/
|
||||
aio-pika==9.5.7
|
||||
aiodns==3.5.0
|
||||
aiohappyeyeballs==2.6.1
|
||||
aiohttp==3.13.0
|
||||
aiomysql==0.2.0
|
||||
aiormq==6.9.0
|
||||
aio-pika==10.1.1
|
||||
aiodns==4.0.4
|
||||
aiohappyeyeballs==2.7.1
|
||||
aiohttp==3.14.5
|
||||
aiomysql==0.3.2
|
||||
aiormq==7.2.2
|
||||
aiosignal==1.4.0
|
||||
attrs==25.4.0
|
||||
cffi==2.0.0
|
||||
attrs==26.1.0
|
||||
cffi==2.1.1
|
||||
cryptography==46.0.2
|
||||
frozenlist==1.8.0
|
||||
idna==3.11
|
||||
lib-secret-manager[encryption]==0.2.0
|
||||
multidict==6.7.0
|
||||
pamqp==3.3.0
|
||||
prometheus_client==0.23.1
|
||||
propcache==0.4.1
|
||||
pycares==4.11.0
|
||||
pycparser==2.23
|
||||
PyMySQL==1.1.2
|
||||
python-json-logger==4.0.0
|
||||
simple-logger-handler==0.1.0
|
||||
typing_extensions==4.15.0
|
||||
yarl==1.22.0
|
||||
idna==3.20
|
||||
lib-secret-manager[encryption]==0.3.1
|
||||
multidict==7.1.0
|
||||
pamqp==4.0.1
|
||||
prometheus_client==0.26.0
|
||||
propcache==0.5.4
|
||||
pycares==5.2.0
|
||||
pycparser==3.11
|
||||
PyMySQL==1.2.3
|
||||
python-json-logger==4.2.0
|
||||
ruff==0.17.1
|
||||
simple-logger-handler==0.2.1
|
||||
typing_extensions==4.16.0
|
||||
yarl==1.25.1
|
||||
|
||||
@@ -5,13 +5,13 @@ from contextlib import asynccontextmanager
|
||||
import aiomysql
|
||||
import pymysql.err
|
||||
|
||||
from secret_manager import return_credentials
|
||||
from secret_manager import get_secret
|
||||
from simple_logger_handler import setup_logger
|
||||
|
||||
db_username = return_credentials("/etc/secrets/db_username")
|
||||
db_password = return_credentials("/etc/secrets/db_password")
|
||||
db_host = os.getenv("BACKEND_PN_DB_HOST","localhost")
|
||||
db_database = os.getenv("BACKEND_PN_DB_DATABASE","app")
|
||||
db_username = get_secret(os.getenv("DB_USERNAME",""),"/etc/secrets/db_username")
|
||||
db_password = get_secret(os.getenv("DB_PASSWORD",""),"/etc/secrets/db_password")
|
||||
db_host = os.getenv("DB_HOST","localhost")
|
||||
db_database = os.getenv("DB_DATABASE","app")
|
||||
|
||||
logger = setup_logger(__name__)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ from aio_pika.exceptions import AMQPException
|
||||
import metrics
|
||||
from db import db_manager
|
||||
from device_token_repository import database_lookup_by_user_id, database_lookup_by_uuid, remove_inactive_push_token
|
||||
from secret_manager import cleanup_secret_files, return_credentials
|
||||
from secret_manager import cleanup_secret_files, get_secret
|
||||
from secret_manager.fernet_encryption import decrypt_token
|
||||
from send_notification import send_notification
|
||||
from simple_logger_handler import setup_logger
|
||||
@@ -17,11 +17,11 @@ from simple_logger_handler import setup_logger
|
||||
logger = setup_logger(__name__)
|
||||
|
||||
|
||||
rmq_username = return_credentials("/etc/secrets/rmq_username")
|
||||
rmq_password = return_credentials("/etc/secrets/rmq_password")
|
||||
rmq_host = os.getenv("BACKEND_PN_RMQ_HOST", "localhost:30672")
|
||||
rmq_vhost = os.getenv("BACKEND_PN_RMQ_VHOST", "app_notifications")
|
||||
rmq_exchange = os.getenv("BACKEND_PN_RMQ_EXCHANGE", "app_notifications")
|
||||
rmq_username = get_secret(os.getenv("RMQ_USERNAME",""),"/etc/secrets/rmq_username")
|
||||
rmq_password = get_secret(os.getenv("RMQ_PASSWORD",""),"/etc/secrets/rmq_password")
|
||||
rmq_host = os.getenv("RMQ_HOST", "localhost:30672")
|
||||
rmq_vhost = os.getenv("RMQ_VHOST", "app_notifications")
|
||||
rmq_exchange = os.getenv("RMQ_EXCHANGE", "app_notifications")
|
||||
|
||||
RABBITMQ_URL = f"amqp://{rmq_username}:{rmq_password}@{rmq_host}/{rmq_vhost}"
|
||||
|
||||
@@ -302,7 +302,8 @@ class RabbitMQConsumer:
|
||||
|
||||
|
||||
async def main():
|
||||
logger.info("[APP] Starting application")
|
||||
logger.info("[App] Starting application")
|
||||
logger.info(f"[App] Build commit id={os.getenv("COMMIT_ID","unknown")}")
|
||||
await db_manager.connect()
|
||||
consumer = RabbitMQConsumer(db_manager=db_manager)
|
||||
await consumer.connect()
|
||||
|
||||
Reference in new issue
Block a user