Skip to content

ci: build the desktop template on every cluster (foxtrot, juliett, tango) - #260

Closed
devin-ai-integration[bot] wants to merge 5 commits into
mainfrom
devin/1788791818-build-templates-all-clusters
Closed

devin-ai-integration[bot] wants to merge 5 commits into
mainfrom
devin/1788791818-build-templates-all-clusters

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The desktop template is now built on every production cluster — foxtrot, juliett and tango — instead of foxtrot only. Clusters are separate tenancies with separate template registries, so a template built on one does not exist on the others.

template.yml splits into the DockerHub image job (unchanged, push-only) and a buildTemplate matrix job, one leg per cluster. The matrix holds {cluster, domain}; the API key is selected in the build step with static secret references, so the runner only receives these three keys (a dynamic secrets[...] index would hand the job every org and repo secret):

matrix:
  include:
    - { cluster: foxtrot, domain: e2b.dev }
    - { cluster: juliett, domain: e2b-juliett.dev }
    - { cluster: tango,   domain: e2b-tango.dev }
# build step only
E2B_API_KEY: ${{ (matrix.cluster == 'foxtrot' && secrets.E2B_API_KEY) || (matrix.cluster == 'juliett' && secrets.E2B_JULIETT_API_KEY) || (matrix.cluster == 'tango' && secrets.E2B_TANGO_API_KEY) || '' }}

E2B_JULIETT_API_KEY and E2B_TANGO_API_KEY are new repo secrets and must be added before merging. A missing key fails that leg with Missing API key secret for cluster: <cluster>; fail-fast: false so the other clusters still build.

Also adds a bare workflow_dispatch so the template can be rebuilt on all clusters without a template change (the Docker image only rebuilds on push). Legs on the same cluster serialize via Template-${{ github.ref }}-<cluster>; different clusters run in parallel. Both jobs use the uv setup from main.

Merging this PR triggers the workflow (its path filter includes the workflow file), which will do the first juliett/tango builds.

Companion PR for the code-interpreter template: e2b-dev/code-interpreter#338.

Link to Devin session: https://app.devin.ai/sessions/e307a60ded5e4986a82930c5f7b8169e
Open in Devin Desktop: https://app.devin.ai/desktop/session/e307a60ded5e4986a82930c5f7b8169e?variant=devin
Requested by: @mishushakov

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@cla-bot cla-bot Bot added the cla-signed label Sep 7, 2026
Comment thread template/README.md Outdated
Comment thread .github/workflows/template.yml Outdated
Comment thread .github/workflows/template.yml Fixed
Comment thread .github/workflows/template.yml Outdated
@mishushakov
mishushakov marked this pull request as ready for review October 13, 2026 14:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T14:47:13.097526Z 0766d5d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

❌ Cannot revive Devin session - the session is too old. Please start a new session instead.

View session

@mishushakov

Copy link
Copy Markdown
Member

has conflicts

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0766d5d34e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .github/workflows/template.yml Outdated
Comment on lines +99 to +103
- name: Check the cluster API key
env:
CLUSTER: ${{ matrix.cluster }}
API_KEY_SECRET: ${{ matrix.api_key_secret }}
run: |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Check out before running in the template directory

Every matrix leg starts on a fresh runner, but the job-wide working-directory: ./template also applies to this first run step, before checkout has created that directory. GitHub requires the assigned working directory to exist before starting the shell, so all three template builds fail before the API-key check executes; move checkout ahead of this step or override this step's working directory. GitHub workflow syntax

Useful? React with 👍 / 👎.

devin-ai-integration Bot and others added 5 commits October 13, 2026 14:47
…ngo)

Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1788791818-build-templates-all-clusters branch from 0766d5d to 33eb360 Compare October 13, 2026 14:48
run: uv run python build_prod.py
# The template is built on every production cluster. Clusters are separate
# tenancies with separate template registries, so each needs its own build.
buildTemplate:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Agentic Security Review

Severity: MEDIUM

Description: buildTemplate runs on workflow_dispatch for whatever ref the caller selects, with production cluster API keys in the job environment and no GitHub Environment. GitHub executes the workflow file and commit from that ref, then poetry run python build_prod.py publishes alias desktop. A repository writer can push a non-main branch and dispatch it to read those keys and replace the production desktop template.

Impact: Push-triggered runs of this workflow are already limited to main, and buildAndPushImage refuses every non-push event. workflow_dispatch drops that gate. A writer who cannot land unreviewed code on main can still run branch-controlled code with E2B_API_KEY, E2B_JULIETT_API_KEY, and E2B_TANGO_API_KEY, exfiltrate them, and Template.build alias desktop onto e2b.dev, e2b-juliett.dev, and e2b-tango.dev. Because the selected ref's workflow file is what runs, that writer can also drop the DockerHub job's push-only guard and read DOCKERHUB_USERNAME and DOCKERHUB_TOKEN. Fork contributors without write cannot dispatch. An in-file if: github.ref == 'refs/heads/main' does not hold: the attacker deletes it on the branch. Reachability: exposure internal (repo write required), automatable yes (branch push plus the workflow dispatch API, secret names are in this file), technical_impact total (production credentials).

Remediation: Store the three cluster API keys in a GitHub Environment whose deployment branch policy allows only the protected main ref, and set environment: on buildTemplate so a non-main ref cannot receive them. Keep them out of repository-level secrets. Do not rely on if: github.ref == 'refs/heads/main' in this file: workflow_dispatch runs the workflow from the selected ref, so a writer can remove that condition. Removing workflow_dispatch also closes the path. Apply the same environment gate to DockerHub credentials if a dispatched ref must not be able to name them.

@mishushakov

Copy link
Copy Markdown
Member

check security review above

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it.

View session

@mishushakov

Copy link
Copy Markdown
Member

we will be moving it to customer templates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants