Skip to content

Commit

Permalink
pinned webui version (#25)
Browse files Browse the repository at this point in the history
* first stab at pinned webui version

* make sure k8s webui target keeps yaml up to date

* makefile => Makefile
  • Loading branch information
LukeLalor authored Oct 15, 2024
1 parent 39d8eec commit 64e7925
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
DOCKER_REPO_NAME ?= my-eidolon-project
VERSION := $(shell grep -m 1 '^version = ' pyproject.toml | awk -F '"' '{print $$2}')
WEBUI_TAG := latest
REQUIRED_ENVS := OPENAI_API_KEY
NAMESPACE ?= eidolon

Expand Down Expand Up @@ -65,14 +66,24 @@ docker-serve: .env check-docker-daemon poetry.lock Dockerfile docker-compose.yml
_docker-serve: docker-build pull-webui
docker compose up $(ARGS)

docker-compose.yml:
docker-compose.yml: Makefile
@sed -e '/^ agent-server:/,/^ [^ ]/s/^ image: .*/ image: ${DOCKER_REPO_NAME}:latest/' docker-compose.yml > docker-compose.yml.tmp && mv docker-compose.yml.tmp docker-compose.yml
@echo "Updated docker-compose.yml with image ${DOCKER_REPO_NAME}:latest"
@sed -e 's|image: eidolonai/webui:.*|image: eidolonai/webui:$(WEBUI_TAG)|' docker-compose.yml > docker-compose.yml.tmp && mv docker-compose.yml.tmp docker-compose.yml
@echo "Updated docker-compose.yml with image eidolonai/webui:$(WEBUI_TAG)"



update:
poetry add --lock eidolon-ai-sdk@latest
$(MAKE) Dockerfile

@new_version=$$(curl -s https://raw.githubusercontent.com/eidolon-ai/eidolon/refs/heads/main/webui/package.json | grep -o '"version": "[^"]*"' | cut -d'"' -f4); \
sed -e 's/^WEBUI_TAG := .*/WEBUI_TAG := '$$new_version'/' Makefile > Makefile.tmp && mv Makefile.tmp Makefile;
$(MAKE) docker-compose.yml
$(MAKE) k8s/webui.yaml


sync:
@if git remote | grep -q upstream; then \
echo "upstream already exists"; \
Expand Down Expand Up @@ -138,7 +149,11 @@ k8s-server: check-cluster-running docker-build docker-push k8s-env
@kubectl rollout status deployment/eidolon-deployment --timeout=60s --namespace=$(NAMESPACE)
@echo "Server Deployment is ready."

k8s-webui:
k8s/webui.yaml: Makefile
@sed -e 's|image: docker.io/eidolonai/webui:.*|image: docker.io/eidolonai/webui:$(WEBUI_TAG)|' k8s/webui.yaml > k8s/webui.yaml.tmp && mv k8s/webui.yaml.tmp k8s/webui.yaml


k8s-webui: k8s/webui.yaml
@kubectl create configmap webui-apps-config --from-file=./webui.apps.json -o yaml --dry-run=client | kubectl apply -f - --namespace=$(NAMESPACE)
@kubectl apply -f k8s/webui.yaml --namespace=$(NAMESPACE)
@echo "Waiting for eidolon-webui to be ready..."
Expand Down

0 comments on commit 64e7925

Please sign in to comment.