Skip to content

Feat: enable remote debugging with minikube#4341

Merged
markmandel merged 14 commits intoagones-dev:mainfrom
lacroixthomas:features/enhance-debug-mode-with-minikube
Dec 5, 2025
Merged

Feat: enable remote debugging with minikube#4341
markmandel merged 14 commits intoagones-dev:mainfrom
lacroixthomas:features/enhance-debug-mode-with-minikube

Conversation

@lacroixthomas
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 documentation
/kind feature

What this PR does / Why we need it:
Enable remote debugging with minikube locally

Which issue(s) this PR fixes:

Closes #4340

Special notes for your reviewer:

@github-actions github-actions bot added the kind/documentation Documentation for Agones label Nov 20, 2025
@lacroixthomas
Copy link
Copy Markdown
Collaborator Author

This is in Work in progress, still need to update things around the agones-sdk, not sure if it's possible to add the option to debug it

@lacroixthomas lacroixthomas marked this pull request as draft November 20, 2025 18:26
@agones-bot
Copy link
Copy Markdown
Collaborator

Build Failed 😭

Build Id: 0a00fd05-b822-42a7-a796-0880841e1776

Status: FAILURE

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

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: c31bb841-be9a-4fa1-aed6-f583fd91ae23

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/4341/head:pr_4341 && git checkout pr_4341
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.54.0-dev-3d196bf

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Failed 😭

Build Id: f9d969c3-0bf8-46f5-afe9-38c24c26870d

Status: FAILURE

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

@lacroixthomas lacroixthomas force-pushed the features/enhance-debug-mode-with-minikube branch from f422940 to 9cfdf55 Compare November 27, 2025 01:56
@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: 4fdf098a-33e4-4202-baed-27a64aa8e5f0

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/4341/head:pr_4341 && git checkout pr_4341
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.54.0-dev-7c21c62

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: b6219f42-2f74-4bb4-9443-b6d79bcefd64

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/4341/head:pr_4341 && git checkout pr_4341
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.54.0-dev-e0f933e

@github-actions
Copy link
Copy Markdown

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@lacroixthomas lacroixthomas marked this pull request as ready for review November 28, 2025 22:54
@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: 9c5a1a36-82e8-49a1-9ee6-519129b11b82

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/4341/head:pr_4341 && git checkout pr_4341
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.54.0-dev-a4f1b8f

Copy link
Copy Markdown
Collaborator

@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.

Exciting stuff. We've kinda blended the two projects into one PR, but I think both are close enough to being done that it's not worth splitting at this point.

@@ -1,4 +1,4 @@
# Developing, Testing and Building Agones
# Agones Development Documentation
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.

Love this split - makes things so much more approachable!

build/README.md Outdated

#### make helm-repo-update
# Run tests and build images
make test-go build-images
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.

Suggested change
make test-go build-images
make lint test-go build-images

Since linting is not included in test-go ?

build/README.md Outdated
Create GKE cluster and install current version of agones.
The current version should be built and pushed to `$(REGISTRY)` beforehand:
# Run end-to-end tests
make test-e2e
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.

Suggested change
make test-e2e

Shall we delete this, since it won't work on minikube?

The current version should be built and pushed to `$(REGISTRY)` beforehand:
# Run end-to-end tests
make test-e2e
make minikube-test-e2e
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.

Suggested change
make minikube-test-e2e
# This takes a _while_, so run at your peril!
make minikube-test-e2e

Given how comprehensive and long e2e tests take, this definitely needs a warning I figure?

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.

Ooh yep definitively, maybe I will add an example as well to run a single e2e locally (to avoid running them all)

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.

I was debating this. There are some e2e tests that definitely need more than one node to complete too. Although I don't think we have a make target that let's you pick just one e2e test? (maybe we should).

Copy link
Copy Markdown
Collaborator Author

@lacroixthomas lacroixthomas Dec 3, 2025

Choose a reason for hiding this comment

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

It should works with a single one: https://github.com/googleforgames/agones/blob/main/build/README.md#make-test-e2e-integration
It's what I'm using, basically it will run the 4 from https://github.com/googleforgames/agones/blob/main/build/Makefile#L326 and will match the one you put in the args

But I can definitively put the number of nodes to 2 for the make minikube-test-cluster!


## Performance and Profiling Issues

### I want to use pprof to profile the controller.
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.

Should we move this pprof guide to development-workflow.md? Seems like it would be a good fit?

@@ -0,0 +1,490 @@
# Make Reference Guide
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.

Not for now - but we should at some point explore having this not be so manual.


# Push debug images to minikube
# This will load the debug images and retag them to the normal tag
minikube-push-debug:
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.

🤔 random thought - rather than having explicit debug image tags, could/should we reuse the standard tags instead? Then it's just the as pushing via the regular commands, and there is less Makefile targets to maintain?

Basically the same as what we do for pprof builds?

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.

Totally, that would make things clearer / avoid duplications everywhere etc.
Gonna get rid of all the *_debug_tag and use the original one (and also remove this minikube-push-debug 👌🏼

build/Makefile Outdated
Comment on lines +509 to +513
# Build controller with debug symbols for debugging
build-controller-debug-binary: $(ensure-build-image)
$(GO_BUILD_LINUX_AMD64) \
-tags $(GO_BUILD_TAGS) -gcflags="all=-N -l" -o $(go_build_base_path)/cmd/controller/bin/controller.linux.amd64 \
$(go_rebuild_flags) $(go_version_flags) -installsuffix cgo $(agones_package)/cmd/controller
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.

Suggested change
# Build controller with debug symbols for debugging
build-controller-debug-binary: $(ensure-build-image)
$(GO_BUILD_LINUX_AMD64) \
-tags $(GO_BUILD_TAGS) -gcflags="all=-N -l" -o $(go_build_base_path)/cmd/controller/bin/controller.linux.amd64 \
$(go_rebuild_flags) $(go_version_flags) -installsuffix cgo $(agones_package)/cmd/controller
# Build controller with debug symbols for debugging
build-controller-debug-binary: GO_BUILD_TAGS += "-gcflags="all=-N -l""
build-controller-debug-binary: build-controller-binary-linux-amd64

This looks close enough to make build-controller-binary-linux-amd64 that I think this might work (I haven't tested it though), and shrink maintenance paths. (same for the other targets as well). Worth a shot to avoid duplication.

Similar to what we do here:

https://github.com/lacroixthomas/agones/blob/a4f1b8f0791c66467e677ecaa5744cd32edcb00a/build/includes/minikube.mk#L91-L93

# See the License for the specific language governing permissions and
# limitations under the License.

FROM gcr.io/distroless/static-debian12:nonroot as base
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.

My kingdom for some kind of Docker include, but alas it does not exist.

@github-actions
Copy link
Copy Markdown

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@github-actions
Copy link
Copy Markdown

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@lacroixthomas
Copy link
Copy Markdown
Collaborator Author

Exciting stuff. We've kinda blended the two projects into one PR, but I think both are close enough to being done that it's not worth splitting at this point.

I should definitively have done it in 2 PRs, would have been simpler to review my bad 😅

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 1, 2025

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: 7b49d06a-856f-4c32-ab9c-1c67b6e0f902

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/4341/head:pr_4341 && git checkout pr_4341
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.54.0-dev-56246bf

Copy link
Copy Markdown
Collaborator

@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.

Looking good - just a couple of outstanding bits.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 3, 2025

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 3, 2025

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@lacroixthomas
Copy link
Copy Markdown
Collaborator Author

Looking good - just a couple of outstanding bits.

Should be all good, github might be a bit funky around the comments about the make targets for the binary (it doesn't set them as outdated), but It's updated in the diff 😄

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: f2d1b85b-1018-4bec-95c7-1a415cadf8f8

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/4341/head:pr_4341 && git checkout pr_4341
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.54.0-dev-807bab3

@markmandel
Copy link
Copy Markdown
Collaborator

Nice work!

@markmandel markmandel enabled auto-merge (squash) December 5, 2025 04:03
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 5, 2025

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: 1d57e1bb-64ab-4265-909b-8067081c677e

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/4341/head:pr_4341 && git checkout pr_4341
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.54.0-dev-2215eec

@markmandel markmandel merged commit c60bb86 into agones-dev:main Dec 5, 2025
4 checks passed
mnthe pushed a commit to mnthe/agones that referenced this pull request Mar 23, 2026
* feat: enable remote debugging with minikube

* feat: allow agones-sdk in debug mode

* feat: pudate minikube port-forwards targets

* Feat: fix some minikube commands and update doc

* feat: split big readme from build in multiple ones

* feat: update doc / make targets

* feat: move pprof from troubleshooting to dev-workflow

* Feat: fix tags

* feat: update doc to create minikube cluters with 2 nodes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable remote debugging with breakpoints with Minikube

3 participants