fix(scheduled-task): run the image as the k8s scope with the overlay and ship aws-cli - #247
Merged
Merged
Conversation
…and ship aws-cli The image baked NP_SERVICE_PATH=/app/pkg/scheduled_task with no NP_OVERRIDES_PATH, so the worker ran the overlay's partial workflows (two skipped steps) as the whole scope. Point the base at k8s and pass the overlay as NP_OVERRIDES_PATH, like the legacy channel and containers-datadog do. Add aws-cli: the k8s scripts call it from the assume_role step onwards.
sebasnallar
approved these changes
Sep 7, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Qué pasa hoy
La imagen
public.ecr.aws/nullplatform/scopes/scheduled-task:v1.16.1no funciona como worker en una instalación AWS. La probamos en un cluster real, pineada en el agent conpackage-exec, y elcreate-scopefalla en el primer paso.Dos causas, las dos en
docker/scheduled-task.Dockerfile:1. Los env apuntan al overlay como si fuera el scope. La imagen hornea
NP_SERVICE_PATH=/app/pkg/scheduled_tasky no defineNP_OVERRIDES_PATH. Pero el scheduled task no es un scope completo: es el scopek8sejecutado con el overlayscheduled_task. Así lo declara el propio repo enscheduled_task/specs/notification-channel.json.tpl:Los workflows de
scheduled_task/scope/workflows/son parciales (networking: skip,validate alb capacity: skip, y listo) yscheduled_task/values.yamlreferencia$OVERRIDES_PATH/deployment/templates/.... Con el env de la imagen tal cual, elworker-bridgeinvoca el entrypoint con--service-path=/app/pkg/scheduled_tasky sin--overrides-path: elcreate-scopecorre solo esos pasos en skip y el scope no crea nada.containers-datadog.Dockerfileen este mismo repo ya hace lo correcto: heredaNP_SERVICE_PATH=/app/pkg/k8sy agrega soloNP_OVERRIDES_PATH=/app/pkg/datadog.2. Falta
aws-cli. La imagen instalagomplateykubectl, nada más. Los scripts del scopek8ssobre los que corre el overlay llaman aawsen 17 archivos, empezando porutils/assume_role. En AWS el primer paso de cualquier acción falla con:Lo reprodujimos corrigiendo los env por patch en el agent: el overlay se aplicó bien (
--workflow /app/pkg/k8s/scope/workflows/create.yaml --overrides /app/pkg/scheduled_task/scope/workflows/create.yaml) y falló justo ahí, concommand -v awsvacío dentro del pod.Qué cambia
NP_SERVICE_PATH=/app/pkg/k8syNP_OVERRIDES_PATH=/app/pkg/scheduled_task, mismo patrón quecontainers-datadog.apk add aws-cli, igual quecontainers.Dockerfile. No agregotofu,helmniyq: los scripts dek8syscheduled_taskno los usan, así que la imagen sigue siendo más liviana que la de containers, que era la idea.Cómo lo verificamos
Mientras no salga esta corrección, en nuestra instalación el scheduled task corre con la imagen de containers y
NP_OVERRIDES_PATH=/app/pkg/scheduled_taskpor env, que es exactamente lo que esta imagen debería traer horneado. Con eso el create y el delete del scope funcionan de punta a punta.