Skip to content

feat: support private executor images - #141

Merged
pavelnikonorov merged 6 commits into
elixir-cloud-aai:devfrom
genxnetwork:issue-55-private-executor-images
Nov 10, 2026
Merged

pavelnikonorov merged 6 commits into
elixir-cloud-aai:devfrom
genxnetwork:issue-55-private-executor-images

Conversation

@pavelnikonorov

@pavelnikonorov pavelnikonorov commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Experimental proof-of-concept workaround. The TESK-specific registry
credential fields are not for production clients. This workaround will be
deprecated as soon as GA4GH provides guidance for passing secrets and
removed once a common replacement is implemented across TES implementations.

  • Port the GENXT draft (278cb9b) to the current dev branch, keeping its docker_registry, docker_login, and docker_pass executor fields.
  • Create a kubernetes.io/dockerconfigjson Secret for each private-image executor, owned by the taskmaster Job, and reference it through imagePullSecrets.
  • Validate complete credentials, keep login and password out of task annotations, ConfigMaps, API responses, and trace logs, and delete the taskmaster Job if Secret creation fails.
  • Document the request format and Kubernetes permissions.

Closes #55.
Closes elixir-cloud-aai/TESK#148.
Related: ga4gh/task-execution-schemas#167.

Verification

  • test-compile and checkstyle:check on Java 21

  • spotless:check and full surefire:test on Java 8: 11,923 tests passed

  • Live 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 amd64 only and the local test cluster was arm64; 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:

  • Support private executor images through registry credentials supplied when creating a task.
  • Create per-executor Kubernetes image-pull Secrets and attach them to the corresponding executor Jobs.

Bug Fixes:

  • Prevent registry credentials from being exposed in task responses, task annotations, ConfigMaps, diagnostics, and trace logs.
  • Clean up the taskmaster Job when image-pull Secret creation fails.

Enhancements:

  • Validate that private-image registry credentials are complete and that registry addresses do not contain embedded credentials or whitespace.
  • Manage generated image-pull Secrets with taskmaster Job ownership and perform admission dry-run checks before task creation.

Deployment:

  • Document the Kubernetes Secret permissions required for private executor images.

Documentation:

  • Document the experimental private-image request fields, credential handling, lifecycle, security considerations, and failure diagnosis.

Tests:

  • Add unit and integration coverage for credential validation, Secret generation, ownership, executor image-pull configuration, failure cleanup, and credential redaction.

@sourcery-ai

sourcery-ai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Data structures

Add executor registry fields and validation, keeping login and password write-only and out of diagnostic strings.

  • src/main/java/uk/ac/ebi/tsc/tesk/tes/model/TesExecutor.java L27-35, L77-137 (+4 small edits)

API

Introduce Secret conversion and configure private-image executor Jobs to reference their per-executor pull Secret.

  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/convert/TesKubernetesConverter.java L14, L201-234, L271-277

Add Kubernetes wrapper operations for dry-run validation and creation of image-pull Secrets, with safe error reporting.

  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/exception/KubernetesException.java L21-27, L33-37
  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/service/KubernetesClientWrapper.java L18, L129-151

Uses of the API

Validate owned pull Secrets before job creation, then create them before the ConfigMap and clean up the job if resource creation fails.

  • src/main/java/uk/ac/ebi/tsc/tesk/tes/service/TesServiceImpl.java L80-93, L109-126, L131-137 (+3 small edits)

Implementation

Exclude Secret creation from the generic tracing advice to avoid logging credential-bearing request data.

  • src/main/java/uk/ac/ebi/tsc/tesk/config/TraceInterceptorConfiguration.java L35-36

Documentation

Document the experimental request fields, credential handling, lifecycle, troubleshooting, and deployment permissions.

  • docs/api.md L72-123
  • docs/deployment.md L56-62
  • docs/development.md L221-225
  • docs/index.md L43-45, L67-78, L175-178

Tests

Verify the end-to-end request creates pull Secrets without leaking credentials and exposes only the intended API fields.

  • src/integration-test/java/uk/ac/ebi/tsc/tesk/NoAuthIT.java L14-23, L124-208 (+2 small edits)

Test Secret conversion, credential redaction, generated executor pull references, and preservation of template pull Secrets.

  • src/test/java/uk/ac/ebi/tsc/tesk/k8s/convert/TesKubernetesConverterMinimalTest.java L23-30, L247-370 (+2 small edits)

Cover Kubernetes Secret dry-run and creation behaviour, including safe errors when Kubernetes rejects credentials.

  • src/test/java/uk/ac/ebi/tsc/tesk/k8s/service/KubernetesClientWrapperTest.java L141-195

Check API validation for incomplete or unsafe credentials and acceptance of a valid private-image request.

  • src/test/java/uk/ac/ebi/tsc/tesk/tes/api/TasksApiControllerTest.java L51, L112-200

Test credential-aware equality and validation, including password omission from diagnostics.

  • src/test/java/uk/ac/ebi/tsc/tesk/tes/model/TesExecutorTest.java L1-54

Verify Secret ownership, creation ordering, preflight rejection, and job cleanup on Secret creation failure.

  • src/test/java/uk/ac/ebi/tsc/tesk/tes/service/TesServiceImplCreateTest.java L21-23, L55-56, L99-147

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.48%. Comparing base (7150d95) to head (af213dc).
⚠️ Report is 1 commits behind head on dev.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pavelnikonorov pavelnikonorov changed the title Support private executor images with Kubernetes pull Secrets feat: support private executor images Nov 10, 2026
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
@pavelnikonorov
pavelnikonorov force-pushed the issue-55-private-executor-images branch from 6f924a3 to a4df13b Compare November 10, 2026 13:21
@pavelnikonorov
pavelnikonorov marked this pull request as ready for review November 10, 2026 13:22

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@uniqueg

uniqueg commented Nov 10, 2026

Copy link
Copy Markdown
Member

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.

@pavelnikonorov pavelnikonorov self-assigned this Nov 10, 2026
@sourcery-ai

sourcery-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Linked issues

Checked at commit af213dc

#148 feature request: support for private docker images in task executors · 3 of 4 met · 1 to check by hand

# Requirement Status Notes
1 Extend task definitions with Docker registry credentials ✅ Met TesExecutor accepts docker_registry, docker_login, and docker_pass on task creation.
2 Use Kubernetes Secrets to store Docker credentials ✅ Met The converter creates a dockerconfigjson Secret for each executor with credentials, owned by the taskmaster Job.
3 Use imagePullSecrets for private executor images ✅ Met The generated Secret is referenced by the corresponding executor Job.
4 Create a special development/testing branch 👀 Check by hand (external system) Verify in the repository host that this PR is on the requested dedicated development/testing branch; branch metadata is not present in the diff.

#55 feature request: support for private docker images in task executors · 3 of 4 met · 1 to check by hand

# Requirement Status Notes
1 Extend task definitions with Docker registry credentials ✅ Met TesExecutor accepts docker_registry, docker_login, and docker_pass on task creation.
2 Use Kubernetes Secrets to store Docker credentials ✅ Met The converter creates a dockerconfigjson Secret for each executor with credentials, owned by the taskmaster Job.
3 Use imagePullSecrets for private executor images ✅ Met The generated Secret is referenced by the corresponding executor Job.
4 Create a special development/testing branch 👀 Check by hand (external system) Verify in the repository host that this PR is on the requested dedicated development/testing branch; branch metadata is not present in the diff.

@pavelnikonorov
pavelnikonorov merged commit 2921fe9 into elixir-cloud-aai:dev Nov 10, 2026
34 of 39 checks passed
@pavelnikonorov
pavelnikonorov deleted the issue-55-private-executor-images branch November 10, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature request: support for private docker images in task executors feature request: support for private docker images in task executors

2 participants