Skip to content

Commit 083d99f

Browse files
authored
Merge pull request #30 from mapswipe/feat/helm-update
Feat/helm update
2 parents d261bb3 + 075786e commit 083d99f

File tree

9 files changed

+522
-412
lines changed

9 files changed

+522
-412
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ jobs:
8585
8686
# XXX: Check if there is a slash in the BRANCH_NAME eg: project/add-docker
8787
if [[ "$BRANCH_NAME" == *"/"* ]]; then
88-
# XXX: Change the docker image package to -alpha
89-
IMAGE_NAME="$IMAGE_NAME-alpha"
88+
# XXX: Change the docker image package to -dev
89+
IMAGE_NAME="$IMAGE_NAME-dev"
9090
TAG="$(echo "$BRANCH_NAME" | sed 's|/|-|g').$(echo $GIT_HASH)"
9191
else
9292
TAG="$BRANCH_NAME.$(echo $GIT_HASH)"
@@ -183,7 +183,7 @@ jobs:
183183
helm dependency build ./helm/
184184
185185
- name: Helm lint
186-
run: helm lint ./helm --values ./helm/values-test.yaml
186+
run: helm lint ./helm --values ./helm/linter_values.yaml
187187

188188
- name: Helm template
189-
run: helm template ./helm --values ./helm/values-test.yaml
189+
run: helm template ./helm --values ./helm/linter_values.yaml

.github/workflows/helm-publish.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ jobs:
6262
run: |
6363
# XXX: Check if there is a slash in the BRANCH_NAME eg: project/add-docker
6464
if [[ "$GITHUB_REF_NAME" == *"/"* ]]; then
65-
# XXX: Change the helm chart to <chart-name>-alpha
66-
sed -i 's/^name: \(.*\)/name: \1-alpha/' ./helm/Chart.yaml
65+
# XXX: Change the helm chart to <chart-dev-name>
66+
sed -i 's/^\(name:.*\)-helm$/\1-dev-helm/' ./helm/Chart.yaml
6767
fi
6868
6969
sed -i "s/SET-BY-CICD/$IMAGE_TAG/g" ./helm/Chart.yaml
@@ -72,7 +72,7 @@ jobs:
7272
- name: Push Helm Chart
7373
env:
7474
IMAGE: ${{ needs.ci.outputs.docker_image }}
75-
OCI_REPO: oci://ghcr.io/${{ github.repository }}
75+
OCI_REPO: oci://ghcr.io/${{ github.repository_owner }}
7676
run: |
7777
OCI_REPO=$(echo $OCI_REPO | tr '[:upper:]' '[:lower:]')
7878
PACKAGE_FILE=$(ls ./helm/.helm-charts/*.tgz | head -n 1)
@@ -82,4 +82,12 @@ jobs:
8282
helm push "$PACKAGE_FILE" $OCI_REPO 2>> $GITHUB_STEP_SUMMARY
8383
echo '```' >> $GITHUB_STEP_SUMMARY
8484
echo "> [!Important]" >> $GITHUB_STEP_SUMMARY
85-
echo "> NOTE: Tagged docker image: **$IMAGE**" >> $GITHUB_STEP_SUMMARY
85+
echo "> Helm Repo URL: **$OCI_REPO**" >> $GITHUB_STEP_SUMMARY
86+
echo "> Helm Chart: **$(helm show chart "$PACKAGE_FILE" | grep '^name:' | awk '{print $2}')**" >> $GITHUB_STEP_SUMMARY
87+
echo "> Helm Target Revision: **$(helm show chart "$PACKAGE_FILE" | grep '^version:' | awk '{print $2}')**" >> $GITHUB_STEP_SUMMARY
88+
echo "> Docker image: **$IMAGE**" >> $GITHUB_STEP_SUMMARY
89+
90+
# Add annotations as well
91+
echo "::notice::Helm Repo URL: **$OCI_REPO**"
92+
echo "::notice::Helm Chart: **$(helm show chart "$PACKAGE_FILE" | grep '^name:' | awk '{print $2}')**"
93+
echo "::notice::Helm Target Revision: **$(helm show chart "$PACKAGE_FILE" | grep '^version:' | awk '{print $2}')**"

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM python:3.13-slim-bookworm AS base
2-
COPY --from=ghcr.io/astral-sh/uv:0.6.2 /uv /uvx /bin/
2+
COPY --from=ghcr.io/astral-sh/uv:0.7.4 /uv /uvx /bin/
33

44
LABEL maintainer="Mapswipe Dev"
55
LABEL org.opencontainers.image.source="https://github.com/mapswipe/mapswipe-backend/"

helm/Chart.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: django-app
33
repository: oci://ghcr.io/toggle-corp/charts
4-
version: 0.0.1
5-
digest: sha256:f6da87e3dbcd9008036499bac3ef4bcdedb77b53793b8a0952a356df5ccff3e4
6-
generated: "2025-03-04T10:20:54.384864288+05:45"
4+
version: 0.1.1
5+
digest: sha256:b6d04c208a99e0dbe4c9c15446cfbd10c7bedf64eca38a929f6a78725f8d6367
6+
generated: "2025-05-16T14:21:28.080402011+05:45"

helm/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ sources:
99
dependencies:
1010
- name: django-app
1111
alias: app
12-
version: 0.0.1
12+
version: 0.1.1
1313
repository: oci://ghcr.io/toggle-corp/charts
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
app:
2+
environment: PROD
23
image:
34
name: ghcr.io/mapswipe/mapswipe-backend
45
tag: latest

helm/values.yaml

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
app:
2+
environment: PROD
3+
# Global Image
4+
appTypeEnvName: "APP_TYPE"
25
image:
36
name: SET-BY-CICD-IMAGE
47
tag: SET-BY-CICD-TAG
8+
imagePullPolicy: IfNotPresent
59

610
ingress:
711
enabled: true
812
className: nginx
913

1014
redis:
1115
enabled: true
16+
fullnameOverride: "mapswipe-redis"
1217

1318
postgresql:
1419
enabled: true
@@ -39,16 +44,55 @@ app:
3944

4045
api:
4146
containerPort: 80
42-
command: ["gunicorn", "config.wsgi:application", "--timeout=40", "--bind", "0.0.0.0:80"]
47+
command: ["gunicorn", "main.wsgi:application", "--timeout=40", "--bind", "0.0.0.0:80"]
4348
resources:
4449
requests:
4550
cpu: "0.2"
4651

4752
worker:
4853
enabled: true
54+
beat:
55+
command: ["celery", "-A", "main", "beat", "-l", "INFO"]
56+
resources:
57+
requests:
58+
cpu: "0.1"
59+
memory: 0.5Gi
60+
limits:
61+
cpu: "1"
62+
memory: 1Gi
63+
flower:
64+
enabled: false
65+
queueDefaultResources:
66+
requests:
67+
cpu: "0.1"
68+
memory: 1Gi
69+
limits:
70+
cpu: "4"
71+
memory: 2Gi
72+
queueCommandPrefix:
73+
- "celery"
74+
- "-A"
75+
- "main"
76+
- "worker"
77+
- "-l"
78+
- "INFO"
79+
queues:
80+
# NOTE: Make sure keys are lowercase
81+
default:
82+
enabled: true
83+
replicaCount: 1
84+
celeryArgs:
85+
- "-Q"
86+
- "celery"
87+
- "--concurrency"
88+
- "4"
89+
- "--max-tasks-per-child"
90+
- "10"
4991

5092
# NOTE: Check main/settings.py for all available options
5193
env:
94+
APP_RELEASE: "{{ $.Values.image.tag }}"
95+
APP_ENVIRONMENT: "{{ $.Values.environment }}"
5296
# AWS
5397
AWS_S3_ENABLED: "true"
5498
AWS_S3_ENDPOINT_URL: "https://{{ $.Values.minio.apiIngress.hostname }}/"
@@ -70,4 +114,7 @@ app:
70114
# Minio (S3)
71115
AWS_S3_ACCESS_KEY_ID: "{{ required \".Values.minio.auth.rootUser\" $.Values.minio.auth.rootUser }}"
72116
AWS_S3_SECRET_ACCESS_KEY: "{{ required \".Values.minio.auth.rootPassword\" $.Values.minio.auth.rootPassword }}"
73-
AWS_S3_REGION: "us-east-1"
117+
AWS_S3_REGION_NAME: "us-east-1"
118+
# Redis
119+
CELERY_REDIS_URL: "redis://{{ printf \"%s-master\" (include \"common.names.fullname\" $.Subcharts.redis) }}:6379/0"
120+
CACHE_REDIS_URL: "redis://{{ printf \"%s-master\" (include \"common.names.fullname\" $.Subcharts.redis) }}:6379/1"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies = [
1919
"django-environ",
2020
"django-premailer",
2121
"django-redis",
22-
"django-storages",
22+
"django-storages[s3]",
2323
"djangoql", # Admin panel query search
2424
"djangorestframework",
2525
"factory-boy~=3.2.1",

0 commit comments

Comments
 (0)