From 9c80a5f62876a7afb9f617044af7473241d5edd5 Mon Sep 17 00:00:00 2001 From: Renat Skitsan Date: Fri, 17 Nov 2023 14:40:26 +0200 Subject: [PATCH 1/3] Update run.sh --- docker/web/celery/worker/run.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/web/celery/worker/run.sh b/docker/web/celery/worker/run.sh index 5e5cffe8..ae980c62 100755 --- a/docker/web/celery/worker/run.sh +++ b/docker/web/celery/worker/run.sh @@ -28,8 +28,10 @@ python manage.py check_chainid_matches export C_FORCE_ROOT=true echo "==> $(date +%H:%M:%S) ==> Running Celery worker with a max_memory_per_child of ${MAX_MEMORY_PER_CHILD} <==" +# https://github.com/sumitasok/celery/issues/5#issuecomment-781717855 exec celery -C -A config.celery_app worker \ --loglevel $log_level --pool=gevent \ + -E \ --concurrency=${TASK_CONCURRENCY} \ --max-memory-per-child=${MAX_MEMORY_PER_CHILD} \ --max-tasks-per-child=${MAX_TASKS_PER_CHILD} \ From 0f6a81cb321d6e9a09736177964eeec7af7e8538 Mon Sep 17 00:00:00 2001 From: Renat Gofman Date: Mon, 5 Feb 2024 12:50:35 +0200 Subject: [PATCH 2/3] add resources & ingress & ci update --- .github/workflows/ci-properties.json | 8 +++++++- .github/workflows/deployment.yml | 4 ++-- deployment.yaml | 6 +----- ingress.yaml | 17 +++++++++++++++++ 4 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 ingress.yaml diff --git a/.github/workflows/ci-properties.json b/.github/workflows/ci-properties.json index 19fe9e4f..a9e55f57 100644 --- a/.github/workflows/ci-properties.json +++ b/.github/workflows/ci-properties.json @@ -15,6 +15,12 @@ "ETH_INTERNAL_NO_FILTER": "1", "DJANGO_SU_NAME": "sovryn", "DJANGO_SU_EMAIL": "sovryn@sovryn.app", - "DJANGO_SETTINGS_MODULE": "config.settings.productddion" + "DJANGO_SETTINGS_MODULE": "config.settings.production" + }, + "DEV_ENV_VARS": { + "INGRESS_HOSTNAME": "safe-tx.test.sovryn.app" + }, + "PROD_ENV_VARS": { + "INGRESS_HOSTNAME": "safe-tx.sovryn.app" } } diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index ca8c58a5..a2ce9299 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -7,7 +7,7 @@ on: jobs: call-workflow-init: - uses: DistributedCollective/.github/.github/workflows/init.yml@ci_envs + uses: DistributedCollective/.github/.github/workflows/init.yml@master with: ref: ${{ github.ref }} base_ref: ${{ github.base_ref }} @@ -24,7 +24,7 @@ jobs: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} call-workflow-k8s-deploy: - uses: DistributedCollective/.github/.github/workflows/deploy-k8s.yml@ci_envs + uses: DistributedCollective/.github/.github/workflows/deploy-k8s.yml@master needs: [call-workflow-init, call-workflow-docker-build] if: github.event_name != 'pull_request' with: diff --git a/deployment.yaml b/deployment.yaml index 56f88b0b..bf4578da 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -141,14 +141,10 @@ apiVersion: v1 kind: Service metadata: name: rootstock-transaction-service - annotations: - service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http - service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:us-east-2:768438872063:certificate/9fa02b26-0ee5-4301-bdd6-8474344885ff spec: selector: app: rootstock-transaction-service ports: - port: 443 targetPort: 8000 - type: LoadBalancer ---- + type: NodePort diff --git a/ingress.yaml b/ingress.yaml new file mode 100644 index 00000000..4add829e --- /dev/null +++ b/ingress.yaml @@ -0,0 +1,17 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: rootstock-transaction-service-ingress +spec: + ingressClassName: nginx + rules: + - host: ingress.hostname + http: + paths: + - backend: + service: + name: rootstock-transaction-service + port: + number: 443 + path: / + pathType: Prefix From 52e3acf1cc68eb867e669985517a348b4a30c4d1 Mon Sep 17 00:00:00 2001 From: Renat Gofman Date: Mon, 5 Feb 2024 12:52:34 +0200 Subject: [PATCH 3/3] add resources --- deployment.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deployment.yaml b/deployment.yaml index bf4578da..9b73d730 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -35,7 +35,10 @@ spec: value: "1" args: ["docker/web/celery/flower/run.sh"] name: flower - resources: {} + resources: + requests: + memory: "3Gi" + cpu: "200m" - image: sovryn/rootstock-transaction-service imagePullPolicy: Always envFrom: