Skip to content

Wasm Autoscaler: Example#4260

Merged
lacroixthomas merged 4 commits intoagones-dev:mainfrom
markmandel:examples/wasm-examples
Sep 8, 2025
Merged

Wasm Autoscaler: Example#4260
lacroixthomas merged 4 commits intoagones-dev:mainfrom
markmandel:examples/wasm-examples

Conversation

@markmandel
Copy link
Copy Markdown
Collaborator

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking
/kind bug
/kind cleanup
/kind documentation

/kind feature

/kind hotfix
/kind release

What this PR does / Why we need it:

Added a new WASM-based FleetAutoscaler example with supporting Go/Extism plugin code, build/test tooling, and a sample manifest.

Which issue(s) this PR fixes:

Work on #4080

Special notes for your reviewer:

To run the unit and e2e tests, this compiled plugin is needed, so submitting it first.

@markmandel markmandel added kind/feature New features for Agones area/examples Examples. Usually found in the `examples` directory labels Sep 2, 2025
@github-actions github-actions bot added the size/M label Sep 2, 2025
@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: bf5332ee-8799-4650-900b-baeca6fcad72

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/4260/head:pr_4260 && git checkout pr_4260
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.52.0-dev-ba1dfe1

function: 'scale'
# Config values to pass to the wasm program on startup
config:
scale_buffer: 10
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.

It might be buffer_size instead, following your main.go 🙂

Suggested change
scale_buffer: 10
buffer_size: 10

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Also good catch.

Copy link
Copy Markdown
Collaborator

@lacroixthomas lacroixthomas left a comment

Choose a reason for hiding this comment

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

Minor changes, otherwise LGTM !

Can't wait to see it all implemented, I was thinking, maybe we could add another example (later on, in another PR), about building another wasm but from another language ? Just to show that extism will be able to run the wasm build coming from any supported languages ? It's just an idea for later, might help for the doc as well 😄

Added a new WASM-based FleetAutoscaler example with supporting Go/Extism
plugin code, build/test tooling, and a sample manifest.

To run the unit and e2e tests, this compiled plugin is needed, so
submitting it first.

Work on agones-dev#4080
@markmandel markmandel force-pushed the examples/wasm-examples branch from ba1dfe1 to 8ee6406 Compare September 7, 2025 19:52
Copy link
Copy Markdown
Collaborator Author

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

Good catches! All fixed.

function: 'scale'
# Config values to pass to the wasm program on startup
config:
scale_buffer: 10
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Also good catch.

Copy link
Copy Markdown
Collaborator

@lacroixthomas lacroixthomas left a comment

Choose a reason for hiding this comment

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

LGTM ! 👌🏼

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Failed 😭

Build Id: 76cd1f50-5c5f-4c1f-9261-184d478aac40

Status: FAILURE

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@lacroixthomas lacroixthomas enabled auto-merge (squash) September 7, 2025 22:47
@markmandel
Copy link
Copy Markdown
Collaborator Author

Interesting flake:

--- FAIL: TestControllerAllocator (1.02s)
    --- FAIL: TestControllerAllocator/successful_allocation (1.02s)
        controller_test.go:116: 
            	Error Trace:	/go/src/agones.dev/agones/pkg/gameserverallocations/controller_test.go:116
            	            				/go/src/agones.dev/agones/pkg/gameserverallocations/controller_test.go:131
            	Error:      	Not equal: 
            	            	expected: 201
            	            	actual  : 422
            	Test:       	TestControllerAllocator/successful_allocation
        controller_test.go:119: 
            	Error Trace:	/go/src/agones.dev/agones/pkg/gameserverallocations/controller_test.go:119
            	            				/go/src/agones.dev/agones/pkg/gameserverallocations/controller_test.go:131
            	Error:      	Received unexpected error:
            	            	json: cannot unmarshal string into Go struct field GameServerAllocation.status of type v1.GameServerAllocationStatus
            	Test:       	TestControllerAllocator/successful_allocation

@lacroixthomas
Copy link
Copy Markdown
Collaborator

Interesting flake:

--- FAIL: TestControllerAllocator (1.02s)
    --- FAIL: TestControllerAllocator/successful_allocation (1.02s)
        controller_test.go:116: 
            	Error Trace:	/go/src/agones.dev/agones/pkg/gameserverallocations/controller_test.go:116
            	            				/go/src/agones.dev/agones/pkg/gameserverallocations/controller_test.go:131
            	Error:      	Not equal: 
            	            	expected: 201
            	            	actual  : 422
            	Test:       	TestControllerAllocator/successful_allocation
        controller_test.go:119: 
            	Error Trace:	/go/src/agones.dev/agones/pkg/gameserverallocations/controller_test.go:119
            	            				/go/src/agones.dev/agones/pkg/gameserverallocations/controller_test.go:131
            	Error:      	Received unexpected error:
            	            	json: cannot unmarshal string into Go struct field GameServerAllocation.status of type v1.GameServerAllocationStatus
            	Test:       	TestControllerAllocator/successful_allocation

It's not related to your changes, but it's strange, from a unit test as well 🤔
Probably worth creating an issue for that with the logs in it, I think It's the first time I see this error from a unit test

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: 364239fe-8ac7-44db-8643-f31dfd8dcc7f

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/4260/head:pr_4260 && git checkout pr_4260
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.52.0-dev-567aada

@lacroixthomas lacroixthomas merged commit 5ec619b into agones-dev:main Sep 8, 2025
4 checks passed
@markmandel markmandel deleted the examples/wasm-examples branch September 10, 2025 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/examples Examples. Usually found in the `examples` directory kind/feature New features for Agones size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants