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

Docs for running docker-compose locally with SDK and server #3390

Merged

Conversation

mbychkowski
Copy link
Contributor

What type of PR is this?

/kind documentation

What this PR does / Why we need it:
Simplify running Client SDK and game server locally for troubleshooting and testing by using Docker Compose to run both in one step.

Which issue(s) this PR fixes:
Relevant issue/comment

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 3bbf8e67-765b-4952-a115-dbf3f0055f3a

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/3390/head:pr_3390 && git checkout pr_3390
  • 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.35.0-dev-49ddc88-amd64

Copy link
Member

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

Yay! I've wanted this for ages!

- "127.0.0.1:7777:7777/udp"

sdk-server:
image: "us-docker.pkg.dev/agones-images/release/agones-sdk:1.34.0"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
image: "us-docker.pkg.dev/agones-images/release/agones-sdk:1.34.0"
image: "us-docker.pkg.dev/agones-images/release/agones-sdk:{{<release-version>}}"

Should work (I think 😃)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

version: '3'
services:
gameserver:
build: . # <location to your image here>
Copy link
Member

Choose a reason for hiding this comment

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

Is build a path to the image, or a path to the build context?

(Just looking at https://docs.docker.com/compose/compose-file/compose-file-v3/#build ?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, good question. build is to the context, but also defaults to assuming Dockerfile is at the root of that path. Happy to split this out to make more explicit for the docs like what is shown in that second example in your link. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated verbiage here to # <path to build context>

@@ -158,6 +158,34 @@ chmod o+r gameserver.yaml
docker run --network=host --rm -v $(pwd)/gameserver.yaml:/tmp/gameserver.yaml us-docker.pkg.dev/agones-images/release/agones-sdk:{{<release-version>}} --local -f /tmp/gameserver.yaml
```

If you would like to run the ClientSDK and your game server container together with Docker Compose create a `docker-compose.yaml` file.
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to add an extra note here that's something like...

Suggested change
If you would like to run the ClientSDK and your game server container together with Docker Compose create a `docker-compose.yaml` file.
if you run Docker on a OS that doesn't run Docker natively or in a VM, such as on Windows or macOS., you may want to to run the ClientSDK and your game server container together with Docker Compose . To do so, create a `docker-compose.yaml` file setup with a network overlay shared between them:

Just so people have a why on they might want to do this.

WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like, makes sense. Updated in latest commit.

sdk-server:
image: "us-docker.pkg.dev/agones-images/release/agones-sdk:1.34.0"
command: --local -f /gs_config
network_mode: service:gameserver
Copy link
Member

Choose a reason for hiding this comment

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

Wondering if we want an extra comment here explaining that this is the shared network?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a good idea. I added a comment in the code block pointing this out: # <shared network between sdk and game server>

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: c018a4d6-b192-44e3-ba60-58f4747aae22

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/3390/head:pr_3390 && git checkout pr_3390
  • 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.35.0-dev-fad9f27-amd64

@@ -158,6 +158,34 @@ chmod o+r gameserver.yaml
docker run --network=host --rm -v $(pwd)/gameserver.yaml:/tmp/gameserver.yaml us-docker.pkg.dev/agones-images/release/agones-sdk:{{<release-version>}} --local -f /tmp/gameserver.yaml
```

If you run Docker on a OS that doesn't run Docker natively or in a VM, such as on Windows or macOS, you may want to to run the ClientSDK and your game server container together with Docker Compose. To do so, create a `docker-compose.yaml` file setup with a network overlay shared between them:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
If you run Docker on a OS that doesn't run Docker natively or in a VM, such as on Windows or macOS, you may want to to run the ClientSDK and your game server container together with Docker Compose. To do so, create a `docker-compose.yaml` file setup with a network overlay shared between them:
If you run Docker on a OS that doesn't run Docker natively or in a VM, such as on Windows or macOS, you may want to to run the ClientSDK and your game server container together with [Docker Compose](https://docs.docker.com/compose/). To do so, create a `docker-compose.yaml` file setup with a network overlay shared between them:

One final improvement I'd like to see - otherwise, this is good to go 👍🏻

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 67808ebc-262c-4f24-9da4-487cd8f7d99d

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/3390/head:pr_3390 && git checkout pr_3390
  • 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.35.0-dev-b1cd568-amd64

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: markmandel, mbychkowski

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@markmandel markmandel enabled auto-merge (squash) September 29, 2023 20:56
@google-oss-prow google-oss-prow bot removed the lgtm label Sep 29, 2023
@google-oss-prow
Copy link

New changes are detected. LGTM label has been removed.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 66e21008-330c-4ca5-acd9-74d1593339f9

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/3390/head:pr_3390 && git checkout pr_3390
  • 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.36.0-dev-358c5e0-amd64

@markmandel markmandel merged commit 56c87de into googleforgames:main Sep 29, 2023
3 checks passed
@Kalaiselvi84 Kalaiselvi84 added kind/documentation Documentation for Agones and removed kind/other labels Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants