diff --git a/engine/worker/internal/run.go b/engine/worker/internal/run.go index 577b1cbd69..2fe1b16b83 100644 --- a/engine/worker/internal/run.go +++ b/engine/worker/internal/run.go @@ -531,13 +531,8 @@ func (w *CurrentWorker) setupHooks(ctx context.Context, jobInfo sdk.WorkflowNode } } - for capa, hookConfig := range hook.Configuration.ByCapabilities { - // check is the capabilities exist on the current worker - if _, err := exec.LookPath(capa); err != nil { - // The error contains 'Executable file not found', the capa is not on the worker - continue - } - + for i := range hook.Configuration.ByCapabilities { + hookConfig := hook.Configuration.ByCapabilities[i] hookFilename := fmt.Sprintf("%d-%s-%s", hookConfig.Priority, integrationName, slug.Convert(hookConfig.Label)) w.hooks = append(w.hooks, workerHook{ @@ -548,14 +543,6 @@ func (w *CurrentWorker) setupHooks(ctx context.Context, jobInfo sdk.WorkflowNode } for _, h := range w.hooks { - infos := []sdk.SpawnInfo{{ - RemoteTime: time.Now(), - Message: sdk.SpawnMsg{ID: sdk.MsgSpawnInfoWorkerHookSetup.ID, Args: []interface{}{h.Config.Label}}, - }} - if err := w.Client().QueueJobSendSpawnInfo(ctx, strconv.FormatInt(w.currentJob.wJob.ID, 10), infos); err != nil { - return sdk.WrapError(err, "cannot record QueueJobSendSpawnInfo for job (err spawn): %d", w.currentJob.wJob.ID) - } - log.Info(ctx, "setting up hook at %q", h.SetupPath) hookFile, err := fs.Create(h.SetupPath) diff --git a/engine/worker/internal/runV2.go b/engine/worker/internal/runV2.go index b6ec9d73ac..4723bee9e4 100644 --- a/engine/worker/internal/runV2.go +++ b/engine/worker/internal/runV2.go @@ -1177,13 +1177,8 @@ func (w *CurrentWorker) setupHooksV2(ctx context.Context, currentJob CurrentJobV } } - for capa, hookConfig := range hook.Configuration.ByCapabilities { - // check is the capabilities exist on the current worker - if _, err := exec.LookPath(capa); err != nil { - // The error contains 'Executable file not found', the capa is not on the worker - continue - } - + for i := range hook.Configuration.ByCapabilities { + hookConfig := hook.Configuration.ByCapabilities[i] hookFilename := fmt.Sprintf("%d-%s-%s", hookConfig.Priority, integ.Name, slug.Convert(hookConfig.Label)) w.hooks = append(w.hooks, workerHook{ @@ -1195,16 +1190,6 @@ func (w *CurrentWorker) setupHooksV2(ctx context.Context, currentJob CurrentJobV } for _, h := range w.hooks { - info := sdk.V2SendJobRunInfo{ - Message: fmt.Sprintf("Setting up worker hook %q", h.Config.Label), - Level: sdk.WorkflowRunInfoLevelInfo, - Time: time.Now(), - } - - if err := w.ClientV2().V2QueuePushJobInfo(ctx, w.currentJobV2.runJob.Region, w.currentJobV2.runJob.ID, info); err != nil { - log.Error(ctx, "runJobServiceReadiness> Unable to send spawn info: %v", err) - } - log.Info(ctx, "setting up hook at %q", h.SetupPath) hookFile, err := fs.Create(h.SetupPath) diff --git a/sdk/messages.go b/sdk/messages.go index 4a28582d26..08d734960b 100644 --- a/sdk/messages.go +++ b/sdk/messages.go @@ -99,7 +99,6 @@ var ( MsgSpawnErrorHatcheryRetryAttempt = &Message{"MsgSpawnErrorHatcheryRetryAttempt", trad{EN: "Job execution failed by hatchery %s. Reason: %s"}, nil, RunInfoTypeError} MsgSpawnInfoDisableSecretInjection = &Message{"MsgSpawnInfoDisableSecretInjection", trad{EN: "⚠ Project's secrets were not automatically injected for this job because of a region prerequisite: %s"}, nil, RunInfoTypInfo} MsgSpawnInfoManualSecretInjection = &Message{"MsgSpawnInfoManualSecretInjection", trad{EN: "Prerequisites of type secret matched %s secret(s)"}, nil, RunInfoTypInfo} - MsgSpawnInfoWorkerHookSetup = &Message{"MsgSpawnInfoWorkerHookSetup", trad{EN: "Setting up worker hook %q"}, nil, RunInfoTypInfo} MsgSpawnInfoWorkerHookRun = &Message{"MsgSpawnInfoWorkerHookRun", trad{EN: "Running worker hook %q"}, nil, RunInfoTypInfo} MsgSpawnInfoWorkerHookRunTeardown = &Message{"MsgSpawnInfoWorkerHookRunTeardown", trad{EN: "Running worker hook %q teardown"}, nil, RunInfoTypInfo} MsgSpawnInfoWorkerDisabledByHatchery = &Message{"MsgSpawnInfoWorkerDisabledByHatchery", trad{EN: "The worker (not responding) %s was disabled by hatchery"}, nil, RunInfoTypeWarning} @@ -188,7 +187,6 @@ var Messages = map[string]*Message{ MsgSpawnErrorHatcheryRetryAttempt.ID: MsgSpawnErrorHatcheryRetryAttempt, MsgSpawnInfoDisableSecretInjection.ID: MsgSpawnInfoDisableSecretInjection, MsgSpawnInfoManualSecretInjection.ID: MsgSpawnInfoManualSecretInjection, - MsgSpawnInfoWorkerHookSetup.ID: MsgSpawnInfoWorkerHookSetup, MsgSpawnInfoWorkerHookRun.ID: MsgSpawnInfoWorkerHookRun, MsgSpawnInfoWorkerHookRunTeardown.ID: MsgSpawnInfoWorkerHookRunTeardown, MsgSpawnInfoWorkerDisabledByHatchery.ID: MsgSpawnInfoWorkerDisabledByHatchery,