#!/bin/bash unset DOCKER_DEFAULT_PLATFORM BASE_DIR=$(dirname "$0") # Create Registry echo "### Creating local registry... ###" REG_NAME='dapr-registry' REG_PORT='5001' if [ "$(docker inspect -f '{{.State.Running}}' "${REG_NAME}" 2>/dev/null || true)" != 'true' ]; then docker run \ -d --restart=always -p "127.0.0.1:${REG_PORT}:5000" --network bridge --name "${REG_NAME}" \ registry:2 fi echo "### Local registry created! ###s" # Create kind cluster with registry config echo "### Creating kind cluster... ###" CLUSTER_NAME='dapr-agents' cat </dev/null echo "### Bitnami Redis installed! ###" echo "### Installing Dapr... ####" helm repo add dapr https://dapr.github.io/helm-charts/ &>/dev/null && \ helm repo update &>/dev/null && \ helm upgrade --install dapr dapr/dapr \ --version=1.15 \ --namespace dapr-system \ --create-namespace \ --set global.tag=1.15.2-mariner \ --set daprd.logLevel=DEBUG \ --wait &>/dev/null echo "### Dapr installed! ###" echo "### Installing components... ###" kubectl apply -f "${BASE_DIR}/components/" &>/dev/null echo "### Components installed! ###" build_images echo "### Creating Kubernetes secret from .env file... ###" kubectl create secret generic openai-secrets \ --from-env-file="${BASE_DIR}/.env" \ --dry-run=client -o yaml | kubectl apply -f - echo "### Kubernetes secret created! ###" echo "### Creating manifests... ###" kubectl apply -f "${BASE_DIR}/manifests/" &>/dev/null echo "### Manifests created! ###" echo "### Port forwarding the workflow-llm pod... ###" while [[ $(kubectl get pods -l app=workflow-llm -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do sleep 1 done kubectl port-forward -n default svc/workflow-llm 8004:80 &>/dev/null & echo "### Port forwarded the workflow-llm pod... ###" echo "### Trigger workflow... ###" python3.10 -m pip install -r "${BASE_DIR}/services/client/requirements.txt" &>/dev/null python3.10 "${BASE_DIR}/services/client/k8s_http_client.py"