Repository navigation
examples(airflow): fix SonarCloud alerts in airflow-k8s-pipeline manifests and Dockerfiles - #52
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
…ockerfiles - Disable service-account token automount on listener, MinIO, RabbitMQ and seed pods - Add seed job resource limits and MinIO ephemeral-storage limit (+ emptyDir sizeLimit) - Run listener and tig-worker images as uid 1000 - Restrict the AWS CLI download to HTTPS/TLS1.2 - Install listener deps from a hash-locked requirements.txt, wheels only - Give the RabbitMQ readiness probe a 5s timeout (CLI exceeds the 1s default) Co-Authored-By: jason.han <hanhuijun@gmail.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
… fit Co-Authored-By: jason.han <hanhuijun@gmail.com>
There was a problem hiding this comment.
Devin Review found 1 finding. Devin automatically fixed it.
Fixed by Devin (1)
- Repeated runs erase the demo bucket — Raised the MinIO ephemeral-storage limit and emptyDir sizeLimit from 4Gi to 10Gi (about 38 runs, half of minikube's default 20 GB disk). A limit is still needed for S6870, and the data in an emptyDir is already lost on any pod restart.
Project Requirements: PASSPR #52 hardens the examples/airflow-k8s-pipeline example: hash-locked listener deps (requirements.in/.txt, --require-hashes --only-binary), non-root listener and worker images (uid 1000), automountServiceAccountToken: false on all pods, a longer RabbitMQ probe timeout, resource requests/limits on the seed job, and a 10Gi ephemeral-storage limit/emptyDir sizeLimit on MinIO. All changes stay inside examples/. Documentation parity: concern, because the README file tree lists the new requirements files but does not mention the new MinIO 10Gi storage cap, the disk this assumes, or the eviction/data-loss behavior when the cap is exceeded. Broad deployability: pass, since nothing is site-specific and the core CLI and image are untouched. Test coverage: pass, since this is example-only hardening covered by the documented manual end-to-end procedure (README steps plus .agents/skills/testing-airflow-k8s-pipeline). No blocking failures.
1. Documentation parity
Evaluated at Criteria: |
Summary
This PR fixes the 11 SonarCloud code-scanning alerts on
examples/airflow-k8s-pipeline/k8s/**(scan ofdevelopat ca85348). Every alert gets a real fix; nothing is suppressed and none needs dismissing.automountServiceAccountToken: falseon the pod specresourcesadded: requests 64Mi/50m, limits 128Mi/200mephemeral-storagerequest 1Gi, limit 10Gi, plusemptyDir.sizeLimit: 10Gion/data. A run leaves about 258 MiB, so the limit holds about 38 runs and uses half of minikube's default 20 GB diskcurl --proto '=https' --tlsv1.2for the AWS CLI bundleUSER rootis now only used for the install step. The image thenuseraddstigand ends withUSER 1000:1000. The wrappers only write under/tmp/workand the calibration mount is read-only, so VICAR runs fine as non-rootlisteneruser and ends withUSER 1000:1000requirements.in(pika,requests) plus arequirements.txtlocked withpip-compile --generate-hasheson Python 3.11; installed with--require-hashespip install --only-binary :all:(every locked dependency has a cp311 or py3 wheel)Two other changes:
timeoutSeconds: 5. Under the 500m CPU limit,rabbitmq-diagnostics check_port_connectivitytakes about 1.3 s, longer than the 1 s default. Unmodifieddevelopnever became Ready on minikube either (tested), so this fix is needed to deploy at all.Verification (minikube, 4 CPU, README steps 1–12)
idinside them gives uid 1000 (listenerandtig),aws --versionworks in the worker, andpika1.4.4 andrequests2.34.2 import./var/run/secrets/kubernetes.io/serviceaccountis absent, andspec.automountServiceAccountToken=falseon all four pods.ids_terrain_ncam..obj,.iv,.mtl,.png,.lblfor each eye) are underoutput/sol/01835/ids/rdr/ncam/.Heads-up (not changed here, out of scope)
The pinned images
minio/minio:RELEASE.2024-12-18T13-15-44Zandminio/mc:RELEASE.2024-11-21T17-21-54Zcan no longer be pulled. Docker Hub says "repository does not exist", quay.io returns 401, and dl.min.io binaries return 410. To run the test above, I tagged Chainguardminio/minio-client(mc on a busybox base) under those names and loaded them into minikube. That test-only workaround is not committed. On a clean machine the example will not deploy until those images are replaced, which should be its own PR.Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/3946939957d5462eaa81505e727ac747
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/3946939957d5462eaa81505e727ac747?variant=devin
Requested by: @HuiJun
🟢 Devin fixed the finding · Follow Devin's work