blackopsrepl commited on
Commit
186edf4
Β·
1 Parent(s): ae122c6

feat(deploy): add whimsical Makefile rice

Browse files
Makefile CHANGED
@@ -1,68 +1,103 @@
1
  .PHONY: help venv install run test lint format clean setup-secrets check-creds deploy-k8s deploy-helm cleanup-k8s cleanup-helm
2
 
3
- PYTHON=python
4
- PIP=pip
5
- VENV=.venv
6
- ACTIVATE=. $(VENV)/bin/activate
 
 
 
 
 
 
 
 
 
 
7
 
8
  help:
9
- @echo "Yuga Planner Makefile"
10
- @echo "Available targets:"
11
- @echo " venv Create a Python virtual environment"
12
- @echo " install Install all Python dependencies"
13
- @echo " run Run the Gradio app locally"
14
- @echo " test Run all tests with pytest"
15
- @echo " lint Run pre-commit hooks (includes black, yaml, gitleaks)"
16
- @echo " format Format code with black"
17
- @echo " setup-secrets Copy and edit secrets template for local dev"
18
- @echo " check-creds Check and validate all required credentials"
19
- @echo " deploy-k8s Deploy application to Kubernetes"
20
- @echo " deploy-helm Deploy application using Helm"
21
- @echo " cleanup-k8s Clean up Kubernetes deployment"
22
- @echo " cleanup-helm Clean up Helm deployment"
23
- @echo " clean Remove Python cache and virtual environment"
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
  venv:
26
- $(PYTHON) -m venv $(VENV)
 
 
27
 
28
  install: venv
29
- $(ACTIVATE); $(PIP) install --upgrade pip
30
- $(ACTIVATE); $(PIP) install -r requirements.txt
31
- $(ACTIVATE); $(PIP) install pre-commit black
 
 
32
 
33
  run:
34
- $(ACTIVATE); $(PYTHON) src/app.py
 
35
 
36
  test:
37
- $(ACTIVATE); pytest -v -s
 
38
 
39
  lint:
40
- $(ACTIVATE); pre-commit run --all-files
 
41
 
42
  format:
43
- $(ACTIVATE); black src tests
 
 
44
 
45
  setup-secrets:
46
- cp -n tests/secrets/nebius_secrets.py.template tests/secrets/cred.py; \
47
- echo "Edit tests/secrets/cred.py to add your own API credentials."
 
 
48
 
49
  check-creds:
50
- @echo "πŸ” Checking credentials..."
51
  @./scripts/load-credentials.sh
52
 
53
  deploy-k8s:
54
- ./scripts/deploy-k8s.sh
55
 
56
  deploy-helm:
57
- ./scripts/deploy-helm.sh
58
 
59
  cleanup-k8s:
60
- ./scripts/cleanup-k8s.sh
61
 
62
  cleanup-helm:
63
- ./scripts/cleanup-helm.sh
64
 
65
  clean:
66
- rm -rf $(VENV) __pycache__ */__pycache__ .pytest_cache .mypy_cache .coverage .hypothesis
67
- find . -type f -name '*.pyc' -delete
68
- find . -type d -name '__pycache__' -exec rm -rf {} +
 
 
 
1
  .PHONY: help venv install run test lint format clean setup-secrets check-creds deploy-k8s deploy-helm cleanup-k8s cleanup-helm
2
 
3
+ # Colors and formatting
4
+ BOLD := \033[1m
5
+ RED := \033[31m
6
+ GREEN := \033[32m
7
+ YELLOW := \033[33m
8
+ BLUE := \033[34m
9
+ MAGENTA := \033[35m
10
+ CYAN := \033[36m
11
+ RESET := \033[0m
12
+
13
+ PYTHON := python
14
+ PIP := pip
15
+ VENV := .venv
16
+ ACTIVATE := . $(VENV)/bin/activate
17
 
18
  help:
19
+ @printf "$(BOLD)πŸš€ Yuga Planner$(RESET)\n"
20
+ @printf "$(CYAN)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━$(RESET)\n"
21
+ @printf "\n"
22
+ @printf "$(BOLD)πŸ“¦ Development Commands:$(RESET)\n"
23
+ @printf " $(GREEN)venv$(RESET) 🐍 Create Python virtual environment\n"
24
+ @printf " $(GREEN)install$(RESET) πŸ“‹ Install all dependencies\n"
25
+ @printf " $(GREEN)run$(RESET) πŸƒ Run the Gradio app locally\n"
26
+ @printf " $(GREEN)test$(RESET) πŸ§ͺ Run tests with pytest\n"
27
+ @printf "\n"
28
+ @printf "$(BOLD)πŸ”§ Code Quality:$(RESET)\n"
29
+ @printf " $(BLUE)lint$(RESET) ✨ Run pre-commit hooks (black, yaml, gitleaks)\n"
30
+ @printf " $(BLUE)format$(RESET) 🎨 Format code with black\n"
31
+ @printf "\n"
32
+ @printf "$(BOLD)πŸ” Credentials:$(RESET)\n"
33
+ @printf " $(YELLOW)setup-secrets$(RESET) πŸ”‘ Setup credential template\n"
34
+ @printf " $(YELLOW)check-creds$(RESET) πŸ” Validate all credentials\n"
35
+ @printf "\n"
36
+ @printf "$(BOLD)☸️ Deployment:$(RESET)\n"
37
+ @printf " $(MAGENTA)deploy-k8s$(RESET) πŸš€ Deploy to Kubernetes\n"
38
+ @printf " $(MAGENTA)deploy-helm$(RESET) ⎈ Deploy using Helm\n"
39
+ @printf "\n"
40
+ @printf "$(BOLD)🧹 Cleanup:$(RESET)\n"
41
+ @printf " $(RED)cleanup-k8s$(RESET) πŸ—‘οΈ Remove Kubernetes deployment\n"
42
+ @printf " $(RED)cleanup-helm$(RESET) πŸ—‘οΈ Remove Helm deployment\n"
43
+ @printf " $(RED)clean$(RESET) 🧽 Remove cache and virtual environment\n"
44
+ @printf "\n"
45
+ @printf "$(CYAN)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━$(RESET)\n"
46
 
47
  venv:
48
+ @printf "$(GREEN)🐍 Creating virtual environment...$(RESET)\n"
49
+ @$(PYTHON) -m venv $(VENV)
50
+ @printf "$(GREEN)βœ… Virtual environment created$(RESET)\n"
51
 
52
  install: venv
53
+ @printf "$(BLUE)πŸ“¦ Installing dependencies...$(RESET)\n"
54
+ @$(ACTIVATE); $(PIP) install --upgrade pip
55
+ @$(ACTIVATE); $(PIP) install -r requirements.txt
56
+ @$(ACTIVATE); $(PIP) install pre-commit black
57
+ @printf "$(GREEN)βœ… Dependencies installed$(RESET)\n"
58
 
59
  run:
60
+ @printf "$(CYAN)πŸƒ Starting Yuga Planner...$(RESET)\n"
61
+ @$(ACTIVATE); $(PYTHON) src/app.py
62
 
63
  test:
64
+ @printf "$(YELLOW)πŸ§ͺ Running tests...$(RESET)\n"
65
+ @$(ACTIVATE); pytest -v -s
66
 
67
  lint:
68
+ @printf "$(BLUE)✨ Running code quality checks...$(RESET)\n"
69
+ @$(ACTIVATE); pre-commit run --all-files
70
 
71
  format:
72
+ @printf "$(MAGENTA)🎨 Formatting code...$(RESET)\n"
73
+ @$(ACTIVATE); black src tests
74
+ @printf "$(GREEN)βœ… Code formatted$(RESET)\n"
75
 
76
  setup-secrets:
77
+ @printf "$(YELLOW)πŸ”‘ Setting up credential template...$(RESET)\n"
78
+ @cp -n tests/secrets/nebius_secrets.py.template tests/secrets/cred.py || true
79
+ @printf "$(GREEN)βœ… Template created$(RESET)\n"
80
+ @printf "$(CYAN)πŸ’‘ Edit tests/secrets/cred.py to add your API credentials$(RESET)\n"
81
 
82
  check-creds:
83
+ @printf "$(CYAN)πŸ” Validating credentials...$(RESET)\n"
84
  @./scripts/load-credentials.sh
85
 
86
  deploy-k8s:
87
+ @./scripts/deploy-k8s.sh
88
 
89
  deploy-helm:
90
+ @./scripts/deploy-helm.sh
91
 
92
  cleanup-k8s:
93
+ @./scripts/cleanup-k8s.sh
94
 
95
  cleanup-helm:
96
+ @./scripts/cleanup-helm.sh
97
 
98
  clean:
99
+ @printf "$(RED)🧽 Cleaning up...$(RESET)\n"
100
+ @rm -rf $(VENV) __pycache__ */__pycache__ .pytest_cache .mypy_cache .coverage .hypothesis
101
+ @find . -type f -name '*.pyc' -delete
102
+ @find . -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null || true
103
+ @printf "$(GREEN)βœ… Cleanup complete$(RESET)\n"
scripts/cleanup-helm.sh CHANGED
@@ -1,15 +1,24 @@
1
  #!/bin/bash
2
  set -e
3
 
4
- # Yuga Planner Helm Cleanup Script
5
- # This script removes the Helm release and all associated resources
 
 
 
 
 
 
 
6
 
7
- echo "🧹 Cleaning up Yuga Planner Helm deployment..."
 
 
8
 
9
  # Check if helm is available
10
  if ! command -v helm &> /dev/null; then
11
- echo "❌ Error: helm is required but not installed."
12
- echo "πŸ’‘ Install Helm from: https://helm.sh/docs/intro/install/"
13
  exit 1
14
  fi
15
 
@@ -19,68 +28,73 @@ RELEASE_NAME="${HELM_RELEASE_NAME:-yuga-planner}"
19
  CURRENT_NAMESPACE=$(kubectl config view --minify --output 'jsonpath={..namespace}' 2>/dev/null || echo "default")
20
  NAMESPACE="${HELM_NAMESPACE:-$CURRENT_NAMESPACE}"
21
 
22
- echo "πŸ“¦ Helm Release: $RELEASE_NAME"
23
- echo "🏷️ Namespace: $NAMESPACE"
 
24
 
25
  # Check if the release exists
 
 
26
  if ! helm list -n "$NAMESPACE" | grep -q "^$RELEASE_NAME"; then
27
- echo "ℹ️ Helm release '$RELEASE_NAME' not found in namespace '$NAMESPACE'."
28
- echo "βœ… Nothing to clean up."
29
  exit 0
30
  fi
31
 
32
  # Show release information
33
- echo "πŸ” Found Helm release:"
34
  helm list -n "$NAMESPACE" | grep "^$RELEASE_NAME" || true
35
 
36
  echo ""
37
- echo "πŸ“Š Release details:"
38
- helm status "$RELEASE_NAME" -n "$NAMESPACE" || true
39
 
40
  # Confirm deletion
41
  echo ""
42
- read -p "❓ Are you sure you want to uninstall the Helm release '$RELEASE_NAME'? (y/N): " -n 1 -r
 
43
  echo
44
  if [[ ! $REPLY =~ ^[Yy]$ ]]; then
45
- echo "❌ Cleanup cancelled."
46
  exit 0
47
  fi
48
 
49
- echo "πŸ—‘οΈ Uninstalling Helm release..."
50
  helm uninstall "$RELEASE_NAME" -n "$NAMESPACE"
51
 
52
- echo "βœ… Helm release uninstalled successfully!"
53
 
54
  # Check if namespace should be cleaned up (optional)
55
  if [ "$NAMESPACE" != "default" ]; then
56
  echo ""
57
- echo "πŸ€” The namespace '$NAMESPACE' still exists."
58
- read -p "❓ Do you want to delete the namespace '$NAMESPACE' as well? (y/N): " -n 1 -r
59
  echo
60
  if [[ $REPLY =~ ^[Yy]$ ]]; then
61
  # Check if namespace has other resources
62
  OTHER_RESOURCES=$(kubectl get all -n "$NAMESPACE" --ignore-not-found=true 2>/dev/null | grep -v "^NAME" | wc -l)
63
  if [ "$OTHER_RESOURCES" -gt 0 ]; then
64
- echo "⚠️ Warning: Namespace '$NAMESPACE' contains other resources."
65
  kubectl get all -n "$NAMESPACE" 2>/dev/null || true
66
- read -p "❓ Are you sure you want to delete the entire namespace? (y/N): " -n 1 -r
67
  echo
68
  if [[ $REPLY =~ ^[Yy]$ ]]; then
69
  kubectl delete namespace "$NAMESPACE"
70
- echo "βœ… Namespace '$NAMESPACE' deleted."
71
  else
72
- echo "ℹ️ Namespace '$NAMESPACE' preserved."
73
  fi
74
  else
75
  kubectl delete namespace "$NAMESPACE"
76
- echo "βœ… Empty namespace '$NAMESPACE' deleted."
77
  fi
78
  else
79
- echo "ℹ️ Namespace '$NAMESPACE' preserved."
80
  fi
81
  fi
82
 
83
  echo ""
84
- echo "πŸ” Useful commands to verify cleanup:"
85
- echo " β€’ List remaining releases: helm list -A"
86
- echo " β€’ Check for remaining resources: kubectl get all -l app.kubernetes.io/instance=$RELEASE_NAME -A"
 
 
1
  #!/bin/bash
2
  set -e
3
 
4
+ # Colors and formatting
5
+ RED='\033[0;31m'
6
+ GREEN='\033[0;32m'
7
+ YELLOW='\033[1;33m'
8
+ BLUE='\033[0;34m'
9
+ CYAN='\033[0;36m'
10
+ MAGENTA='\033[0;35m'
11
+ BOLD='\033[1m'
12
+ RESET='\033[0m'
13
 
14
+ # Yuga Planner Helm Cleanup Script
15
+ echo -e "${BOLD}🧹 Yuga Planner - Helm Cleanup${RESET}"
16
+ echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
17
 
18
  # Check if helm is available
19
  if ! command -v helm &> /dev/null; then
20
+ echo -e "${RED}❌ Error: helm is required but not installed${RESET}"
21
+ echo -e "${YELLOW}πŸ’‘ Install from: ${CYAN}https://helm.sh/docs/intro/install/${RESET}"
22
  exit 1
23
  fi
24
 
 
28
  CURRENT_NAMESPACE=$(kubectl config view --minify --output 'jsonpath={..namespace}' 2>/dev/null || echo "default")
29
  NAMESPACE="${HELM_NAMESPACE:-$CURRENT_NAMESPACE}"
30
 
31
+ echo -e "${BOLD}πŸ“¦ Configuration:${RESET}"
32
+ echo -e " Release: ${MAGENTA}$RELEASE_NAME${RESET}"
33
+ echo -e " Namespace: ${MAGENTA}$NAMESPACE${RESET}"
34
 
35
  # Check if the release exists
36
+ echo ""
37
+ echo -e "${BLUE}πŸ” Scanning for Helm release...${RESET}"
38
  if ! helm list -n "$NAMESPACE" | grep -q "^$RELEASE_NAME"; then
39
+ echo -e "${BLUE}ℹ️ Helm release '${MAGENTA}$RELEASE_NAME${BLUE}' not found in namespace '${MAGENTA}$NAMESPACE${BLUE}'${RESET}"
40
+ echo -e "${GREEN}βœ… Nothing to clean up${RESET}"
41
  exit 0
42
  fi
43
 
44
  # Show release information
45
+ echo -e "${YELLOW}πŸ“‹ Found Helm release:${RESET}"
46
  helm list -n "$NAMESPACE" | grep "^$RELEASE_NAME" || true
47
 
48
  echo ""
49
+ echo -e "${BLUE}πŸ“Š Release details:${RESET}"
50
+ helm status "$RELEASE_NAME" -n "$NAMESPACE" --no-hooks || true
51
 
52
  # Confirm deletion
53
  echo ""
54
+ echo -e "${BOLD}⚠️ Warning: This will permanently uninstall the Helm release${RESET}"
55
+ read -p "$(echo -e "${YELLOW}❓ Are you sure you want to uninstall '${MAGENTA}$RELEASE_NAME${YELLOW}'? (y/N): ${RESET}")" -n 1 -r
56
  echo
57
  if [[ ! $REPLY =~ ^[Yy]$ ]]; then
58
+ echo -e "${BLUE}❌ Cleanup cancelled${RESET}"
59
  exit 0
60
  fi
61
 
62
+ echo -e "${RED}πŸ—‘οΈ Uninstalling Helm release...${RESET}"
63
  helm uninstall "$RELEASE_NAME" -n "$NAMESPACE"
64
 
65
+ echo -e "${GREEN}βœ… Helm release uninstalled successfully!${RESET}"
66
 
67
  # Check if namespace should be cleaned up (optional)
68
  if [ "$NAMESPACE" != "default" ]; then
69
  echo ""
70
+ echo -e "${YELLOW}πŸ€” The namespace '${MAGENTA}$NAMESPACE${YELLOW}' still exists${RESET}"
71
+ read -p "$(echo -e "${YELLOW}❓ Do you want to delete the namespace as well? (y/N): ${RESET}")" -n 1 -r
72
  echo
73
  if [[ $REPLY =~ ^[Yy]$ ]]; then
74
  # Check if namespace has other resources
75
  OTHER_RESOURCES=$(kubectl get all -n "$NAMESPACE" --ignore-not-found=true 2>/dev/null | grep -v "^NAME" | wc -l)
76
  if [ "$OTHER_RESOURCES" -gt 0 ]; then
77
+ echo -e "${YELLOW}⚠️ Warning: Namespace '${MAGENTA}$NAMESPACE${YELLOW}' contains other resources${RESET}"
78
  kubectl get all -n "$NAMESPACE" 2>/dev/null || true
79
+ read -p "$(echo -e "${RED}❓ Are you sure you want to delete the entire namespace? (y/N): ${RESET}")" -n 1 -r
80
  echo
81
  if [[ $REPLY =~ ^[Yy]$ ]]; then
82
  kubectl delete namespace "$NAMESPACE"
83
+ echo -e "${GREEN}βœ… Namespace '${MAGENTA}$NAMESPACE${GREEN}' deleted${RESET}"
84
  else
85
+ echo -e "${BLUE}ℹ️ Namespace '${MAGENTA}$NAMESPACE${BLUE}' preserved${RESET}"
86
  fi
87
  else
88
  kubectl delete namespace "$NAMESPACE"
89
+ echo -e "${GREEN}βœ… Empty namespace '${MAGENTA}$NAMESPACE${GREEN}' deleted${RESET}"
90
  fi
91
  else
92
+ echo -e "${BLUE}ℹ️ Namespace '${MAGENTA}$NAMESPACE${BLUE}' preserved${RESET}"
93
  fi
94
  fi
95
 
96
  echo ""
97
+ echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
98
+ echo -e "${BOLD}πŸ” Verification Commands:${RESET}"
99
+ echo -e " List releases: ${GREEN}helm list -A${RESET}"
100
+ echo -e " Check resources: ${GREEN}kubectl get all -l app.kubernetes.io/instance=$RELEASE_NAME -A${RESET}"
scripts/cleanup-k8s.sh CHANGED
@@ -1,20 +1,29 @@
1
  #!/bin/bash
2
  set -e
3
 
4
- # Yuga Planner Kubernetes Cleanup Script
5
- # This script removes all Kubernetes resources created by the deployment
 
 
 
 
 
 
6
 
7
- echo "🧹 Cleaning up Yuga Planner Kubernetes deployment..."
 
 
8
 
9
  # Check if kubectl is available
10
  if ! command -v kubectl &> /dev/null; then
11
- echo "❌ Error: kubectl is required but not installed."
12
  exit 1
13
  fi
14
 
15
  # Check if we're in the correct directory (project root)
16
  if [ ! -f "deploy/kubernetes.yaml" ]; then
17
- echo "❌ Error: kubernetes.yaml not found. Please run this script from the project root."
 
18
  exit 1
19
  fi
20
 
@@ -39,7 +48,7 @@ check_resources() {
39
  fi
40
 
41
  if [ "$resource_exists" = false ]; then
42
- echo "ℹ️ No Yuga Planner resources found in the current namespace."
43
  return 1
44
  fi
45
 
@@ -47,37 +56,43 @@ check_resources() {
47
  }
48
 
49
  # Check if any resources exist
 
50
  if ! check_resources; then
51
- echo "βœ… Nothing to clean up."
52
  exit 0
53
  fi
54
 
55
  # Show what will be deleted
56
- echo "πŸ” Found the following Yuga Planner resources:"
57
  kubectl get deployment,service,secret,configmap -l app=yuga-planner 2>/dev/null || true
58
 
59
  # Confirm deletion
60
- read -p "❓ Are you sure you want to delete these resources? (y/N): " -n 1 -r
 
 
61
  echo
62
  if [[ ! $REPLY =~ ^[Yy]$ ]]; then
63
- echo "❌ Cleanup cancelled."
64
  exit 0
65
  fi
66
 
67
- echo "πŸ—‘οΈ Deleting Kubernetes resources..."
68
 
69
  # Delete resources by label selector (safer approach)
70
- echo " β€’ Deleting deployment..."
71
  kubectl delete deployment -l app=yuga-planner --ignore-not-found=true
72
 
73
- echo " β€’ Deleting service..."
74
  kubectl delete service -l app=yuga-planner --ignore-not-found=true
75
 
76
- echo " β€’ Deleting secrets..."
77
  kubectl delete secret -l app=yuga-planner --ignore-not-found=true
78
 
79
- echo " β€’ Deleting configmaps..."
80
  kubectl delete configmap -l app=yuga-planner --ignore-not-found=true
81
 
82
- echo "βœ… Cleanup complete!"
83
- echo "πŸ” Verify cleanup: kubectl get all -l app=yuga-planner"
 
 
 
 
1
  #!/bin/bash
2
  set -e
3
 
4
+ # Colors and formatting
5
+ RED='\033[0;31m'
6
+ GREEN='\033[0;32m'
7
+ YELLOW='\033[1;33m'
8
+ BLUE='\033[0;34m'
9
+ CYAN='\033[0;36m'
10
+ BOLD='\033[1m'
11
+ RESET='\033[0m'
12
 
13
+ # Yuga Planner Kubernetes Cleanup Script
14
+ echo -e "${BOLD}🧹 Yuga Planner - Kubernetes Cleanup${RESET}"
15
+ echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
16
 
17
  # Check if kubectl is available
18
  if ! command -v kubectl &> /dev/null; then
19
+ echo -e "${RED}❌ Error: kubectl is required but not installed${RESET}"
20
  exit 1
21
  fi
22
 
23
  # Check if we're in the correct directory (project root)
24
  if [ ! -f "deploy/kubernetes.yaml" ]; then
25
+ echo -e "${RED}❌ Error: kubernetes.yaml not found${RESET}"
26
+ echo -e "${YELLOW}πŸ’‘ Please run this script from the project root${RESET}"
27
  exit 1
28
  fi
29
 
 
48
  fi
49
 
50
  if [ "$resource_exists" = false ]; then
51
+ echo -e "${BLUE}ℹ️ No Yuga Planner resources found in the current namespace${RESET}"
52
  return 1
53
  fi
54
 
 
56
  }
57
 
58
  # Check if any resources exist
59
+ echo -e "${BLUE}πŸ” Scanning for Yuga Planner resources...${RESET}"
60
  if ! check_resources; then
61
+ echo -e "${GREEN}βœ… Nothing to clean up${RESET}"
62
  exit 0
63
  fi
64
 
65
  # Show what will be deleted
66
+ echo -e "${YELLOW}πŸ“‹ Found the following Yuga Planner resources:${RESET}"
67
  kubectl get deployment,service,secret,configmap -l app=yuga-planner 2>/dev/null || true
68
 
69
  # Confirm deletion
70
+ echo ""
71
+ echo -e "${BOLD}⚠️ Warning: This will permanently delete all Yuga Planner resources${RESET}"
72
+ read -p "$(echo -e "${YELLOW}❓ Are you sure you want to continue? (y/N): ${RESET}")" -n 1 -r
73
  echo
74
  if [[ ! $REPLY =~ ^[Yy]$ ]]; then
75
+ echo -e "${BLUE}❌ Cleanup cancelled${RESET}"
76
  exit 0
77
  fi
78
 
79
+ echo -e "${RED}πŸ—‘οΈ Deleting Kubernetes resources...${RESET}"
80
 
81
  # Delete resources by label selector (safer approach)
82
+ echo -e " ${CYAN}β€’ Deleting deployment...${RESET}"
83
  kubectl delete deployment -l app=yuga-planner --ignore-not-found=true
84
 
85
+ echo -e " ${CYAN}β€’ Deleting service...${RESET}"
86
  kubectl delete service -l app=yuga-planner --ignore-not-found=true
87
 
88
+ echo -e " ${CYAN}β€’ Deleting secrets...${RESET}"
89
  kubectl delete secret -l app=yuga-planner --ignore-not-found=true
90
 
91
+ echo -e " ${CYAN}β€’ Deleting configmaps...${RESET}"
92
  kubectl delete configmap -l app=yuga-planner --ignore-not-found=true
93
 
94
+ echo ""
95
+ echo -e "${GREEN}βœ… Cleanup complete!${RESET}"
96
+ echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
97
+ echo -e "${BOLD}πŸ” Verification:${RESET}"
98
+ echo -e " Check remaining: ${GREEN}kubectl get all -l app=yuga-planner${RESET}"
scripts/deploy-helm.sh CHANGED
@@ -1,14 +1,24 @@
1
  #!/bin/bash
2
  set -e
3
 
4
- # Yuga Planner Helm Deployment Script
5
- # This script loads credentials from environment variables or creds.py and deploys using Helm
 
 
 
 
 
 
 
6
 
7
- echo "πŸš€ Deploying Yuga Planner using Helm..."
 
 
8
 
9
  # Check if we're in the correct directory (project root)
10
  if [ ! -d "deploy/helm" ] && [ ! -f "deploy/helm/Chart.yaml" ]; then
11
- echo "❌ Error: Helm chart not found. Please ensure deploy/helm/Chart.yaml exists."
 
12
  exit 1
13
  fi
14
 
@@ -16,6 +26,7 @@ fi
16
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
17
 
18
  # Source the credential loading script
 
19
  source "${SCRIPT_DIR}/load-credentials.sh"
20
 
21
  # Check and load credentials
@@ -23,58 +34,73 @@ if ! check_credentials; then
23
  exit 1
24
  fi
25
 
26
- # Check if helm is available
 
 
27
  if ! command -v helm &> /dev/null; then
28
- echo "❌ Error: helm is required but not installed."
29
- echo "πŸ’‘ Install Helm from: https://helm.sh/docs/intro/install/"
 
 
 
 
 
 
30
  exit 1
31
  fi
32
 
 
 
33
  # Configuration
34
  RELEASE_NAME="${HELM_RELEASE_NAME:-yuga-planner}"
35
- # Get current namespace, fallback to default if not set
36
  CURRENT_NAMESPACE=$(kubectl config view --minify --output 'jsonpath={..namespace}' 2>/dev/null || echo "default")
37
  NAMESPACE="${HELM_NAMESPACE:-$CURRENT_NAMESPACE}"
38
  CHART_PATH="${HELM_CHART_PATH:-deploy/helm}"
39
 
40
- echo "πŸ“¦ Helm Release: $RELEASE_NAME"
41
- echo "🏷️ Namespace: $NAMESPACE"
42
- echo "πŸ“‚ Chart Path: $CHART_PATH"
 
 
43
 
44
  # Create namespace if it doesn't exist
45
  if ! kubectl get namespace "$NAMESPACE" &> /dev/null; then
46
- echo "πŸ—οΈ Creating namespace: $NAMESPACE"
47
  kubectl create namespace "$NAMESPACE"
48
  fi
49
 
50
  # Prepare Helm values with environment variables
 
51
  HELM_VALUES=""
52
- HELM_VALUES="$HELM_VALUES --set env.NEBIUS_API_KEY=$NEBIUS_API_KEY"
53
- HELM_VALUES="$HELM_VALUES --set env.NEBIUS_MODEL=$NEBIUS_MODEL"
54
- HELM_VALUES="$HELM_VALUES --set env.MODAL_TOKEN_ID=$MODAL_TOKEN_ID"
55
- HELM_VALUES="$HELM_VALUES --set env.MODAL_TOKEN_SECRET=$MODAL_TOKEN_SECRET"
56
- HELM_VALUES="$HELM_VALUES --set env.HF_MODEL=$HF_MODEL"
57
- HELM_VALUES="$HELM_VALUES --set env.HF_TOKEN=$HF_TOKEN"
58
 
59
  # Add optional environment variables if set
60
  if [ ! -z "$IMAGE_TAG" ]; then
61
  HELM_VALUES="$HELM_VALUES --set image.tag=$IMAGE_TAG"
 
62
  fi
63
 
64
  if [ ! -z "$REPLICAS" ]; then
65
- HELM_VALUES="$HELM_VALUES --set replicaCount=$REPLICAS"
 
66
  fi
67
 
68
- # Check if release already exists
 
69
  if helm list -n "$NAMESPACE" | grep -q "^$RELEASE_NAME"; then
70
- echo "πŸ”„ Upgrading existing Helm release..."
71
  helm upgrade "$RELEASE_NAME" "$CHART_PATH" \
72
  --namespace "$NAMESPACE" \
73
  $HELM_VALUES \
74
  --timeout 300s \
75
  --wait
76
  else
77
- echo "πŸ†• Installing new Helm release..."
78
  helm install "$RELEASE_NAME" "$CHART_PATH" \
79
  --namespace "$NAMESPACE" \
80
  $HELM_VALUES \
@@ -82,13 +108,16 @@ else
82
  --wait
83
  fi
84
 
85
- echo "βœ… Deployment complete!"
86
  echo ""
87
- echo "πŸ“Š Release Information:"
88
- helm status "$RELEASE_NAME" -n "$NAMESPACE"
 
 
 
 
89
  echo ""
90
- echo "πŸ” Useful commands:"
91
- echo " β€’ Check pods: kubectl get pods -l app.kubernetes.io/instance=$RELEASE_NAME -n $NAMESPACE"
92
- echo " β€’ View logs: kubectl logs -l app.kubernetes.io/instance=$RELEASE_NAME -n $NAMESPACE -f"
93
- echo " β€’ Port forward: kubectl port-forward svc/$RELEASE_NAME 8080:80 -n $NAMESPACE"
94
- echo " β€’ Uninstall: helm uninstall $RELEASE_NAME -n $NAMESPACE"
 
1
  #!/bin/bash
2
  set -e
3
 
4
+ # Colors and formatting
5
+ RED='\033[0;31m'
6
+ GREEN='\033[0;32m'
7
+ YELLOW='\033[1;33m'
8
+ BLUE='\033[0;34m'
9
+ CYAN='\033[0;36m'
10
+ MAGENTA='\033[0;35m'
11
+ BOLD='\033[1m'
12
+ RESET='\033[0m'
13
 
14
+ # Yuga Planner Helm Deployment Script
15
+ echo -e "${BOLD}⎈ Yuga Planner - Helm Deployment${RESET}"
16
+ echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
17
 
18
  # Check if we're in the correct directory (project root)
19
  if [ ! -d "deploy/helm" ] && [ ! -f "deploy/helm/Chart.yaml" ]; then
20
+ echo -e "${RED}❌ Error: Helm chart not found${RESET}"
21
+ echo -e "${YELLOW}πŸ’‘ Please ensure deploy/helm/Chart.yaml exists${RESET}"
22
  exit 1
23
  fi
24
 
 
26
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
27
 
28
  # Source the credential loading script
29
+ echo -e "${BLUE}πŸ“‹ Loading credential management...${RESET}"
30
  source "${SCRIPT_DIR}/load-credentials.sh"
31
 
32
  # Check and load credentials
 
34
  exit 1
35
  fi
36
 
37
+ # Check dependencies
38
+ echo -e "${BLUE}πŸ”§ Checking dependencies...${RESET}"
39
+
40
  if ! command -v helm &> /dev/null; then
41
+ echo -e "${RED}❌ Error: helm is required but not installed${RESET}"
42
+ echo -e "${YELLOW}πŸ’‘ Install from: ${CYAN}https://helm.sh/docs/intro/install/${RESET}"
43
+ exit 1
44
+ fi
45
+
46
+ if ! command -v kubectl &> /dev/null; then
47
+ echo -e "${RED}❌ Error: kubectl is required but not installed${RESET}"
48
+ echo -e "${YELLOW}πŸ’‘ Install from: ${CYAN}https://kubernetes.io/docs/tasks/tools/${RESET}"
49
  exit 1
50
  fi
51
 
52
+ echo -e "${GREEN}βœ… All dependencies found${RESET}"
53
+
54
  # Configuration
55
  RELEASE_NAME="${HELM_RELEASE_NAME:-yuga-planner}"
 
56
  CURRENT_NAMESPACE=$(kubectl config view --minify --output 'jsonpath={..namespace}' 2>/dev/null || echo "default")
57
  NAMESPACE="${HELM_NAMESPACE:-$CURRENT_NAMESPACE}"
58
  CHART_PATH="${HELM_CHART_PATH:-deploy/helm}"
59
 
60
+ echo ""
61
+ echo -e "${BOLD}πŸ“¦ Deployment Configuration:${RESET}"
62
+ echo -e " Release: ${MAGENTA}$RELEASE_NAME${RESET}"
63
+ echo -e " Namespace: ${MAGENTA}$NAMESPACE${RESET}"
64
+ echo -e " Chart: ${MAGENTA}$CHART_PATH${RESET}"
65
 
66
  # Create namespace if it doesn't exist
67
  if ! kubectl get namespace "$NAMESPACE" &> /dev/null; then
68
+ echo -e "${CYAN}πŸ—οΈ Creating namespace: ${MAGENTA}$NAMESPACE${RESET}"
69
  kubectl create namespace "$NAMESPACE"
70
  fi
71
 
72
  # Prepare Helm values with environment variables
73
+ echo -e "${BLUE}πŸ”§ Preparing deployment values...${RESET}"
74
  HELM_VALUES=""
75
+ HELM_VALUES="$HELM_VALUES --set secrets.nebiusApiKey=$NEBIUS_API_KEY"
76
+ HELM_VALUES="$HELM_VALUES --set secrets.nebiusModel=$NEBIUS_MODEL"
77
+ HELM_VALUES="$HELM_VALUES --set secrets.modalTokenId=$MODAL_TOKEN_ID"
78
+ HELM_VALUES="$HELM_VALUES --set secrets.modalTokenSecret=$MODAL_TOKEN_SECRET"
79
+ HELM_VALUES="$HELM_VALUES --set secrets.hfModel=$HF_MODEL"
80
+ HELM_VALUES="$HELM_VALUES --set secrets.hfToken=$HF_TOKEN"
81
 
82
  # Add optional environment variables if set
83
  if [ ! -z "$IMAGE_TAG" ]; then
84
  HELM_VALUES="$HELM_VALUES --set image.tag=$IMAGE_TAG"
85
+ echo -e " Using custom image tag: ${YELLOW}$IMAGE_TAG${RESET}"
86
  fi
87
 
88
  if [ ! -z "$REPLICAS" ]; then
89
+ HELM_VALUES="$HELM_VALUES --set deployment.replicas=$REPLICAS"
90
+ echo -e " Using custom replica count: ${YELLOW}$REPLICAS${RESET}"
91
  fi
92
 
93
+ # Deploy with Helm
94
+ echo ""
95
  if helm list -n "$NAMESPACE" | grep -q "^$RELEASE_NAME"; then
96
+ echo -e "${CYAN}πŸ”„ Upgrading existing Helm release...${RESET}"
97
  helm upgrade "$RELEASE_NAME" "$CHART_PATH" \
98
  --namespace "$NAMESPACE" \
99
  $HELM_VALUES \
100
  --timeout 300s \
101
  --wait
102
  else
103
+ echo -e "${CYAN}πŸ†• Installing new Helm release...${RESET}"
104
  helm install "$RELEASE_NAME" "$CHART_PATH" \
105
  --namespace "$NAMESPACE" \
106
  $HELM_VALUES \
 
108
  --wait
109
  fi
110
 
 
111
  echo ""
112
+ echo -e "${GREEN}βœ… Deployment complete!${RESET}"
113
+ echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
114
+
115
+ echo -e "${BOLD}πŸ“Š Release Information:${RESET}"
116
+ helm status "$RELEASE_NAME" -n "$NAMESPACE" --no-hooks
117
+
118
  echo ""
119
+ echo -e "${BOLD}πŸ” Useful Commands:${RESET}"
120
+ echo -e " Check pods: ${GREEN}kubectl get pods -l app.kubernetes.io/instance=$RELEASE_NAME -n $NAMESPACE${RESET}"
121
+ echo -e " View logs: ${GREEN}kubectl logs -l app.kubernetes.io/instance=$RELEASE_NAME -n $NAMESPACE -f${RESET}"
122
+ echo -e " Port forward: ${GREEN}kubectl port-forward svc/$RELEASE_NAME 8080:80 -n $NAMESPACE${RESET}"
123
+ echo -e " Uninstall: ${RED}helm uninstall $RELEASE_NAME -n $NAMESPACE${RESET}"
scripts/deploy-k8s.sh CHANGED
@@ -1,14 +1,23 @@
1
  #!/bin/bash
2
  set -e
3
 
4
- # Yuga Planner Kubernetes Deployment Script
5
- # This script loads credentials from environment variables or creds.py and deploys to Kubernetes
 
 
 
 
 
 
6
 
7
- echo "πŸš€ Deploying Yuga Planner to Kubernetes..."
 
 
8
 
9
  # Check if we're in the correct directory (project root)
10
  if [ ! -f "deploy/kubernetes.yaml" ]; then
11
- echo "❌ Error: kubernetes.yaml not found. Please run this script from the project root."
 
12
  exit 1
13
  fi
14
 
@@ -16,6 +25,7 @@ fi
16
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
17
 
18
  # Source the credential loading script
 
19
  source "${SCRIPT_DIR}/load-credentials.sh"
20
 
21
  # Check and load credentials
@@ -23,23 +33,35 @@ if ! check_credentials; then
23
  exit 1
24
  fi
25
 
26
- # Check if envsubst is available
 
 
27
  if ! command -v envsubst &> /dev/null; then
28
- echo "❌ Error: envsubst is required but not installed. Please install gettext-base package."
 
29
  exit 1
30
  fi
31
 
32
- # Check if kubectl is available
33
  if ! command -v kubectl &> /dev/null; then
34
- echo "❌ Error: kubectl is required but not installed."
 
35
  exit 1
36
  fi
37
 
38
- # Substitute environment variables and apply to Kubernetes
39
- echo "πŸ”§ Substituting environment variables and deploying..."
 
 
40
  envsubst < deploy/kubernetes.yaml | kubectl apply -f -
41
 
42
- echo "βœ… Deployment complete!"
43
- echo "🌐 Access the application at: http://<node-ip>:30860"
44
- echo "πŸ” Check deployment status: kubectl get pods -l app=yuga-planner"
45
- echo "πŸ“‹ View logs: kubectl logs -l app=yuga-planner -f"
 
 
 
 
 
 
 
 
1
  #!/bin/bash
2
  set -e
3
 
4
+ # Colors and formatting
5
+ RED='\033[0;31m'
6
+ GREEN='\033[0;32m'
7
+ YELLOW='\033[1;33m'
8
+ BLUE='\033[0;34m'
9
+ CYAN='\033[0;36m'
10
+ BOLD='\033[1m'
11
+ RESET='\033[0m'
12
 
13
+ # Yuga Planner Kubernetes Deployment Script
14
+ echo -e "${BOLD}πŸš€ Yuga Planner - Kubernetes Deployment${RESET}"
15
+ echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
16
 
17
  # Check if we're in the correct directory (project root)
18
  if [ ! -f "deploy/kubernetes.yaml" ]; then
19
+ echo -e "${RED}❌ Error: kubernetes.yaml not found${RESET}"
20
+ echo -e "${YELLOW}πŸ’‘ Please run this script from the project root${RESET}"
21
  exit 1
22
  fi
23
 
 
25
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
26
 
27
  # Source the credential loading script
28
+ echo -e "${BLUE}πŸ“‹ Loading credential management...${RESET}"
29
  source "${SCRIPT_DIR}/load-credentials.sh"
30
 
31
  # Check and load credentials
 
33
  exit 1
34
  fi
35
 
36
+ # Check dependencies
37
+ echo -e "${BLUE}πŸ”§ Checking dependencies...${RESET}"
38
+
39
  if ! command -v envsubst &> /dev/null; then
40
+ echo -e "${RED}❌ Error: envsubst is required but not installed${RESET}"
41
+ echo -e "${YELLOW}πŸ’‘ Install with: ${CYAN}apt-get install gettext-base${RESET}"
42
  exit 1
43
  fi
44
 
 
45
  if ! command -v kubectl &> /dev/null; then
46
+ echo -e "${RED}❌ Error: kubectl is required but not installed${RESET}"
47
+ echo -e "${YELLOW}πŸ’‘ Install from: ${CYAN}https://kubernetes.io/docs/tasks/tools/${RESET}"
48
  exit 1
49
  fi
50
 
51
+ echo -e "${GREEN}βœ… All dependencies found${RESET}"
52
+
53
+ # Deploy to Kubernetes
54
+ echo -e "${CYAN}πŸ”§ Substituting environment variables and deploying...${RESET}"
55
  envsubst < deploy/kubernetes.yaml | kubectl apply -f -
56
 
57
+ echo ""
58
+ echo -e "${GREEN}βœ… Deployment complete!${RESET}"
59
+ echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
60
+ echo -e "${BOLD}🌐 Quick Access:${RESET}"
61
+ echo -e " Access URL: ${CYAN}http://<node-ip>:30860${RESET}"
62
+ echo ""
63
+ echo -e "${BOLD}πŸ“Š Useful Commands:${RESET}"
64
+ echo -e " Check status: ${GREEN}kubectl get pods -l app=yuga-planner${RESET}"
65
+ echo -e " View logs: ${GREEN}kubectl logs -l app=yuga-planner -f${RESET}"
66
+ echo -e " Get services: ${GREEN}kubectl get svc -l app=yuga-planner${RESET}"
67
+ echo -e " Port forward: ${GREEN}kubectl port-forward svc/yuga-planner-service 8080:80${RESET}"
scripts/load-credentials.sh CHANGED
@@ -1,5 +1,14 @@
1
  #!/bin/bash
2
 
 
 
 
 
 
 
 
 
 
3
  # Yuga Planner Credential Loading Script
4
  # This script loads credentials from environment variables or creds.py
5
 
@@ -8,7 +17,7 @@ load_credentials() {
8
  local creds_file="tests/secrets/creds.py"
9
 
10
  if [ -f "$creds_file" ]; then
11
- echo "πŸ“‹ Loading credentials from $creds_file..."
12
 
13
  # Extract credentials from creds.py if environment variables are not set
14
  if [ -z "$NEBIUS_API_KEY" ]; then
@@ -65,26 +74,36 @@ print(creds.HF_TOKEN)
65
  " 2>/dev/null || echo "")
66
  fi
67
  else
68
- echo "⚠️ Warning: $creds_file not found"
 
69
  fi
70
  }
71
 
72
  # Function to check and validate required credentials
73
  check_credentials() {
74
- echo "πŸ” Checking for credentials..."
75
 
76
  local missing_vars=()
77
  local required_vars=("NEBIUS_API_KEY" "NEBIUS_MODEL" "MODAL_TOKEN_ID" "MODAL_TOKEN_SECRET" "HF_MODEL" "HF_TOKEN")
 
78
 
 
79
  for var in "${required_vars[@]}"; do
80
  if [ -z "${!var}" ]; then
81
  missing_vars+=("$var")
 
 
82
  fi
83
  done
84
 
 
 
 
 
 
85
  if [ ${#missing_vars[@]} -gt 0 ]; then
86
- echo "πŸ“‚ Missing environment variables: ${missing_vars[*]}"
87
- echo "πŸ”„ Attempting to load from creds.py..."
88
  load_credentials
89
 
90
  # Check again after loading from creds.py
@@ -96,18 +115,26 @@ check_credentials() {
96
  done
97
 
98
  if [ ${#missing_vars[@]} -gt 0 ]; then
99
- echo "❌ Error: The following required environment variables are not set: ${missing_vars[*]}"
100
- echo "πŸ’‘ Please set them in your environment or ensure tests/secrets/creds.py exists with the required values."
 
 
 
 
 
 
101
  return 1
102
  fi
103
  fi
104
 
105
- echo "βœ… All credentials found"
106
  return 0
107
  }
108
 
109
  # Main execution when script is run directly
110
  if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
 
 
111
  check_credentials
112
  exit $?
113
  fi
 
1
  #!/bin/bash
2
 
3
+ # Colors and formatting
4
+ RED='\033[0;31m'
5
+ GREEN='\033[0;32m'
6
+ YELLOW='\033[1;33m'
7
+ BLUE='\033[0;34m'
8
+ CYAN='\033[0;36m'
9
+ BOLD='\033[1m'
10
+ RESET='\033[0m'
11
+
12
  # Yuga Planner Credential Loading Script
13
  # This script loads credentials from environment variables or creds.py
14
 
 
17
  local creds_file="tests/secrets/creds.py"
18
 
19
  if [ -f "$creds_file" ]; then
20
+ echo -e "${BLUE}πŸ“‹ Loading credentials from $creds_file...${RESET}"
21
 
22
  # Extract credentials from creds.py if environment variables are not set
23
  if [ -z "$NEBIUS_API_KEY" ]; then
 
74
  " 2>/dev/null || echo "")
75
  fi
76
  else
77
+ echo -e "${YELLOW}⚠️ Warning: $creds_file not found${RESET}"
78
+ echo -e "${CYAN}πŸ’‘ Run '${GREEN}make setup-secrets${CYAN}' to create the template${RESET}"
79
  fi
80
  }
81
 
82
  # Function to check and validate required credentials
83
  check_credentials() {
84
+ echo -e "${CYAN}πŸ” Validating credentials...${RESET}"
85
 
86
  local missing_vars=()
87
  local required_vars=("NEBIUS_API_KEY" "NEBIUS_MODEL" "MODAL_TOKEN_ID" "MODAL_TOKEN_SECRET" "HF_MODEL" "HF_TOKEN")
88
+ local found_vars=()
89
 
90
+ # First check what's already available
91
  for var in "${required_vars[@]}"; do
92
  if [ -z "${!var}" ]; then
93
  missing_vars+=("$var")
94
+ else
95
+ found_vars+=("$var")
96
  fi
97
  done
98
 
99
+ # Show what we found
100
+ if [ ${#found_vars[@]} -gt 0 ]; then
101
+ echo -e "${GREEN}βœ… Found environment variables: ${found_vars[*]}${RESET}"
102
+ fi
103
+
104
  if [ ${#missing_vars[@]} -gt 0 ]; then
105
+ echo -e "${YELLOW}πŸ“‚ Missing from environment: ${missing_vars[*]}${RESET}"
106
+ echo -e "${BLUE}πŸ”„ Attempting to load from creds.py...${RESET}"
107
  load_credentials
108
 
109
  # Check again after loading from creds.py
 
115
  done
116
 
117
  if [ ${#missing_vars[@]} -gt 0 ]; then
118
+ echo ""
119
+ echo -e "${RED}❌ Error: Missing required credentials: ${missing_vars[*]}${RESET}"
120
+ echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
121
+ echo -e "${BOLD}πŸ’‘ Setup Instructions:${RESET}"
122
+ echo -e " 1. Run: ${GREEN}make setup-secrets${RESET}"
123
+ echo -e " 2. Edit: ${CYAN}tests/secrets/creds.py${RESET}"
124
+ echo -e " 3. Add your API credentials"
125
+ echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
126
  return 1
127
  fi
128
  fi
129
 
130
+ echo -e "${GREEN}βœ… All credentials validated successfully${RESET}"
131
  return 0
132
  }
133
 
134
  # Main execution when script is run directly
135
  if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
136
+ echo -e "${BOLD}πŸ” Yuga Planner - Credential Validator${RESET}"
137
+ echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
138
  check_credentials
139
  exit $?
140
  fi