diff --git a/helm-chart/templates/deployment.yaml b/helm-chart/templates/deployment.yaml index b79480c..15fa1e7 100644 --- a/helm-chart/templates/deployment.yaml +++ b/helm-chart/templates/deployment.yaml @@ -51,7 +51,7 @@ spec: value: "{{ .Values.tests.caCertFile }}" - name: TLS_CLIENT_CERT_FILE value: "{{ .Values.tests.clientCertFile }}" - - name: TLS_CLIENT_CERT_PRIVATE_KEY_File + - name: TLS_CLIENT_CERT_PRIVATE_KEY_FILE value: "{{ .Values.tests.clientCertPrivateKeyFile }}" - name: TLS_CA_CERT_DATA value: "{{ .Values.tests.caCertData }}" diff --git a/worker/bench/driver_activity.go b/worker/bench/driver_activity.go index 81e682f..028f5b0 100644 --- a/worker/bench/driver_activity.go +++ b/worker/bench/driver_activity.go @@ -25,12 +25,13 @@ package bench import ( "context" "fmt" + "time" + "github.com/pkg/errors" "go.temporal.io/sdk/activity" "go.temporal.io/sdk/client" "go.temporal.io/sdk/log" "golang.org/x/time/rate" - "time" ) func (a *Activities) DriverActivity(ctx context.Context, request benchDriverActivityRequest) error { @@ -71,7 +72,7 @@ func (d *benchDriver) run() error { var completedIdx int if err := activity.GetHeartbeatDetails(d.ctx, &completedIdx); err == nil { idx = completedIdx + 1 - d.logger.Info("resuming from failed attempt", "ReportedProgress", completedIdx) + d.logger.Warn("resuming from failed attempt", "ReportedProgress", completedIdx) } } @@ -110,7 +111,7 @@ func (d *benchDriver) run() error { } func (d *benchDriver) execute(iterationID int) error { - d.logger.Info("driver.execute starting", "workflowName", d.request.WorkflowName, "basedID", d.request.BaseID, "iterationID", iterationID) + d.logger.Debug("driver.execute starting", "workflowName", d.request.WorkflowName, "basedID", d.request.BaseID, "iterationID", iterationID) workflowID := fmt.Sprintf("%s-%s-%d", d.request.WorkflowName, d.request.BaseID, iterationID) startOptions := client.StartWorkflowOptions{ ID: workflowID, diff --git a/worker/bench/monitor_activity.go b/worker/bench/monitor_activity.go index cf7d1e2..2ed4a22 100644 --- a/worker/bench/monitor_activity.go +++ b/worker/bench/monitor_activity.go @@ -25,13 +25,14 @@ package bench import ( "context" "fmt" + "strings" + "time" + "go.temporal.io/api/filter/v1" "go.temporal.io/api/workflowservice/v1" "go.temporal.io/sdk/activity" "go.temporal.io/sdk/client" "go.temporal.io/sdk/log" - "strings" - "time" ) func (a *Activities) MonitorActivity(ctx context.Context, request benchMonitorActivityRequest) ([]histogramValue, error) { @@ -132,7 +133,7 @@ func (m *benchMonitor) validateScenarioCompletion(deadline time.Time) ([]workflo } func (m *benchMonitor) isComplete() (bool, error) { - m.logger.Info("IsComplete? enter") + m.logger.Debug("IsComplete? enter") filterStartTime := m.request.StartTime.Add(-10 * time.Second) ws, err := m.client.ListOpenWorkflow(m.ctx, &workflowservice.ListOpenWorkflowExecutionsRequest{ MaximumPageSize: 1, @@ -146,11 +147,11 @@ func (m *benchMonitor) isComplete() (bool, error) { }, }) if err != nil { - m.logger.Info("IsComplete? exit", "error", err) + m.logger.Debug("IsComplete? exit", "error", err) return false, err } done := len(ws.Executions) == 0 - m.logger.Info(fmt.Sprintf("IsComplete? %t", done)) + m.logger.Debug(fmt.Sprintf("IsComplete? %t", done)) return done, nil } diff --git a/worker/cmd/main.go b/worker/cmd/main.go index 3dde865..6f7917a 100644 --- a/worker/cmd/main.go +++ b/worker/cmd/main.go @@ -54,7 +54,7 @@ import ( ) func main() { - logger, err := zap.NewDevelopment() + logger, err := zap.NewProduction() if err != nil { panic(err) } @@ -295,6 +295,7 @@ func getTLSConfig(hostPort string, logger *zap.Logger) (*tls.Config, error) { clientCertFile := getEnvOrDefaultString(logger, "TLS_CLIENT_CERT_FILE", "") clientCertPrivateKeyFile := getEnvOrDefaultString(logger, "TLS_CLIENT_CERT_PRIVATE_KEY_FILE", "") enableHostVerification := getEnvOrDefaultBool(logger, "TLS_ENABLE_HOST_VERIFICATION", false) + serverName := getEnvOrDefaultString(logger, "TLS_SERVER_NAME", host) caBytes, err := getTLSBytes(caCertFile, caCertData) if err != nil { @@ -333,7 +334,7 @@ func getTLSConfig(hostPort string, logger *zap.Logger) (*tls.Config, error) { if caPool != nil || cert != nil { tlsConfig := &tls.Config{ InsecureSkipVerify: !enableHostVerification, - ServerName: host, + ServerName: serverName, } if caPool != nil { tlsConfig.RootCAs = caPool diff --git a/worker/target/basic/activity.go b/worker/target/basic/activity.go index 424269c..9d54114 100644 --- a/worker/target/basic/activity.go +++ b/worker/target/basic/activity.go @@ -25,7 +25,7 @@ package basic import ( "context" "time" - + "go.temporal.io/sdk/activity" ) @@ -38,10 +38,10 @@ type basicActivityRequest struct { // Activity is the implementation for Basic Workflow func Activity(ctx context.Context, req basicActivityRequest) (string, error) { logger := activity.GetLogger(ctx) - logger.Info("Activity: start", "Duration, ms", req.ActivityDelayMilliseconds) + logger.Debug("Activity: start", "Duration, ms", req.ActivityDelayMilliseconds) if req.ActivityDelayMilliseconds > 0 { time.Sleep(time.Duration(req.ActivityDelayMilliseconds) * time.Millisecond) } - logger.Info("Activity: end") + logger.Debug("Activity: end") return req.ResultPayload, nil } diff --git a/worker/target/basic/workflow.go b/worker/target/basic/workflow.go index 7ba4836..e0f73ed 100644 --- a/worker/target/basic/workflow.go +++ b/worker/target/basic/workflow.go @@ -44,11 +44,11 @@ func Workflow(ctx workflow.Context, request workflowRequest) (string, error) { logger := workflow.GetLogger(ctx) - logger.Info("basic workflow started", "activity task queue", taskQueue) + logger.Debug("basic workflow started", "activity task queue", taskQueue) ao := workflow.ActivityOptions{ TaskQueue: taskQueue, - StartToCloseTimeout: time.Duration(request.ActivityDurationMilliseconds)*time.Millisecond + 10 * time.Minute, + StartToCloseTimeout: time.Duration(request.ActivityDurationMilliseconds)*time.Millisecond + 10*time.Minute, } ctx = workflow.WithActivityOptions(ctx, ao) @@ -79,9 +79,9 @@ func Workflow(ctx workflow.Context, request workflowRequest) (string, error) { allResults[i] = result } - logger.Info("activity returned result to the workflow", "value", allResults) + logger.Debug("activity returned result to the workflow", "value", allResults) } - logger.Info("basic workflow completed") + logger.Debug("basic workflow completed") return request.ResultPayload, nil }