googleforgames / open-saves

Open Saves is a cloud native data store for game development.
Apache License 2.0
220 stars 23 forks source link

feat: Bump Up datastore dep to v1.17.0 and Golang version to 1.21 #446

Closed Zurvarian closed 3 months ago

Zurvarian commented 3 months ago

What type of PR is this?

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

/kind fix /kind build /kind chore /kind ci /kind docs /kind style /kind refactor /kind perf /kind test

/kind feat

What this PR does / Why we need it: It increases the version of the Datastore dependency to v1.17.0 and Golang version to 1.21 This required to have access to Datastore traces in OpenTelemetry.

Which issue(s) this PR fixes:

Closes #445

Special notes for your reviewer: Tested locally, here is an example of the new traces being exposed. imagen

Note that sensible details have been removed.

vasconcelosvcd commented 3 months ago

/gcbrun

ghost commented 3 months ago

@Zurvarian

From the go.mod:

go 1.21
toolchain go1.21.9

The build container is complaining about an invalid statement with toolchain:

Step #3: go build -o build/server cmd/server/main.go
Step #3: go: errors parsing go.mod:
Step #3: /workspace/go.mod:5: unknown directive: toolchain
Step #3: make: *** [Makefile:48: build/server] Error 1

I suspect that we will need to ask google to create a new build container with the 1.21 golang version and toolchain for the CI pipeline to pass.

vasconcelosvcd commented 3 months ago

@Zurvarian

From the go.mod:

go 1.21
toolchain go1.21.9

The build container is complaining about an invalid statement with toolchain:

Step #3: go build -o build/server cmd/server/main.go
Step #3: go: errors parsing go.mod:
Step #3: /workspace/go.mod:5: unknown directive: toolchain
Step #3: make: *** [Makefile:48: build/server] Error 1

I suspect that we will need to ask google to create a new build container with the 1.21 golang version and toolchain for the CI pipeline to pass.

@loranger2k @Zurvarian I think it's a matter of upgrading the cloudrun job file here

https://github.com/googleforgames/open-saves/blob/cec978851b6b6d0fe5479271d9c6a48f5448fd80/cloudbuild.yaml#L49C17-L49C23

Zurvarian commented 3 months ago

Thanks for the updates, I missed the builder part.

Indeed the toolchain is a new feature from Golang 1.21 on-wards, meant to fix the exact version the code must be compiled with. I did fix this in the Docker image, but wasn't aware of the builder.

Once we have a compatible builder I'll update the file mentioned by @vasconcelosvcd

mbychkowski commented 3 months ago

@Zurvarian just updated the golang builder to 1.21.

I think you will also need to update the cloudbuild.yaml in this PR for _BUILDER variable to 1.21

Then we can retry the build

Zurvarian commented 3 months ago

/gcbrun

vasconcelosvcd commented 3 months ago

/gcbrun

vasconcelosvcd commented 3 months ago

/gcbrun