Bump WHOOSH release to 0.1.7

This commit is contained in:
Claude Code
2025-10-17 09:26:02 +11:00
parent e2847a64ba
commit f5a141f97b
4 changed files with 73 additions and 62 deletions

View File

@@ -1,4 +1,6 @@
FROM golang:1.22-alpine AS builder # syntax=docker/dockerfile:1.4
FROM golang:1.24-alpine AS builder
# Install build dependencies # Install build dependencies
RUN apk add --no-cache git ca-certificates tzdata RUN apk add --no-cache git ca-certificates tzdata
@@ -6,15 +8,15 @@ RUN apk add --no-cache git ca-certificates tzdata
# Set working directory # Set working directory
WORKDIR /app WORKDIR /app
# Provide CHORUS module for local replace directive
COPY --from=chorus / /CHORUS/
# Copy BACKBEAT dependency first # Copy BACKBEAT dependency first
COPY BACKBEAT-prototype ./BACKBEAT-prototype/ COPY BACKBEAT-prototype ./BACKBEAT-prototype/
# Copy go mod files first for better caching # Copy go mod files first for better caching
COPY go.mod go.sum ./ COPY go.mod go.sum ./
# Download and verify dependencies
RUN go mod download && go mod verify
# Copy source code # Copy source code
COPY . . COPY . .
@@ -24,7 +26,7 @@ RUN cp /etc/group /tmp/group && \
echo "docker:x:998:65534" >> /tmp/group echo "docker:x:998:65534" >> /tmp/group
# Build with optimizations and version info # Build with optimizations and version info
ARG VERSION=v0.1.0-mvp ARG VERSION=v0.1.7
ARG COMMIT_HASH ARG COMMIT_HASH
ARG BUILD_DATE ARG BUILD_DATE
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
@@ -76,4 +78,4 @@ LABEL maintainer="CHORUS Ecosystem" \
# Run the application # Run the application
ENTRYPOINT ["/app/whoosh"] ENTRYPOINT ["/app/whoosh"]
CMD [] CMD []

View File

@@ -26,7 +26,7 @@ const (
var ( var (
// Build-time variables (set via ldflags) // Build-time variables (set via ldflags)
version = "0.1.5" version = "0.1.7"
commitHash = "unknown" commitHash = "unknown"
buildDate = "unknown" buildDate = "unknown"
) )
@@ -67,7 +67,7 @@ func main() {
// Load configuration // Load configuration
var cfg config.Config var cfg config.Config
// Debug: Print all environment variables starting with WHOOSH // Debug: Print all environment variables starting with WHOOSH
log.Debug().Msg("Environment variables:") log.Debug().Msg("Environment variables:")
for _, env := range os.Environ() { for _, env := range os.Environ() {
@@ -83,7 +83,7 @@ func main() {
} }
} }
} }
if err := envconfig.Process("whoosh", &cfg); err != nil { if err := envconfig.Process("whoosh", &cfg); err != nil {
log.Fatal().Err(err).Msg("Failed to load configuration") log.Fatal().Err(err).Msg("Failed to load configuration")
} }
@@ -122,7 +122,7 @@ func main() {
log.Fatal().Err(err).Msg("Failed to initialize tracing") log.Fatal().Err(err).Msg("Failed to initialize tracing")
} }
defer tracingCleanup() defer tracingCleanup()
if cfg.OpenTelemetry.Enabled { if cfg.OpenTelemetry.Enabled {
log.Info(). log.Info().
Str("jaeger_endpoint", cfg.OpenTelemetry.JaegerEndpoint). Str("jaeger_endpoint", cfg.OpenTelemetry.JaegerEndpoint).
@@ -133,7 +133,7 @@ func main() {
// Set version for server // Set version for server
server.SetVersion(version) server.SetVersion(version)
// Initialize server // Initialize server
srv, err := server.NewServer(&cfg, db) srv, err := server.NewServer(&cfg, db)
if err != nil { if err != nil {
@@ -148,7 +148,7 @@ func main() {
log.Info(). log.Info().
Str("addr", cfg.Server.ListenAddr). Str("addr", cfg.Server.ListenAddr).
Msg("🌐 Starting HTTP server") Msg("🌐 Starting HTTP server")
if err := srv.Start(ctx); err != nil { if err := srv.Start(ctx); err != nil {
log.Error().Err(err).Msg("Server startup failed") log.Error().Err(err).Msg("Server startup failed")
cancel() cancel()
@@ -168,7 +168,7 @@ func main() {
// Graceful shutdown // Graceful shutdown
log.Info().Msg("🔄 Starting graceful shutdown...") log.Info().Msg("🔄 Starting graceful shutdown...")
shutdownCtx, shutdownCancel := context.WithTimeout(context.Background(), 30*time.Second) shutdownCtx, shutdownCancel := context.WithTimeout(context.Background(), 30*time.Second)
defer shutdownCancel() defer shutdownCancel()
@@ -182,10 +182,10 @@ func main() {
func runHealthCheck() error { func runHealthCheck() error {
// Simple health check - try to connect to health endpoint // Simple health check - try to connect to health endpoint
client := &http.Client{Timeout: 5 * time.Second} client := &http.Client{Timeout: 5 * time.Second}
// Use localhost for health check // Use localhost for health check
healthURL := "http://localhost:8080/health" healthURL := "http://localhost:8080/health"
resp, err := client.Get(healthURL) resp, err := client.Get(healthURL)
if err != nil { if err != nil {
return fmt.Errorf("health check request failed: %w", err) return fmt.Errorf("health check request failed: %w", err)
@@ -202,7 +202,7 @@ func runHealthCheck() error {
func setupLogging() { func setupLogging() {
// Configure zerolog for structured logging // Configure zerolog for structured logging
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
// Set log level from environment // Set log level from environment
level := os.Getenv("LOG_LEVEL") level := os.Getenv("LOG_LEVEL")
switch level { switch level {

View File

@@ -9,16 +9,17 @@ import (
) )
type Config struct { type Config struct {
Server ServerConfig `envconfig:"server"` Server ServerConfig `envconfig:"server"`
Database DatabaseConfig `envconfig:"database"` Database DatabaseConfig `envconfig:"database"`
GITEA GITEAConfig `envconfig:"gitea"` GITEA GITEAConfig `envconfig:"gitea"`
Auth AuthConfig `envconfig:"auth"` Auth AuthConfig `envconfig:"auth"`
Logging LoggingConfig `envconfig:"logging"` Logging LoggingConfig `envconfig:"logging"`
BACKBEAT BackbeatConfig `envconfig:"backbeat"` BACKBEAT BackbeatConfig `envconfig:"backbeat"`
Docker DockerConfig `envconfig:"docker"` Docker DockerConfig `envconfig:"docker"`
N8N N8NConfig `envconfig:"n8n"` N8N N8NConfig `envconfig:"n8n"`
OpenTelemetry OpenTelemetryConfig `envconfig:"opentelemetry"` OpenTelemetry OpenTelemetryConfig `envconfig:"opentelemetry"`
Composer ComposerConfig `envconfig:"composer"` Composer ComposerConfig `envconfig:"composer"`
TaskAnnouncer TaskAnnouncerConfig `envconfig:"task_announcer"`
} }
type ServerConfig struct { type ServerConfig struct {
@@ -44,7 +45,6 @@ type DatabaseConfig struct {
MaxIdleConns int `envconfig:"DB_MAX_IDLE_CONNS" default:"5"` MaxIdleConns int `envconfig:"DB_MAX_IDLE_CONNS" default:"5"`
} }
type GITEAConfig struct { type GITEAConfig struct {
BaseURL string `envconfig:"BASE_URL" required:"true"` BaseURL string `envconfig:"BASE_URL" required:"true"`
Token string `envconfig:"TOKEN"` Token string `envconfig:"TOKEN"`
@@ -52,13 +52,13 @@ type GITEAConfig struct {
WebhookPath string `envconfig:"WEBHOOK_PATH" default:"/webhooks/gitea"` WebhookPath string `envconfig:"WEBHOOK_PATH" default:"/webhooks/gitea"`
WebhookToken string `envconfig:"WEBHOOK_TOKEN"` WebhookToken string `envconfig:"WEBHOOK_TOKEN"`
WebhookTokenFile string `envconfig:"WEBHOOK_TOKEN_FILE"` WebhookTokenFile string `envconfig:"WEBHOOK_TOKEN_FILE"`
// Fetch hardening options // Fetch hardening options
EagerFilter bool `envconfig:"EAGER_FILTER" default:"true"` // Pre-filter by labels at API level EagerFilter bool `envconfig:"EAGER_FILTER" default:"true"` // Pre-filter by labels at API level
FullRescan bool `envconfig:"FULL_RESCAN" default:"false"` // Ignore since parameter for full rescan FullRescan bool `envconfig:"FULL_RESCAN" default:"false"` // Ignore since parameter for full rescan
DebugURLs bool `envconfig:"DEBUG_URLS" default:"false"` // Log exact URLs being used DebugURLs bool `envconfig:"DEBUG_URLS" default:"false"` // Log exact URLs being used
MaxRetries int `envconfig:"MAX_RETRIES" default:"3"` // Maximum retry attempts MaxRetries int `envconfig:"MAX_RETRIES" default:"3"` // Maximum retry attempts
RetryDelay time.Duration `envconfig:"RETRY_DELAY" default:"2s"` // Delay between retries RetryDelay time.Duration `envconfig:"RETRY_DELAY" default:"2s"` // Delay between retries
} }
type AuthConfig struct { type AuthConfig struct {
@@ -75,10 +75,10 @@ type LoggingConfig struct {
} }
type BackbeatConfig struct { type BackbeatConfig struct {
Enabled bool `envconfig:"ENABLED" default:"true"` Enabled bool `envconfig:"ENABLED" default:"true"`
ClusterID string `envconfig:"CLUSTER_ID" default:"chorus-production"` ClusterID string `envconfig:"CLUSTER_ID" default:"chorus-production"`
AgentID string `envconfig:"AGENT_ID" default:"whoosh"` AgentID string `envconfig:"AGENT_ID" default:"whoosh"`
NATSUrl string `envconfig:"NATS_URL" default:"nats://backbeat-nats:4222"` NATSUrl string `envconfig:"NATS_URL" default:"nats://backbeat-nats:4222"`
} }
type DockerConfig struct { type DockerConfig struct {
@@ -91,50 +91,60 @@ type N8NConfig struct {
} }
type OpenTelemetryConfig struct { type OpenTelemetryConfig struct {
Enabled bool `envconfig:"ENABLED" default:"true"` Enabled bool `envconfig:"ENABLED" default:"true"`
ServiceName string `envconfig:"SERVICE_NAME" default:"whoosh"` ServiceName string `envconfig:"SERVICE_NAME" default:"whoosh"`
ServiceVersion string `envconfig:"SERVICE_VERSION" default:"1.0.0"` ServiceVersion string `envconfig:"SERVICE_VERSION" default:"0.1.7"`
Environment string `envconfig:"ENVIRONMENT" default:"production"` Environment string `envconfig:"ENVIRONMENT" default:"production"`
JaegerEndpoint string `envconfig:"JAEGER_ENDPOINT" default:"http://localhost:14268/api/traces"` JaegerEndpoint string `envconfig:"JAEGER_ENDPOINT" default:"http://localhost:14268/api/traces"`
SampleRate float64 `envconfig:"SAMPLE_RATE" default:"1.0"` SampleRate float64 `envconfig:"SAMPLE_RATE" default:"1.0"`
} }
type ComposerConfig struct { type ComposerConfig struct {
// Feature flags for experimental features // Feature flags for experimental features
EnableLLMClassification bool `envconfig:"ENABLE_LLM_CLASSIFICATION" default:"false"` EnableLLMClassification bool `envconfig:"ENABLE_LLM_CLASSIFICATION" default:"false"`
EnableLLMSkillAnalysis bool `envconfig:"ENABLE_LLM_SKILL_ANALYSIS" default:"false"` EnableLLMSkillAnalysis bool `envconfig:"ENABLE_LLM_SKILL_ANALYSIS" default:"false"`
EnableLLMTeamMatching bool `envconfig:"ENABLE_LLM_TEAM_MATCHING" default:"false"` EnableLLMTeamMatching bool `envconfig:"ENABLE_LLM_TEAM_MATCHING" default:"false"`
// Analysis features // Analysis features
EnableComplexityAnalysis bool `envconfig:"ENABLE_COMPLEXITY_ANALYSIS" default:"true"` EnableComplexityAnalysis bool `envconfig:"ENABLE_COMPLEXITY_ANALYSIS" default:"true"`
EnableRiskAssessment bool `envconfig:"ENABLE_RISK_ASSESSMENT" default:"true"` EnableRiskAssessment bool `envconfig:"ENABLE_RISK_ASSESSMENT" default:"true"`
EnableAlternativeOptions bool `envconfig:"ENABLE_ALTERNATIVE_OPTIONS" default:"false"` EnableAlternativeOptions bool `envconfig:"ENABLE_ALTERNATIVE_OPTIONS" default:"false"`
// Debug and monitoring // Debug and monitoring
EnableAnalysisLogging bool `envconfig:"ENABLE_ANALYSIS_LOGGING" default:"true"` EnableAnalysisLogging bool `envconfig:"ENABLE_ANALYSIS_LOGGING" default:"true"`
EnablePerformanceMetrics bool `envconfig:"ENABLE_PERFORMANCE_METRICS" default:"true"` EnablePerformanceMetrics bool `envconfig:"ENABLE_PERFORMANCE_METRICS" default:"true"`
EnableFailsafeFallback bool `envconfig:"ENABLE_FAILSAFE_FALLBACK" default:"true"` EnableFailsafeFallback bool `envconfig:"ENABLE_FAILSAFE_FALLBACK" default:"true"`
// LLM model configuration // LLM model configuration
ClassificationModel string `envconfig:"CLASSIFICATION_MODEL" default:"llama3.1:8b"` ClassificationModel string `envconfig:"CLASSIFICATION_MODEL" default:"llama3.1:8b"`
SkillAnalysisModel string `envconfig:"SKILL_ANALYSIS_MODEL" default:"llama3.1:8b"` SkillAnalysisModel string `envconfig:"SKILL_ANALYSIS_MODEL" default:"llama3.1:8b"`
MatchingModel string `envconfig:"MATCHING_MODEL" default:"llama3.1:8b"` MatchingModel string `envconfig:"MATCHING_MODEL" default:"llama3.1:8b"`
// Performance settings // Performance settings
AnalysisTimeoutSecs int `envconfig:"ANALYSIS_TIMEOUT_SECS" default:"60"` AnalysisTimeoutSecs int `envconfig:"ANALYSIS_TIMEOUT_SECS" default:"60"`
SkillMatchThreshold float64 `envconfig:"SKILL_MATCH_THRESHOLD" default:"0.6"` SkillMatchThreshold float64 `envconfig:"SKILL_MATCH_THRESHOLD" default:"0.6"`
} }
type TaskAnnouncerConfig struct {
Enabled bool `envconfig:"ENABLED" default:"false"`
Interval time.Duration `envconfig:"INTERVAL" default:"2m"`
ListenAddresses []string `envconfig:"LISTEN_ADDRESSES" default:"/ip4/0.0.0.0/tcp/0"`
BootstrapPeers []string `envconfig:"BOOTSTRAP_PEERS"`
MonitorLabels []string `envconfig:"MONITOR_LABELS" default:"bzzz-task"`
ReannounceAfter time.Duration `envconfig:"REANNOUNCE_AFTER" default:"12h"`
NodeID string `envconfig:"NODE_ID" default:"whoosh-task-announcer"`
}
func readSecretFile(filePath string) (string, error) { func readSecretFile(filePath string) (string, error) {
if filePath == "" { if filePath == "" {
return "", nil return "", nil
} }
content, err := os.ReadFile(filePath) content, err := os.ReadFile(filePath)
if err != nil { if err != nil {
return "", fmt.Errorf("failed to read secret file %s: %w", filePath, err) return "", fmt.Errorf("failed to read secret file %s: %w", filePath, err)
} }
return strings.TrimSpace(string(content)), nil return strings.TrimSpace(string(content)), nil
} }
@@ -148,7 +158,6 @@ func (c *Config) loadSecrets() error {
c.Database.Password = password c.Database.Password = password
} }
// Load GITEA token from file if specified // Load GITEA token from file if specified
if c.GITEA.TokenFile != "" { if c.GITEA.TokenFile != "" {
token, err := readSecretFile(c.GITEA.TokenFile) token, err := readSecretFile(c.GITEA.TokenFile)
@@ -249,4 +258,4 @@ func (c *Config) Validate() error {
} }
return nil return nil
} }

View File

@@ -4,7 +4,7 @@ set -e
# WHOOSH Docker Swarm Deployment Script # WHOOSH Docker Swarm Deployment Script
# Following CHORUS deployment patterns with SHHH secret management # Following CHORUS deployment patterns with SHHH secret management
VERSION=${1:-v0.1.0-mvp} VERSION=${1:-v0.1.7}
REGISTRY_HOST=registry.home.deepblack.cloud REGISTRY_HOST=registry.home.deepblack.cloud
echo "🎭 WHOOSH Swarm Deployment - Version: $VERSION" echo "🎭 WHOOSH Swarm Deployment - Version: $VERSION"
@@ -76,4 +76,4 @@ echo " - Health: https://whoosh.chorus.services/health"
echo " - Ready: https://whoosh.chorus.services/health/ready" echo " - Ready: https://whoosh.chorus.services/health/ready"
echo "📝 Monitor logs with:" echo "📝 Monitor logs with:"
echo " docker service logs -f whoosh_whoosh" echo " docker service logs -f whoosh_whoosh"