Skip to content

Commit

Permalink
fix: k8 deployment; arm64 cloud build (#227)
Browse files Browse the repository at this point in the history
* add arm64 to zep-cloud build

* mod k8 deployment
  • Loading branch information
danielchalef committed Oct 13, 2023
1 parent 7e90ff0 commit e950fff
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 60 deletions.
25 changes: 9 additions & 16 deletions .github/workflows/docker-publish-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ jobs:
# otherwise, use the event ref
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag || github.ref }}
#
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2.1.0

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2.1.0
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -63,7 +63,7 @@ jobs:
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4.4.0
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
Expand All @@ -72,22 +72,15 @@ jobs:
type=match,pattern=v(.*-beta),group=1
type=match,pattern=v.*-(beta),group=1
# If steps.meta.outputs.tags is empty, use the tag provided in the workflow dispatch
- name: Generate workflow dispatch tags
if: steps.meta.outputs.tags == ''
id: dispatch_tags
run: |
echo "TAGS=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.tag }},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_ENV
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4.0.0
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.cloud
platforms: linux/amd64 #,linux/arm64
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags || env.TAGS }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
114 changes: 70 additions & 44 deletions zep-deployment.yaml → zep-k8-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## Kubernetes Deployment Configuration YAML
# Zep Server
# Note: This is designed for development/test deployments
# See: kubernetes-readme.md for more details
# Will need to be customized and hardened with additional security, deployment configurations for production use cases
##
apiVersion: apps/v1
kind: Deployment
metadata:
name: zep-postgres
namespace: zep
spec:
replicas: 1
selector:
Expand All @@ -22,12 +22,20 @@ spec:
- name: zep-postgres
image: ghcr.io/getzep/postgres:latest
ports:
- containerPort: 5432
- name: postgres-port
containerPort: 5432
env:
- name: POSTGRES_USER
value: postgres
- name: POSTGRES_PASSWORD
value: postgres
resources:
requests:
memory: "1Gi"
cpu: "500m"
limits:
memory: "1Gi"
cpu: "2"
readinessProbe:
exec:
command:
Expand All @@ -47,6 +55,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: zep-nlp
namespace: zep
spec:
replicas: 1
selector:
Expand All @@ -60,25 +69,30 @@ spec:
containers:
- name: zep-nlp
image: ghcr.io/getzep/zep-nlp-server:latest
env:
- name: ENABLE_EMBEDDINGS
value: "false"
readinessProbe:
tcpSocket:
host: 127.0.0.1
port: 8080
initialDelaySeconds: 45
httpGet:
port: 5557
path: /healthz
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
resources:
requests:
memory: "1Gi"
cpu: "500m"
limits:
memory: "2Gi"
cpu: "2"
ports:
- containerPort: 8080
- containerPort: 5557
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: zep
namespace: zep
spec:
replicas: 1
selector:
Expand All @@ -91,51 +105,61 @@ spec:
spec:
containers:
- name: zep
image: ghcr.io/getzep/zep:latest
image: ghcr.io/getzep/zep-cloud:latest
ports:
- containerPort: 8000
env:
- name: ZEP_MEMORY_STORE_POSTGRES_DSN
value: postgres://postgres:postgres@zep-postgres:5432/postgres?sslmode=disable
- name: ZEP_NLP_SERVER_URL
value: http://zep-nlp:8080
- name: ZEP_OPENAI_API_KEY
valueFrom:
secretKeyRef:
name: zep-openai-api-key
key: ZEP_OPENAI_API_KEY
- name: AZURE_OPENAI_SUBSCRIPTION_KEY
valueFrom:
secretKeyRef:
name: azure-openai-secret
key: subscription-key
- name: AZURE_OPENAI_ENDPOINT
valueFrom:
secretKeyRef:
name: azure-openai-secret
key: endpoint
volumeMounts:
- name: config-volume
mountPath: /app/config.yaml
subPath: config.yaml
envFrom:
# To create a config map from your local config.yaml file, run:
# kubectl create configmap zep-config --from-file=config.yaml -n zep
- configMapRef:
name: zep-config
# To create a config map from your local .env file, run:
# kubectl create configmap dotenv --from-file=.env -n zep
- configMapRef:
name: dotenv
# Uncomment to enable pulling config from the configmap
# env:
# - name: ZEP_STORE_POSTGRES_DSN
# value: postgres://postgres:postgres@zep-postgres:5432/postgres?sslmode=disable
# - name: ZEP_NLP_SERVER_URL
# value: http://zep-nlp:5557
# - name: ZEP_OPENAI_API_KEY
# valueFrom:
# secretKeyRef:
# name: zep-openai-api-key
# key: ZEP_OPENAI_API_KEY
# - name: AZURE_OPENAI_SUBSCRIPTION_KEY
# valueFrom:
# secretKeyRef:
# name: azure-openai-secret
# key: subscription-key
# - name: AZURE_OPENAI_ENDPOINT
# valueFrom:
# secretKeyRef:
# name: azure-openai-secret
# key: endpoint
readinessProbe:
tcpSocket:
host: 127.0.0.1
httpGet:
port: 8000
initialDelaySeconds: 40
path: /healthz
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 10
successThreshold: 1
failureThreshold: 3
volumes:
- name: config-volume
configMap:
name: zep-config
resources:
requests:
memory: "1Gi"
cpu: "500m"
limits:
memory: "1Gi"
cpu: "1"
---
apiVersion: v1
kind: Service
metadata:
name: zep-postgres
namespace: zep
spec:
selector:
app: zep-postgres
Expand All @@ -148,18 +172,20 @@ apiVersion: v1
kind: Service
metadata:
name: zep-nlp
namespace: zep
spec:
selector:
app: zep-nlp
ports:
- protocol: TCP
port: 8080
targetPort: 8080
port: 5557
targetPort: 5557
---
apiVersion: v1
kind: Service
metadata:
name: zep
namespace: zep
spec:
type: LoadBalancer
selector:
Expand Down

0 comments on commit e950fff

Please sign in to comment.