feat(computing-unit): curate computing-unit images - #8475
feat(computing-unit): curate computing-unit images#8475tanishqgandhi1908 wants to merge 1 commit into
Conversation
b3bbc25 to
b5e9441
Compare
Automated Reviewer SuggestionsBased on the
|
An administrator registers an image reference from a public registry, and a computing unit can then be started from it. Off by default until the UI to manage these ships. Texera reads the image's manifest and config blob -- a few kilobytes, never the layers -- to check its start command runs computing-unit-master, which means it was built FROM the Texera computing-unit image, and to resolve the digest behind the reference. A misspelled, private or unsuitable image is refused in seconds, in front of the administrator, rather than when a user's unit will not start. The row records owner/name@sha256:..., and that is what units run, so a tag its owner moves later cannot change what already ran. Nothing is copied and no registry is added: units pull the reference the same way the deployment's own image is already pulled. Uniqueness is enforced by the database, not only checked in the service. Two administrators registering the same link at the same moment both pass a read-then-write check and produce two rows for one image. A curated image was supplied by an administrator and reviewed by nobody, so a unit started from one runs as a non-root user with no privilege escalation and no capabilities. Curated images only -- the deployment's own image is its operator's choice, and one that has replaced it with an image needing root would break on upgrade. The first unit on each node waits for the image to download, about 80 seconds for a 3 GB one, while later units there start at once. Pre-pulling ready images onto nodes is a follow-up.
b5e9441 to
ab19e2f
Compare
|
/request-review @aicam |
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (29.57%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #8475 +/- ##
============================================
- Coverage 93.94% 93.42% -0.52%
- Complexity 4827 4828 +1
============================================
Files 1209 1212 +3
Lines 49705 50101 +396
Branches 6074 6123 +49
============================================
+ Hits 46695 46809 +114
- Misses 1522 1794 +272
- Partials 1488 1498 +10
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
✅ No material benchmark regressions detected🟢 2 better · 🔴 0 worse · ⚪ 13 noise (<±5%) · 0 without baseline
Baseline detailsLatest main
Raw CSVconfig_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,531.44,200,128000,376,0.230,24895.41,32767.21,32767.21
1,100,10,64,20,2516.86,2000,1280000,795,0.485,124332.35,138746.40,138746.40
2,1000,10,64,20,21986.29,20000,12800000,910,0.555,1095797.00,1184093.07,1184093.07 |
What changes were proposed in this PR?
Every computing unit runs the same image, fixed when the cluster is installed. ML Models needing a different Python version, a system package, or a library built from source cannot run, because a Python virtual environment only holds pip packages.
This lets an administrator register an image reference from a public registry, and a computing unit can then be started from it. Off by default (
curatedImages.enabled: false) until the UI to manage these ships in #8470 and #8471.How it works. Texera reads the image's manifest and config blob — a few kilobytes, never the layers — to check its start command runs
computing-unit-master, which means it was builtFROMthe Texera computing-unit image, and to resolve the digest behind the reference. A misspelled, private or unsuitable image is refused in seconds, in front of the administrator, rather than when a user's unit will not start.The row records
owner/name@sha256:…, and that is what units run, so a tag its owner moves later cannot change what already ran. Nothing is copied and no registry is added — units pull the reference the same way the deployment's own image is already pulled.Uniqueness is enforced by the database, not only checked in the service: two administrators registering the same link at the same moment both pass a read-then-write check and produce two rows for one image.
Non-root, for curated images only. A curated image was supplied by an administrator and reviewed by nobody, so a unit started from one runs as a non-root user with no privilege escalation and no capabilities. The deployment's own image is untouched — it is its operator's choice, and a deployment that has replaced it with an image needing root would break on upgrade.
Known limitation. The first unit on each node waits for the image to download — about 80 seconds for a 3 GB one — while later units on that node start at once. Pre-pulling ready images onto nodes is #8469.
Any related issues, documentation, discussions?
Closes #8468
Part of #8466
How was this PR tested?
Unit tests, chart rendering, and a deployment to minikube exercising both states.
CuratedImageResourceSpec 27 passed
KubernetesClientSpec 17 passed
KubernetesConfigSpec 6 passed
scalafmtCheckAll clean
helm templaterenders with the feature off and on; the manager Role gainsjobsandpods/logonly.Deployed to minikube, feature off:
Feature on:
register a good image READY in 8s, pinned to @sha256:bdeadc3c...
duplicate reference 400 names the existing row
duplicate name 400
empty name 400
tag that does not exist FAILED, log names the tag and what to do instead
alpine (not a CU image) FAILED, "Its start command is: [/bin/sh]"
unit from a curated image
image tagandhi19/texera-cu-sklearn@sha256:bdeadc3c...
security {allowPrivilegeEscalation:false, capabilities:{drop:[ALL]}, runAsNonRoot:true, runAsUser:1001}
id uid=1001(texera)
delete the image while a unit runs on it
204, pod stays Running, unit still reports imageName 'Python ML'
a new unit from it 403
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5)