Skip to content

cli: allow setting the Envoy version in standalone mode#1156

Merged
mathetake merged 4 commits into
envoyproxy:mainfrom
nacx:envoy-version
Oct 10, 2025
Merged

cli: allow setting the Envoy version in standalone mode#1156
mathetake merged 4 commits into
envoyproxy:mainfrom
nacx:envoy-version

Conversation

@nacx
Copy link
Copy Markdown
Member

@nacx nacx commented Sep 2, 2025

Description

Allow configuring the version of Envoy to use when running in standalone mode with aigw run:

$ ./out/aigw-darwin-arm64 run --envoy-version 1.35.0
1.35.0 is already downloaded
starting: /tmp/envoy-gateway/versions/1.35.0/bin/envoy in run directory /tmp/envoy-gateway/runs/1756854499474593000

$ ./out/aigw-darwin-arm64 run --envoy-version 1.34.2
downloading https://archive.tetratelabs.io/envoy/download/v1.34.2/envoy-v1.34.2-darwin-arm64.tar.xz
starting: /tmp/envoy-gateway/versions/1.34.2/bin/envoy in run directory /tmp/envoy-gateway/runs/1756854634015259000

Related Issues/PRs (if applicable)

Depends on: envoyproxy/gateway#6891
Keeping it as draft until this PR is merged.

Special notes for reviewers (if applicable)

N/A

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.56%. Comparing base (7e2e42a) to head (1201e9a).
⚠️ Report is 421 commits behind head on main.

❌ Your project status has failed because the head coverage (77.56%) is below the target coverage (86.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1156      +/-   ##
==========================================
+ Coverage   77.54%   77.56%   +0.02%     
==========================================
  Files         123      123              
  Lines       15759    15759              
==========================================
+ Hits        12220    12224       +4     
+ Misses       2911     2906       -5     
- Partials      628      629       +1     

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nacx nacx force-pushed the envoy-version branch 2 times, most recently from f8e8440 to 1a3c90f Compare September 9, 2025 14:20
Comment thread go.mod Outdated
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect
)

replace github.com/envoyproxy/gateway => github.com/nacx/gateway v0.0.0-20250909074754-a7edf6c24f62
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This needs to be removed when the EG PR is merged.

@nacx nacx force-pushed the envoy-version branch 2 times, most recently from 3a38a90 to a0a23f6 Compare September 10, 2025 07:54
Copy link
Copy Markdown
Contributor

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

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

I like this in general. I think it will be easier now that there's no default config as you can just edit the template and use ENVOY_VERSION (similar to existing stuff for openai) or the arg you mentioned.

@mathetake
Copy link
Copy Markdown
Member

i can't think of the situation where users want to use a specific stable version of Envoy as our impls will anyways be tied with one or two version. What do you all think about simply not exposing it but just internally specifying the stable version we want to run with?

@mathetake
Copy link
Copy Markdown
Member

iow i think it's an implementation detail in at least aigw run?

@codefromthecrypt
Copy link
Copy Markdown
Contributor

codefromthecrypt commented Sep 30, 2025

I think it would be nice to have the ability to update. ENVOY_VERSION makes sense as it is what func-e uses for the same purpose. so we can hard-code the known working and allow override with ENVOY_VERSION.

we can use the "last known envoy" approach like func-e to pin the version so that it is the same as what is in the Docker build, but also allow it to be overridden. We would do a test like func-e that proves the last known is up to date.

so, in GenerateOpenAIConfig we can default EnvoyVersion to the last known and then update it with ENV like all the rest of the stuff.

@mathetake
Copy link
Copy Markdown
Member

sg

Signed-off-by: Ignasi Barrera <ignasi@tetrate.io>
@nacx nacx marked this pull request as ready for review October 10, 2025 10:35
@nacx nacx requested a review from a team as a code owner October 10, 2025 10:35
@nacx
Copy link
Copy Markdown
Member Author

nacx commented Oct 10, 2025

I've rebased the PR and updated it to use the ENVOY_VERSION env var instead of a cli flag. Note that since we already have envoyproxy/gateway#6891, the right envoy version will be picked by default unless it's explicitly set.

ENVOY_VERISON=1.35.0 ./out/aigw-darwin-arm64 run

@nacx nacx requested a review from codefromthecrypt October 10, 2025 10:36
Comment thread cmd/aigw/run.go
// Print a status message without any timestamp formatting
startDuration := time.Since(start).Round(100 * time.Millisecond)
_, _ = fmt.Fprintf(stderr, "Envoy AI Gateway listening on http://localhost:%d (admin http://localhost:%d) after %v\n", listenerPort, envoyAdmin.Port(), startDuration)
if err = pollEnvoyReady(ctx, debugLogger, envoyAdmin, 2*time.Second); err != nil {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is a small side change I spotted, to avoid printing "envoy ready" if users cancel (Ctrl^C) the process while the polling was ongoing.

nacx added 2 commits October 10, 2025 12:58
Signed-off-by: Ignasi Barrera <ignasi@tetrate.io>
Signed-off-by: Ignasi Barrera <ignasi@tetrate.io>
@nacx
Copy link
Copy Markdown
Member Author

nacx commented Oct 10, 2025

Failing tests are fixed in #1326

Copy link
Copy Markdown
Contributor

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

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

Sounds fine for locking down envoy version in a file config. Be careful of require.Xx in test cleanup or eventually as i think both patterns are easy to make bugs (speaking from experience making them)

Comment thread cmd/aigw/run_test.go
envoyAdmin, err := aigw.NewEnvoyAdminClient(ctx, os.Getpid(), adminPort)
require.NoError(t, err)
pollEnvoyReady(ctx, l, envoyAdmin, 50*time.Millisecond)
require.ErrorIs(t, pollEnvoyReady(ctx, l, envoyAdmin, 50*time.Millisecond), context.DeadlineExceeded)
Copy link
Copy Markdown
Contributor

@codefromthecrypt codefromthecrypt Oct 10, 2025

Choose a reason for hiding this comment

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

Be careful as if i am reading correctly this is now using require in an t.cleanup which is sadly something the linter wont pick up but iiuc will exit the runtime

@codefromthecrypt
Copy link
Copy Markdown
Contributor

Ps unless we want to persist this to a file, there will be a simpler way in a pending change to func-e.

We might consider not shipping this I mean as there will be another way to set the same thing and also align it by default to the docker baked version.

@mathetake mathetake merged commit 3196b14 into envoyproxy:main Oct 10, 2025
29 of 31 checks passed
nutanix-Hrushikesh pushed a commit to nutanix-Hrushikesh/ai-gateway that referenced this pull request Oct 16, 2025
)

**Description**

Allow configuring the version of Envoy to use when running in standalone
mode with `aigw run`:

```
$ ./out/aigw-darwin-arm64 run --envoy-version 1.35.0
1.35.0 is already downloaded
starting: /tmp/envoy-gateway/versions/1.35.0/bin/envoy in run directory /tmp/envoy-gateway/runs/1756854499474593000

$ ./out/aigw-darwin-arm64 run --envoy-version 1.34.2
downloading https://archive.tetratelabs.io/envoy/download/v1.34.2/envoy-v1.34.2-darwin-arm64.tar.xz
starting: /tmp/envoy-gateway/versions/1.34.2/bin/envoy in run directory /tmp/envoy-gateway/runs/1756854634015259000
```

**Related Issues/PRs (if applicable)**

Depends on: envoyproxy/gateway#6891
Keeping it as draft until this PR is merged.

**Special notes for reviewers (if applicable)**

N/A

---------

Signed-off-by: Ignasi Barrera <ignasi@tetrate.io>
Signed-off-by: Hrushikesh Patil <hrushikesh.patil@nutanix.com>
nutanix-Hrushikesh pushed a commit to nutanix-Hrushikesh/ai-gateway that referenced this pull request Oct 16, 2025
)

**Description**

Allow configuring the version of Envoy to use when running in standalone
mode with `aigw run`:

```
$ ./out/aigw-darwin-arm64 run --envoy-version 1.35.0
1.35.0 is already downloaded
starting: /tmp/envoy-gateway/versions/1.35.0/bin/envoy in run directory /tmp/envoy-gateway/runs/1756854499474593000

$ ./out/aigw-darwin-arm64 run --envoy-version 1.34.2
downloading https://archive.tetratelabs.io/envoy/download/v1.34.2/envoy-v1.34.2-darwin-arm64.tar.xz
starting: /tmp/envoy-gateway/versions/1.34.2/bin/envoy in run directory /tmp/envoy-gateway/runs/1756854634015259000
```

**Related Issues/PRs (if applicable)**

Depends on: envoyproxy/gateway#6891
Keeping it as draft until this PR is merged.

**Special notes for reviewers (if applicable)**

N/A

---------

Signed-off-by: Ignasi Barrera <ignasi@tetrate.io>
Signed-off-by: Hrushikesh Patil <hrushikesh.patil@nutanix.com>
nutanix-Hrushikesh pushed a commit to nutanix-Hrushikesh/ai-gateway that referenced this pull request Oct 16, 2025
)

**Description**

Allow configuring the version of Envoy to use when running in standalone
mode with `aigw run`:

```
$ ./out/aigw-darwin-arm64 run --envoy-version 1.35.0
1.35.0 is already downloaded
starting: /tmp/envoy-gateway/versions/1.35.0/bin/envoy in run directory /tmp/envoy-gateway/runs/1756854499474593000

$ ./out/aigw-darwin-arm64 run --envoy-version 1.34.2
downloading https://archive.tetratelabs.io/envoy/download/v1.34.2/envoy-v1.34.2-darwin-arm64.tar.xz
starting: /tmp/envoy-gateway/versions/1.34.2/bin/envoy in run directory /tmp/envoy-gateway/runs/1756854634015259000
```

**Related Issues/PRs (if applicable)**

Depends on: envoyproxy/gateway#6891
Keeping it as draft until this PR is merged.

**Special notes for reviewers (if applicable)**

N/A

---------

Signed-off-by: Ignasi Barrera <ignasi@tetrate.io>
Signed-off-by: Hrushikesh Patil <hrushikesh.patil@nutanix.com>
missBerg pushed a commit to missBerg/ai-gateway that referenced this pull request Dec 20, 2025
)

**Description**

Allow configuring the version of Envoy to use when running in standalone
mode with `aigw run`:

```
$ ./out/aigw-darwin-arm64 run --envoy-version 1.35.0
1.35.0 is already downloaded
starting: /tmp/envoy-gateway/versions/1.35.0/bin/envoy in run directory /tmp/envoy-gateway/runs/1756854499474593000

$ ./out/aigw-darwin-arm64 run --envoy-version 1.34.2
downloading https://archive.tetratelabs.io/envoy/download/v1.34.2/envoy-v1.34.2-darwin-arm64.tar.xz
starting: /tmp/envoy-gateway/versions/1.34.2/bin/envoy in run directory /tmp/envoy-gateway/runs/1756854634015259000
```

**Related Issues/PRs (if applicable)**

Depends on: envoyproxy/gateway#6891
Keeping it as draft until this PR is merged.

**Special notes for reviewers (if applicable)**

N/A

---------

Signed-off-by: Ignasi Barrera <ignasi@tetrate.io>
Signed-off-by: Erica Hughberg <erica.sundberg.90@gmail.com>
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