Repository navigation
feat: support private executor images - #141
pavelnikonorov merged 6 commits into
Conversation
Reviewer's GuideData structuresAdd executor registry fields and validation, keeping login and password write-only and out of diagnostic strings.
APIIntroduce Secret conversion and configure private-image executor Jobs to reference their per-executor pull Secret.
Add Kubernetes wrapper operations for dry-run validation and creation of image-pull Secrets, with safe error reporting.
Uses of the APIValidate owned pull Secrets before job creation, then create them before the ConfigMap and clean up the job if resource creation fails.
ImplementationExclude Secret creation from the generic tracing advice to avoid logging credential-bearing request data.
DocumentationDocument the experimental request fields, credential handling, lifecycle, troubleshooting, and deployment permissions.
TestsVerify the end-to-end request creates pull Secrets without leaking credentials and exposes only the intended API fields.
Test Secret conversion, credential redaction, generated executor pull references, and preservation of template pull Secrets.
Cover Kubernetes Secret dry-run and creation behaviour, including safe errors when Kubernetes rejects credentials.
Check API validation for incomplete or unsafe credentials and acceptance of a valid private-image request.
Test credential-aware equality and validation, including password omission from diagnostics.
Verify Secret ownership, creation ordering, preflight rejection, and job cleanup on Secret creation failure.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #141 +/- ##
==========================================
+ Coverage 66.91% 68.48% +1.57%
==========================================
Files 67 67
Lines 2699 2780 +81
Branches 288 300 +12
==========================================
+ Hits 1806 1904 +98
+ Misses 746 730 -16
+ Partials 147 146 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Accept registry credentials on TES executors, create owned Docker config Secrets, and reference them from executor imagePullSecrets. Keep credentials out of task annotations, ConfigMaps, API responses, and trace logging. Refs elixir-cloud-aai#55
6f924a3 to
a4df13b
Compare
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/test/java/uk/ac/ebi/tsc/tesk/k8s/convert/TesKubernetesConverterMinimalTest.java" line_range="266" />
<code_context>
+ String annotation = taskmaster.getMetadata().getAnnotations().get("json-input");
+ org.assertj.core.api.Assertions.assertThat(annotation)
+ .contains("registry.example.org")
+ .doesNotContain("robot", "secret-password", "docker_login", "docker_pass");
+ org.assertj.core.api.Assertions.assertThat(privateExecutor.toString())
+ .doesNotContain("robot", "secret-password");
</code_context>
<issue_to_address>
**Encoded credentials evade checks**
When the annotation or ConfigMap serializes credentials in Base64 rather than plaintext, `privateExecutorImageUsesOwnedSecretWithoutExposingCredentials` checks only for the plaintext values `robot` and `secret-password` in the annotation and ConfigMap. If either output leaks those credentials in Base64, both assertions pass and the test misses the exposure.
Check that the outputs contain no credential values in either plaintext or encoded form.
Also at `src/test/java/uk/ac/ebi/tsc/tesk/k8s/convert/TesKubernetesConverterMinimalTest.java:280`.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 1 finding to address first, and the API creates Kubernetes Secrets containing registry credentials and configures executor pods to use them. If those credentials are exposed or used beyond the intended scope, reverting the change will not undo access already granted or remove Secrets from existing jobs; they remain until the jobs are deleted.
Blocking findings: src/test/java/uk/ac/ebi/tsc/tesk/k8s/convert/TesKubernetesConverterMinimalTest.java:266
|
We can merge this, given that the contributor relies on it for a PoC. However, we need to clearly document that this is a draft solution, or to be more precise, a workaround, to pass secrets while a more generic solution for passing secrets is still undecided in the TES specification (e.g., passing IDs to secrets stored in a secret store). As such, this should be marked as experimental with a note that clients should not rely on this workaround for production, as it will be immediately deprecated once guidance from GA4GH for this problem becomes available, and then removed once it is becoming implemented across the TES implementation ecosystem. |
Linked issuesChecked at commit af213dc #148 feature request: support for private docker images in task executors · 3 of 4 met · 1 to check by hand
#55 feature request: support for private docker images in task executors · 3 of 4 met · 1 to check by hand
|
Summary
278cb9b) to the currentdevbranch, keeping itsdocker_registry,docker_login, anddocker_passexecutor fields.kubernetes.io/dockerconfigjsonSecret for each private-image executor, owned by the taskmaster Job, and reference it throughimagePullSecrets.Closes #55.
Closes elixir-cloud-aai/TESK#148.
Related: ga4gh/task-execution-schemas#167.
Verification
test-compileandcheckstyle:checkon Java 21spotless:checkand fullsurefire:teston Java 8: 11,923 tests passedLive Kubernetes pull test against a temporary private registry requiring Basic Auth: without an image-pull Secret the Pod failed with
ErrImagePull/no basic auth credentials; with the Secret created by TESK API, the API-generated executor Job pulled the image (imagePullPolicy: Always) and its Pod became Ready.Deleting the taskmaster Job garbage-collected its generated Secret and ConfigMap. The executor Job was submitted manually because the taskmaster image is
amd64only and the local test cluster wasarm64; taskmaster orchestration was not exercised.Summary by Sourcery
Add experimental support for pulling executor images from private registries while protecting supplied credentials throughout task processing.
New Features:
Bug Fixes:
Enhancements:
Deployment:
Documentation:
Tests: