Skip to content

Actor/Worker Antigravity CLI example#199

Closed
Michael Levan (AdminTurnedDevOps) wants to merge 3 commits into
agent-substrate:mainfrom
AdminTurnedDevOps:feat/gemini-cli-example
Closed

Actor/Worker Antigravity CLI example#199
Michael Levan (AdminTurnedDevOps) wants to merge 3 commits into
agent-substrate:mainfrom
AdminTurnedDevOps:feat/gemini-cli-example

Conversation

@AdminTurnedDevOps

Copy link
Copy Markdown

Created an example for Gemini CLI (mimics the Claude Code example).

Tested to ensure pods, workerpool, and actortemplates are up and operational.

❯ kubectl get pods,workerpool,actortemplate -n gemini-cli-multiplex-demo
NAME                                                READY   STATUS    RESTARTS   AGE
pod/gemini-workerpool-deployment-65bcc998df-txl5p   1/1     Running   0          52s
pod/gemini-workerpool-deployment-65bcc998df-znkfn   1/1     Running   0          52s

NAME                                   DESIRED   REPLICAS   AGE
workerpool.ate.dev/gemini-workerpool   2         2          52s

NAME                                AGE
actortemplate.ate.dev/agent-luna    52s
actortemplate.ate.dev/agent-mars    52s
actortemplate.ate.dev/agent-orion   52s
❯ kubectl ate get actors
NAMESPACE                   TEMPLATE      ID                                     STATUS             ATEOM POD                                                                 ATEOM IP       VERSION
gemini-cli-multiplex-demo   agent-luna    442ba482-aca7-4912-a469-82ed61811235   STATUS_SUSPENDED   <none>                                                                                   13
gemini-cli-multiplex-demo   agent-luna    dc384834-0330-4f47-8f7e-f24c7d7f91d2   STATUS_SUSPENDED   <none>                                                                                   1
gemini-cli-multiplex-demo   agent-mars    5cf2b408-5028-43c6-b36f-522877d6e3ab   STATUS_RESUMING    gemini-cli-multiplex-demo/gemini-workerpool-deployment-65bcc998df-txl5p   10.36.138.18   7
gemini-cli-multiplex-demo   agent-mars    d5a6fc57-150c-4580-a0ca-3d9efb91733c   STATUS_SUSPENDED   <none>                                                                                   14
gemini-cli-multiplex-demo   agent-orion   2fe270a6-bec7-4a03-bfd9-1d5ae290e317   STATUS_SUSPENDED   <none>                                                                                   6
gemini-cli-multiplex-demo   agent-orion   d8b4438b-f6b7-4895-aab8-28a0b6358662   STATUS_RESUMING    gemini-cli-multiplex-demo/gemini-workerpool-deployment-65bcc998df-znkfn   10.36.139.21   7
❯ kubectl ate get workers
NAMESPACE                   POOL                POD                                             STATUS     ASSIGNED ACTOR
gemini-cli-multiplex-demo   gemini-workerpool   gemini-workerpool-deployment-65bcc998df-txl5p   ASSIGNED   gemini-cli-multiplex-demo/agent-mars/5cf2b408-5028-43c6-b36f-522877d6e3ab
gemini-cli-multiplex-demo   gemini-workerpool   gemini-workerpool-deployment-65bcc998df-znkfn   ASSIGNED   gemini-cli-multiplex-demo/agent-orion/d8b4438b-f6b7-4895-aab8-28a0b6358662

logs from the workerpool deployment:

> kubectl logs -n gemini-cli-multiplex-demo gemini-workerpool-deployment-65bcc998df-42rwk --all-containers --tail=80


:[{"name":"gemini"}]}},"resp":null,"err":"while creating \"gemini\" application container: while running `runsc create`: exit status 128","elapsed-time":"179.512732ms","ate.dev/trace-id":"a4dff30ce44fe294a0fe901cbadb8bea"}

^ Saw this error, so I added in /run.sh in the template (per upstream issue #189 — "Atelet OCI bundle gaps).

Worked as expected after:

{
  "ociVersion": "1.2.1",
  "id": "gemini",
  "status": "stopped",
  "pid": -1,
  "bundle": "/run/ateom-gvisor/actors/gemini-cli-multiplex-demo:agent-luna:0264dac8-02f2-4b5b-8be1-42de7a956cd2/bundles/gemini",
  "annotations": {
    "io.kubernetes.cri.container-name": "gemini",
    "io.kubernetes.cri.container-type": "container",
    "io.kubernetes.cri.sandbox-id": "pause"
  }
}
W0607 22:34:58.087512     269 config.go:496] --allow-suid is disabled, SUID/SGID bits on executables will be ignored.
I0607 22:34:58.087530     269 cli.go:283] **************** gVisor ****************
I0607 22:34:58.087645     269 cli.go:310] Exiting with status: 0
W0607 22:34:58.104064     274 maincli.go:38] Cannot find if container gemini exists, checking if sandbox pause is running, err: getting container state (CID: "gemini"): connecting to control server at PID 159: connection refused
W0607 22:34:58.104070     274 maincli.go:38] Sandbox isn't running anymore, marking container gemini as stopped:
I0607 22:34:58.104146     274 cli.go:271] **************** gVisor ****************
I0607 22:34:58.104186     274 cli.go:272] Version release-20260511.0-42-ga7924c4ef10d-dirty, go1.25.5, amd64, 4 CPUs, linux, PID 274, PPID 1, UID 0, GID 0
I0607 22:34:58.104221     274 cli.go:274] Args: [/run/ateom-gvisor/static-files/runsc-a397be1abc2420d26bce6c70e6e2ff96c73aaaab929756c56f5e2089ea842b63 -log-format json --alsologtostderr -root /run/ateom-gvisor/actors/gemini-cli-multiplex-demo:agent-luna:0264dac8-02f2-4b5b-8be1-42de7a956cd2/runsc-state delete -force gemini]
I0607 22:34:58.104290     274 config.go:487] Platform: systrap
I0607 22:34:58.104314     274 config.go:488] RootDir: /run/ateom-gvisor/actors/gemini-cli-multiplex-demo:agent-luna:0264dac8-02f2-4b5b-8be1-42de7a956cd2/runsc-state
I0607 22:34:58.104325     274 config.go:489] FileAccess: exclusive / Directfs: true / Overlay: root:self
I0607 22:34:58.104343     274 config.go:490] Network: sandbox
I0607 22:34:58.104362     274 config.go:491] UseCPUNums: false
W0607 22:34:58.104381     274 config.go:496] --allow-suid is disabled, SUID/SGID bits on executables will be ignored.
I0607 22:34:58.104402     274 cli.go:283] **************** gVisor ****************
W0607 22:34:58.104933     274 container.go:1821] Process (159) not found setting oom_score_adj
I0607 22:34:58.104981     274 cli.go:310] Exiting with status: 0
W0607 22:34:58.118800     279 maincli.go:38] Cannot find if container pause exists, checking if sandbox pause is running, err: getting container state (CID: "pause"): connecting to control server at PID 159: connection refused
W0607 22:34:58.118804     279 maincli.go:38] Sandbox isn't running anymore, marking container pause as stopped:
I0607 22:34:58.118875     279 cli.go:271] **************** gVisor ****************
I0607 22:34:58.118920     279 cli.go:272] Version release-20260511.0-42-ga7924c4ef10d-dirty, go1.25.5, amd64, 4 CPUs, linux, PID 279, PPID 1, UID 0, GID 0
I0607 22:34:58.118956     279 cli.go:274] Args: [/run/ateom-gvisor/static-files/runsc-a397be1abc2420d26bce6c70e6e2ff96c73aaaab929756c56f5e2089ea842b63 -log-format json --alsologtostderr -root /run/ateom-gvisor/actors/gemini-cli-multiplex-demo:agent-luna:0264dac8-02f2-4b5b-8be1-42de7a956cd2/runsc-state delete -force pause]
I0607 22:34:58.118998     279 config.go:487] Platform: systrap
I0607 22:34:58.119015     279 config.go:488] RootDir: /run/ateom-gvisor/actors/gemini-cli-multiplex-demo:agent-luna:0264dac8-02f2-4b5b-8be1-42de7a956cd2/runsc-state
I0607 22:34:58.119023     279 config.go:489] FileAccess: exclusive / Directfs: true / Overlay: root:self
I0607 22:34:58.119054     279 config.go:490] Network: sandbox
I0607 22:34:58.119069     279 config.go:491] UseCPUNums: false
W0607 22:34:58.119085     279 config.go:496] --allow-suid is disabled, SUID/SGID bits on executables will be ignored.
I0607 22:34:58.119100     279 cli.go:283] **************** gVisor ****************
I0607 22:34:58.119337     279 cli.go:310] Exiting with status: 0
{"logging.googleapis.com/labels":{"ate.dev/actor_id":"0264dac8-02f2-4b5b-8be1-42de7a956cd2","ate.dev/actor_namespace":"gemini-cli-multiplex-demo","ate.dev/actor_template":"agent-luna"},"message":"Actor checkpointed","time":"2026-06-07T22:34:58.126598943Z"}
{"time":"2026-06-07T22:34:58.126663265Z","level":"INFO","msg":"Handle RPC","method":"/ateom.Ateom/CheckpointWorkload","req":{"actor_template_namespace":"gemini-cli-multiplex-demo","actor_template_name":"agent-luna","actor_id":"0264dac8-02f2-4b5b-8be1-42de7a956cd2","runsc_path":"/run/ateom-gvisor/static-files/runsc-a397be1abc2420d26bce6c70e6e2ff96c73aaaab929756c56f5e2089ea842b63","spec":{"containers":[{"name":"gemini"}]}},"resp":null,"err":null,"elapsed-time":"121.444981ms","ate.dev/trace-id":"377b6ca0a81f4f00d1904619085870c1"}

Resumed the Actor and ran a quick test:

❯  kubectl ate resume actor 0264dac8-02f2-4b5b-8be1-42de7a956cd2
NAMESPACE                   TEMPLATE     ID                                     STATUS           ATEOM POD                                                                 ATEOM IP       VERSION
gemini-cli-multiplex-demo   agent-luna   0264dac8-02f2-4b5b-8be1-42de7a956cd2   STATUS_RUNNING   gemini-cli-multiplex-demo/gemini-workerpool-deployment-65bcc998df-42rwk   10.36.138.19   7


❯  kubectl ate logs actor 0264dac8-02f2-4b5b-8be1-42de7a956cd

{"time":"2026-06-07T22:40:00.383030257Z","message":"[demo-actor:luna] running: Tell me one short, surprising fact about the Moon. One sentence."}
{"time":"2026-06-07T22:40:00.383165654Z","message":"---"}
{"time":"2026-06-07T22:40:03.652916982Z","message":"\u001b[31mGemini CLI is not running in a trusted directory. To proceed, either use `--skip-trust`, set the `GEMINI_CLI_TRUST_WORKSPACE=true` environment variable, or trust this directory in interactive mode. For more details, see https://geminicli.com/docs/cli/trusted-folders/#headless-and-automated-environments\u001b[0m"}
{"time":"2026-06-07T22:40:03.688705114Z","message":"[demo-actor:luna] gemini exited non-zero"}
{"time":"2026-06-07T22:40:03.688754697Z","message":"---"}
{"time":"2026-06-07T22:40:03.688766137Z","message":"[demo-actor:luna] tick 2 done; sleeping 45s"
  • Tests pass
  • Appropriate changes to documentation are included in the PR

@google-cla

google-cla Bot commented Jun 7, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Comment thread demos/gemini-cli-multiplex/README.md Outdated
@@ -0,0 +1,124 @@
# Gemini CLI Multiplex Demo

A demo of three Gemini-CLI-driven agents sharing two Agent Substrate pods. Substrate suspends idle agents and resumes them on demand, so the cluster runs *fewer pods than agents*.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should this be antigravity since Gemini-cli is deprecated?

google-gemini/gemini-cli#27274

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is a really good point. I'm going to switch this up.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm not affilated with google so I don't care on antigravity as the option.

I've been trying to change to use opencode / pi as that they are easily interchangeable for different models.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yeah, makes sense and nah, I hear you. Gemini CLI is going to be deprecated I believe end of June, so it makes sense to not have a demo on this.

@AdminTurnedDevOps Michael Levan (AdminTurnedDevOps) Jun 10, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Just pushed the change to be antigravity instead of gemini.

@BenTheElder Benjamin Elder (BenTheElder) changed the title Actor/Worker Gemini CLI example Actor/Worker Antigravity CLI example Jun 13, 2026
@BenTheElder

Copy link
Copy Markdown
Collaborator

See Also: https://github.com/google/ax google/ax#80

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Michael Levan (@AdminTurnedDevOps)

  1. Could you please sync your fork to mainline. Your gvisor-ateom has an old version. I was able to make your code running, however at some point worker was throwing an error:
{"time":"2026-06-13T19:19:42.117690053Z","level":"ERROR","msg":"Error while executing","err":"ateom socket path \"/run/ateom-gvisor/ateoms/antigravity-cli-multiplex-demo:antigravity-workerpool-deployment-58dcb5db58-qsx25/ateom.sock\" is 117 bytes, exceeds Linux unix-socket limit of 107: shorten the namespace or pod name (30 + 50 = 80 chars used for namespace + name)"}

I shorten the namespace and was able actors to be registered.

  1. What UI supposed to do? I pressed "Give task" button and saw a new TASK added, the state state changed from QUEUED -> RUNNING -> COMPLETED, however I did not see any workers being RUNNING and/or new ACTORS are created. The kubectl get actors does not show new actors being created.

Signed-off-by: adminturneddevops <mlevan1992@gmail.com>
@AdminTurnedDevOps

Copy link
Copy Markdown
Author

Michael Levan (Michael Levan (@AdminTurnedDevOps))

  1. Could you please sync your fork to mainline. Your gvisor-ateom has an old version. I was able to make your code running, however at some point worker was throwing an error:
{"time":"2026-06-13T19:19:42.117690053Z","level":"ERROR","msg":"Error while executing","err":"ateom socket path \"/run/ateom-gvisor/ateoms/antigravity-cli-multiplex-demo:antigravity-workerpool-deployment-58dcb5db58-qsx25/ateom.sock\" is 117 bytes, exceeds Linux unix-socket limit of 107: shorten the namespace or pod name (30 + 50 = 80 chars used for namespace + name)"}

I shorten the namespace and was able actors to be registered.

  1. What UI supposed to do? I pressed "Give task" button and saw a new TASK added, the state state changed from QUEUED -> RUNNING -> COMPLETED, however I did not see any workers being RUNNING and/or new ACTORS are created. The kubectl get actors does not show new actors being created.

Hey Dmitry, hope all is well! I synced with main.

In terms of the UI, I went off of what was in the Claude example. My understanding is the UI is there as an example because there's no interaction point/"client" for Substrate, so the only way to resume Actors is to curl (e.g - kubectl port-forward -n ate-system svc/api 18443:443 and then hit it with a grpcurl) or by integrating it with an agentic runtime frontend. At least, those are the ways I've seen it so far. If there's another way, I'm happy to integrate that into this example.

@dberkov

Copy link
Copy Markdown
Collaborator

In terms of the UI, I went off of what was in the Claude example. My understanding is the UI is there as an example because there's no interaction point/"client" for Substrate, so the only way to resume Actors is to curl (e.g - kubectl port-forward -n ate-system svc/api 18443:443 and then hit it with a grpcurl) or by integrating it with an agentic runtime frontend. At least, those are the ways I've seen it so far. If there's another way, I'm happy to integrate that into this example.

Could you please clarify what is a purpose of this demo?

@AdminTurnedDevOps

Copy link
Copy Markdown
Author

In terms of the UI, I went off of what was in the Claude example. My understanding is the UI is there as an example because there's no interaction point/"client" for Substrate, so the only way to resume Actors is to curl (e.g - kubectl port-forward -n ate-system svc/api 18443:443 and then hit it with a grpcurl) or by integrating it with an agentic runtime frontend. At least, those are the ways I've seen it so far. If there's another way, I'm happy to integrate that into this example.

Could you please clarify what is a purpose of this demo?

Goal was to have a demo like the Claude demo thats already in the repo, but for antigravity (as it's a Google OSS project, figured having a way to showcase it with a Google product would be cool). I'm happy to just put this in one of my demo repos those outside of this if you prefer.

@dberkov

Copy link
Copy Markdown
Collaborator

Michael Levan (@AdminTurnedDevOps) the problem the current demo does not work or missing instructions. Therefore it cannot be submitted as is. In addition to it, anti-gravity requires GEMINI_API_KEY to work and it is missing in your demo too.

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.

4 participants