feat(whatsapp): migrate to prebuilt docker image to fix disk pressure evictions

This commit is contained in:
Deep Koluguri 2026-06-29 21:36:52 -04:00
parent 6c49e819c6
commit 761bd7d8a2
2 changed files with 41 additions and 19 deletions

View File

@ -0,0 +1,40 @@
name: Build Whatsapp Gateway
on:
push:
branches:
- main
paths:
- 'whatsapp-gateway/**'
jobs:
build-whatsapp-gateway:
runs-on: ubuntu-latest
env:
DOCKER_HOST: tcp://172.17.0.1:2375
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build and push Whatsapp Gateway (Kaniko)
run: |
# Use short SHA for reproducible, auditable image tags.
SHORT_SHA="${GITHUB_SHA::7}"
IMAGE_TAG="192.168.8.250:5000/agentic-os/whatsapp-gateway:${SHORT_SHA}"
IMAGE_LATEST="192.168.8.250:5000/agentic-os/whatsapp-gateway:latest"
JOB_CONTAINER=$(docker ps --format '{{.Names}}' | grep 'GITEA-ACTIONS-TASK' | head -1)
echo "Using volumes from: $JOB_CONTAINER"
echo "Building image: $IMAGE_TAG"
docker run --rm \
--volumes-from "$JOB_CONTAINER" \
gcr.io/kaniko-project/executor:latest \
--context=dir:///workspace/deepkoluguri/agentic-os/whatsapp-gateway \
--dockerfile=Dockerfile \
--destination="${IMAGE_TAG}" \
--destination="${IMAGE_LATEST}" \
--insecure \
--skip-tls-verify
echo "Built and pushed: ${IMAGE_TAG}"

View File

@ -29,26 +29,10 @@ spec:
app: whatsapp-gateway app: whatsapp-gateway
spec: spec:
serviceAccountName: default serviceAccountName: default
initContainers:
- name: git-clone
image: alpine/git
command:
- "sh"
- "-c"
- "git clone http://192.168.8.248:3000/deepkoluguri/agentic-os.git /workspace && cp -r /workspace/whatsapp-gateway/* /app/"
volumeMounts:
- name: app-code
mountPath: /app
containers: containers:
- name: whatsapp-gateway - name: whatsapp-gateway
image: node:18 image: 192.168.8.250:5000/agentic-os/whatsapp-gateway:latest
command:
- "sh"
- "-c"
- "apt-get update && apt-get install -y libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2 && cd /app && npm install && node server.js"
volumeMounts: volumeMounts:
- name: app-code
mountPath: /app
- name: dshm - name: dshm
mountPath: /dev/shm mountPath: /dev/shm
- name: auth-session - name: auth-session
@ -63,8 +47,6 @@ spec:
cpu: "2" cpu: "2"
memory: 2Gi memory: 2Gi
volumes: volumes:
- name: app-code
emptyDir: {}
- name: dshm - name: dshm
emptyDir: emptyDir:
medium: Memory medium: Memory