feat(whatsapp): migrate to prebuilt docker image to fix disk pressure evictions
This commit is contained in:
parent
6c49e819c6
commit
761bd7d8a2
|
|
@ -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}"
|
||||
|
|
@ -29,26 +29,10 @@ spec:
|
|||
app: whatsapp-gateway
|
||||
spec:
|
||||
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:
|
||||
- name: whatsapp-gateway
|
||||
image: node:18
|
||||
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"
|
||||
image: 192.168.8.250:5000/agentic-os/whatsapp-gateway:latest
|
||||
volumeMounts:
|
||||
- name: app-code
|
||||
mountPath: /app
|
||||
- name: dshm
|
||||
mountPath: /dev/shm
|
||||
- name: auth-session
|
||||
|
|
@ -63,8 +47,6 @@ spec:
|
|||
cpu: "2"
|
||||
memory: 2Gi
|
||||
volumes:
|
||||
- name: app-code
|
||||
emptyDir: {}
|
||||
- name: dshm
|
||||
emptyDir:
|
||||
medium: Memory
|
||||
|
|
|
|||
Loading…
Reference in New Issue