Skip to content

fix(examples): create the python-bindings sandbox without a tenant key (ALIEN-1215) - #849

Merged
ItamarZand88 merged 1 commit into
mainfrom
itamar/alien-1215-python-bindings-example-passes-tenant-key
Oct 4, 2026
Merged

ItamarZand88 merged 1 commit into
mainfrom
itamar/alien-1215-python-bindings-example-passes-tenant-key

Conversation

@ItamarZand88

Copy link
Copy Markdown
Contributor

Summary

The Python bindings smoke workload created its sandbox with tenant_key, which AWS, Azure and GCP refuse. It now creates a plain sandbox and terminates it when done.

Step-by-step flow when you run python app.py in the workload:

  1. sandbox("runtime").create() starts a sandbox. ← the fix
  2. It runs python -c "print('ready')" and checks the exit code.
  3. terminate runs in finally, so the sandbox is removed even if the check fails.

This PR changes the example from get_or_create(tenant_key=…) to create() plus terminate().

What was broken

get_or_create(tenant_key="python-bindings-smoke") raises OPERATION_NOT_SUPPORTED on AWS (aws.rs:388), Azure (azure.rs:286) and GCP. The example only worked on Local and Kubernetes, which ignore the key.

What I did

  • Replaced the call with create(), and added terminate() in a finally block so the sandbox doesn't outlive the run.
  • Woz: nothing to remove.

Files touched

  • examples/python-bindings/app.py

How I tested

  • What I ran: built the local wheel (maturin build --no-default-features --features local), then ruff check and mypy on the example, as the python-bindings workflow does: both clean. cargo test -p alien-bindings --lib unsupported_sandbox_fields_are_refused_not_dropped passes, confirming AWS refuses tenantKey.
  • Anything I couldn't test: I didn't run app.py on a cloud. Every provider accepts create() with no arguments (read in each provider's create path); the rest of the smoke is unverified on a cloud.

Safe because create() with no arguments passes every provider's create-time checks. Unproven on a live cloud: a run of app.py in an AWS workload would prove it.

…y (ALIEN-1215)

AWS, Azure and GCP refuse tenantKey, so the smoke workload failed on its
first cloud run. It now creates a sandbox and terminates it when done.
@greptile-apps

greptile-apps Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low risk] Updates example code for sandbox creation.

The PR appears safe to merge.

Summary

The example now creates a sandbox without a tenant key, runs its smoke command, and terminates the sandbox in finally.

  • This avoids the cloud providers’ rejection of tenant-key creation.
  • The previous cleanup finding was answered in its resolved thread.

Reviews (2) · Last reviewed commit: "fix(examples): create the python-binding..."

Comment thread examples/python-bindings/app.py
@ItamarZand88

Copy link
Copy Markdown
Contributor Author

@greptileai review

Please review current head 9d5a700. The one finding on the previous review is answered in its thread: no code change, with the reason there.

@ItamarZand88
ItamarZand88 merged commit ee35854 into main Oct 4, 2026
29 checks passed
@ItamarZand88
ItamarZand88 deleted the itamar/alien-1215-python-bindings-example-passes-tenant-key branch October 4, 2026 17:31
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.

1 participant