Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the default Wasm runtime to Envoy 1.17 from wasm:1.15 #114

Merged
merged 2 commits into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ categories = ["wasm"]
crate-type = ["rlib"]

[dependencies]
envoy = { package = "envoy-sdk", version = "^0.1" }
envoy = { package = "envoy-sdk", version = "^0.2.0-alpha.1" }
serde = { version = "^1.0", features = ["derive"] }
serde_json = "^1.0"
chrono = "^0.4"
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ crate-type = ["cdylib"]

[dependencies]
envoy-sample-access-logger = { path = "../.." }
envoy = { package = "envoy-sdk", version = "^0.1" }
envoy = { package = "envoy-sdk", version = "^0.2.0-alpha.1" }
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ categories = ["wasm"]
crate-type = ["rlib"]

[dependencies]
envoy = { package = "envoy-sdk", version = "^0.1" }
envoy = { package = "envoy-sdk", version = "^0.2.0-alpha.1" }
serde = { version = "^1.0", features = ["derive"] }
serde_json = "^1.0"
chrono = "^0.4"
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ crate-type = ["cdylib"]

[dependencies]
envoy-sample-http-filter = { path = "../.." }
envoy = { package = "envoy-sdk", version = "^0.1" }
envoy = { package = "envoy-sdk", version = "^0.2.0-alpha.1" }
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ categories = ["wasm"]
crate-type = ["rlib"]

[dependencies]
envoy = { package = "envoy-sdk", version = "^0.1" }
envoy = { package = "envoy-sdk", version = "^0.2.0-alpha.1" }
serde = { version = "^1.0", features = ["derive"] }
serde_json = "^1.0"
chrono = "^0.4"
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ crate-type = ["cdylib"]

[dependencies]
envoy-sample-network-filter = { path = "../.." }
envoy = { package = "envoy-sdk", version = "^0.1" }
envoy = { package = "envoy-sdk", version = "^0.2.0-alpha.1" }
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.13

require (
bitbucket.org/creachadair/shell v0.0.6
github.com/Masterminds/semver v1.5.0
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd h1:sjQovDkwrZp
github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E=
github.com/Masterminds/semver v1.4.2 h1:WBLTQ37jOCzSLtXNdoo8bNM8876KhNqOKvrlGITgsTc=
github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/sprig v2.14.1+incompatible h1:rTHERm50Xp1Cbb8x7xBCeDp//jMMqqR44EWw7KwSXUQ=
github.com/Masterminds/sprig v2.14.1+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
2 changes: 1 addition & 1 deletion pkg/cmd/extension/init/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var (
// 1. according to command-line options
// 2. otherwise, according to the example-specific configuration (.getenvoy/extension/examples/<example>/example.yaml)
// 3. otherwise, according to extension descriptor (.getenvoy/extension/extension.yaml)
supportedEnvoyVersion = "wasm:1.15"
supportedEnvoyVersion = "standard:1.17.0"
)

// NewCmd returns a command that generates the initial set of files
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/extension/init/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Run 'getenvoy extension init --help' for usage.
Expect(descriptor.Name).To(Equal(name))
Expect(descriptor.Category.String()).To(Equal(given.category))
Expect(descriptor.Language.String()).To(Equal(given.language))
Expect(descriptor.Runtime.Envoy.Version).To(Equal("wasm:1.15"))
Expect(descriptor.Runtime.Envoy.Version).To(Equal("standard:1.17.0"))

By("verifying command output")
Expect(stdout.String()).To(BeEmpty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
2 changes: 1 addition & 1 deletion pkg/cmd/extension/run/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Run Envoy extension in the example setup.`,
getenvoy extension run

# Run Envoy extension in the "default" example setup using a particular Envoy release provided by getenvoy.io
getenvoy extension run --envoy-version wasm:1.15
getenvoy extension run --envoy-version standard:1.17.0

# Run Envoy extension in the "default" example setup using a custom Envoy binary
getenvoy extension run --envoy-path /path/to/envoy
Expand Down
26 changes: 17 additions & 9 deletions pkg/cmd/extension/run/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import (

"github.com/otiai10/copy"

"github.com/Masterminds/semver"

"github.com/tetratelabs/getenvoy/pkg/cmd"
"github.com/tetratelabs/getenvoy/pkg/manifest"
"github.com/tetratelabs/getenvoy/pkg/types"
Expand Down Expand Up @@ -132,7 +134,7 @@ var _ = Describe("getenvoy extension run", func() {
var manifestServer manifesttest.Server

BeforeEach(func() {
testManifest, err := manifesttest.NewSimpleManifest("wasm:1.15", "wasm:stable")
testManifest, err := manifesttest.NewSimpleManifest("standard:1.17.0", "wasm:1.15", "wasm:stable")
Expect(err).NotTo(HaveOccurred())

manifestServer = manifesttest.NewServer(&manifesttest.ServerOpts{
Expand All @@ -145,6 +147,12 @@ var _ = Describe("getenvoy extension run", func() {
if ref.Flavor == "wasm" {
return envoySubstituteArchiveDir, nil
}
if ref.Flavor == "standard" {
ver, e := semver.NewVersion(ref.Version)
if e == nil && ver.Major() >= 1 && ver.Minor() >= 17 {
return envoySubstituteArchiveDir, nil
}
}
return "", errors.Errorf("unexpected version of Envoy %q", uri)
},
OnError: func(err error) {
Expand All @@ -166,7 +174,7 @@ var _ = Describe("getenvoy extension run", func() {
var platform string

BeforeEach(func() {
key, err := manifest.NewKey("wasm:1.15")
key, err := manifest.NewKey("standard:1.17.0")
Expect(err).NotTo(HaveOccurred())
platform = strings.ToLower(key.Platform)
})
Expand Down Expand Up @@ -290,7 +298,7 @@ Run 'getenvoy extension run --help' for usage.

It("should not allow --envoy-version and --envoy-path flags at the same time", func() {
By("running command")
c.SetArgs([]string{"extension", "run", "--envoy-version", "wasm:1.15", "--envoy-path", "envoy"})
c.SetArgs([]string{"extension", "run", "--envoy-version", "standard:1.17.0", "--envoy-path", "envoy"})
err := cmdutil.Execute(c)
Expect(err).To(HaveOccurred())

Expand Down Expand Up @@ -478,7 +486,7 @@ Run 'getenvoy extension run --help' for usage.

By("verifying command output")
Expect(stdout.String()).To(Equal(fmt.Sprintf(`%s/docker run -u 1001:1002 --rm -t -v %s:/source -w /source --init getenvoy/extension-rust-builder:latest build --output-file target/getenvoy/extension.wasm
%s/builds/wasm/1.15/%s/bin/envoy -c %s/envoy.tmpl.yaml
%s/builds/standard/1.17.0/%s/bin/envoy -c %s/envoy.tmpl.yaml
`, dockerDir, workspaceDir, getenvoyHomeDir, platform, envoyCaptured.cwd())))
Expect(stderr.String()).To(Equal("docker stderr\nenvoy stderr\n"))

Expand Down Expand Up @@ -510,7 +518,7 @@ Run 'getenvoy extension run --help' for usage.

By("verifying command output")
Expect(stdout.String()).To(Equal(fmt.Sprintf(`%s/docker run -u 1001:1002 --rm -t -v %s:/source -w /source --init -e VAR=VALUE -v /host:/container build/image build --output-file target/getenvoy/extension.wasm
%s/builds/wasm/1.15/%s/bin/envoy -c %s/envoy.tmpl.yaml
%s/builds/standard/1.17.0/%s/bin/envoy -c %s/envoy.tmpl.yaml
`, dockerDir, workspaceDir, getenvoyHomeDir, platform, envoyCaptured.cwd())))
Expect(stderr.String()).To(Equal("docker stderr\nenvoy stderr\n"))
})
Expand Down Expand Up @@ -600,7 +608,7 @@ Run 'getenvoy extension run --help' for usage.

By("verifying command output")
Expect(stdout.String()).To(Equal(fmt.Sprintf(`%s/docker run -u 1001:1002 --rm -t -v %s:/source -w /source --init getenvoy/extension-rust-builder:latest build --output-file target/getenvoy/extension.wasm
%s/builds/wasm/1.15/%s/bin/envoy -c %s/envoy.tmpl.yaml --concurrency 2 --component-log-level wasm:debug,config:trace
%s/builds/standard/1.17.0/%s/bin/envoy -c %s/envoy.tmpl.yaml --concurrency 2 --component-log-level wasm:debug,config:trace
`, dockerDir, workspaceDir, getenvoyHomeDir, platform, envoyCaptured.cwd())))
Expect(stderr.String()).To(Equal("docker stderr\nenvoy stderr\n"))
})
Expand All @@ -625,7 +633,7 @@ Run 'getenvoy extension run --help' for usage.
Expect(err).NotTo(HaveOccurred())

By("verifying command output")
Expect(stdout.String()).To(Equal(fmt.Sprintf("%s/builds/wasm/1.15/%s/bin/envoy -c %s/envoy.tmpl.yaml\n", getenvoyHomeDir, platform, envoyCaptured.cwd())))
Expect(stdout.String()).To(Equal(fmt.Sprintf("%s/builds/standard/1.17.0/%s/bin/envoy -c %s/envoy.tmpl.yaml\n", getenvoyHomeDir, platform, envoyCaptured.cwd())))
Expect(stderr.String()).To(Equal("envoy stderr\n"))

By("verifying Envoy config")
Expand Down Expand Up @@ -658,7 +666,7 @@ Run 'getenvoy extension run --help' for usage.

By("verifying command output")
Expect(stdout.String()).To(Equal(fmt.Sprintf(`%s/docker run -u 1001:1002 --rm -t -v %s:/source -w /source --init getenvoy/extension-rust-builder:latest build --output-file target/getenvoy/extension.wasm
%s/builds/wasm/1.15/%s/bin/envoy -c %s/envoy.tmpl.yaml
%s/builds/standard/1.17.0/%s/bin/envoy -c %s/envoy.tmpl.yaml
`, dockerDir, workspaceDir, getenvoyHomeDir, platform, envoyCaptured.cwd())))
Expect(stderr.String()).To(Equal("docker stderr\nenvoy stderr\n"))

Expand Down Expand Up @@ -690,7 +698,7 @@ Run 'getenvoy extension run --help' for usage.

By("verifying command output")
Expect(stdout.String()).To(Equal(fmt.Sprintf(`%s/docker run -u 1001:1002 --rm -t -v %s:/source -w /source --init getenvoy/extension-rust-builder:latest build --output-file target/getenvoy/extension.wasm
%s/builds/wasm/1.15/%s/bin/envoy -c %s/envoy.tmpl.yaml
%s/builds/standard/1.17.0/%s/bin/envoy -c %s/envoy.tmpl.yaml
`, dockerDir, workspaceDir, getenvoyHomeDir, platform, envoyCaptured.cwd())))
Expect(stderr.String()).To(Equal(`Scaffolding a new example setup:
* .getenvoy/extension/examples/default/README.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ category: envoy.filters.http
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
6 changes: 3 additions & 3 deletions pkg/extension/workspace/config/extension/extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
`,
expectedErr: `extension name cannot be empty`,
}),
Expand All @@ -137,7 +137,7 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
`,
expectedErr: `"?!@#$%" is not a valid extension name. Extension name must match the format "^[a-z0-9_]+(\\.[a-z0-9_]+)*$". E.g., 'mycompany.filters.http.custom_metrics'`,
}),
Expand Down Expand Up @@ -174,7 +174,7 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
`,
}),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
2 changes: 1 addition & 1 deletion pkg/extension/workspace/toolchain/lookup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
`))
Expect(err).ToNot(HaveOccurred())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ language: rust
# Runtime the extension is being developed against.
runtime:
envoy:
version: wasm:1.15
version: standard:1.17.0