Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ENABLE_SWAGGER=true

# InfluxDB 3 Configuration (for telemetry time-series storage)
INFLUX_HOST=http://localhost:8181
INFLUX_TOKEN=apiv3_fqnVwnfzaVcJMTjm1nPvPAgTOdhoBjHLug6agmOrcdTTt_kIyp6DGnLQv2qWzyZ8WY4gTPGbvBXJtpYpM2bl8A
INFLUX_TOKEN=apiv3_nih6ByqY3a70gCY7k9Mc1w_SEGOWN_N_jEHZZMRqm3N4di-QoCCtMByqNmvcZpJzvdy_4x11ZDcoPMyaytV7vA
INFLUX_DATABASE=telemetry

# SQLite Configuration (for decision logging)
Expand Down Expand Up @@ -51,3 +51,13 @@ WEBHOOK_PROCESS_TIMEOUT_MS=15000
# true -> accept legacy body-only signatures when X-Webhook-Timestamp is absent
# false -> require timestamp-bound signatures only
WEBHOOK_ACCEPT_LEGACY_SIGNATURE=true

# Drill Director / Kubernetes execution (local dev; kubeconfig copied from VM)
DRILLS_KUBECONFIG_PATH=/Users/teransarathchandra/Development/Sliit/Y04S02/Research New/analysis-engine/.drills-kubeconfig
DRILLS_KUBE_CONTEXT=boutique
# Uses a local SSH tunnel that forwards to the VM's Minikube API (192.168.49.2:8443)
DRILLS_KUBE_API_SERVER=https://127.0.0.1:16443
DRILLS_LOADGEN_DEPLOYMENT=loadgenerator
DRILLS_LOADGEN_CONTAINER=main
DRILLS_TARGETED_LOAD_RATE_ENV=RATE
DRILLS_TARGETED_LOAD_USERS_ENV=USERS
10 changes: 10 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,13 @@ WEBHOOK_PROCESS_TIMEOUT_MS=15000
# true -> accept legacy body-only signatures when X-Webhook-Timestamp is absent
# false -> require timestamp-bound signatures only
WEBHOOK_ACCEPT_LEGACY_SIGNATURE=true

# Drill Director / Kubernetes execution (optional for local drill runs)
# If not set, the drill engine will try in-cluster config first, then default kubeconfig loading rules.
# DRILLS_KUBECONFIG_PATH=/absolute/path/to/kubeconfig
# DRILLS_KUBE_CONTEXT=your-context
# DRILLS_KUBE_API_SERVER=https://your-cluster-api-server
# DRILLS_LOADGEN_DEPLOYMENT=loadgenerator
# DRILLS_LOADGEN_CONTAINER=main
# DRILLS_TARGETED_LOAD_RATE_ENV=RATE
# DRILLS_TARGETED_LOAD_USERS_ENV=USERS
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ analysis-engine

# Config
.env
.drills-kubeconfig
.DS_Store

# IDEs
.vscode/
.idea/

# SQLite
data/*.db*
data/*.db*
17 changes: 17 additions & 0 deletions cmd/analysis-engine/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"predictive-analysis-engine/pkg/clients/graph"
"predictive-analysis-engine/pkg/clients/telemetry"
"predictive-analysis-engine/pkg/config"
"predictive-analysis-engine/pkg/drills"
"predictive-analysis-engine/pkg/simulation"
"predictive-analysis-engine/pkg/storage"
"predictive-analysis-engine/pkg/worker"
Expand Down Expand Up @@ -68,6 +69,21 @@ func main() {
decisionsHandler := &api.DecisionsHandler{Store: store}
telemetryHandler := &api.TelemetryHandler{Client: telemetryClient, Cfg: cfg}

drillEngine := drills.NewEngine(store, graphClient, telemetryClient, drills.EngineOptions{
K8sClientOptions: drills.K8sClientOptions{
KubeconfigPath: cfg.Drills.KubeconfigPath,
KubeContext: cfg.Drills.KubeContext,
APIServer: cfg.Drills.KubeAPIServer,
},
TargetedLoad: drills.TargetedLoadActionOptions{
DeploymentName: cfg.Drills.LoadGeneratorDeployment,
ContainerName: cfg.Drills.LoadGeneratorContainer,
RateEnvName: cfg.Drills.TargetedLoadRateEnv,
UsersEnvName: cfg.Drills.TargetedLoadUsersEnv,
},
})
drillsHandler := &api.DrillsHandler{Engine: drillEngine, Store: store}

r := chi.NewRouter()

r.Use(api.CORSMiddleware)
Expand All @@ -94,6 +110,7 @@ func main() {
r.Get("/dependency-graph/snapshot", apiHandler.DependencyGraphHandler)

decisionsHandler.RegisterRoutes(r)
drillsHandler.RegisterRoutes(r)
r.Mount("/telemetry", telemetryHandler.Routes())

// Webhook endpoint: receives graph updates from service-graph-engine
Expand Down
33 changes: 33 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,63 @@ require (
github.com/mattn/go-sqlite3 v1.14.33
github.com/swaggo/http-swagger/v2 v2.0.2
github.com/swaggo/swag/v2 v2.0.0-rc5
k8s.io/apimachinery v0.35.1
k8s.io/client-go v0.35.1
)

require (
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-openapi/jsonpointer v0.22.4 // indirect
github.com/go-openapi/jsonreference v0.21.4 // indirect
github.com/go-openapi/spec v0.22.3 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-openapi/swag/conv v0.25.4 // indirect
github.com/go-openapi/swag/jsonname v0.25.4 // indirect
github.com/go-openapi/swag/jsonutils v0.25.4 // indirect
github.com/go-openapi/swag/loading v0.25.4 // indirect
github.com/go-openapi/swag/stringutils v0.25.4 // indirect
github.com/go-openapi/swag/typeutils v0.25.4 // indirect
github.com/go-openapi/swag/yamlutils v0.25.4 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oapi-codegen/runtime v1.0.0 // indirect
github.com/spf13/pflag v1.0.9 // indirect
github.com/sv-tools/openapi v0.4.0 // indirect
github.com/swaggo/files/v2 v2.0.2 // indirect
github.com/swaggo/swag v1.16.6 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/mod v0.32.0 // indirect
golang.org/x/net v0.49.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sys v0.40.0 // indirect
golang.org/x/term v0.39.0 // indirect
golang.org/x/text v0.33.0 // indirect
golang.org/x/time v0.9.0 // indirect
golang.org/x/tools v0.41.0 // indirect
google.golang.org/protobuf v1.36.8 // indirect
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.35.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
sigs.k8s.io/yaml v1.6.0 // indirect
)
Loading