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

Tutorial: How to build a basic Matchmaker cannot build container image #1470

Closed
govargo opened this issue Jul 1, 2022 · 7 comments
Closed
Labels
area/developer-experience This issue impacts developer experience when building a Matchmaker using Open Match kind/bug Something isn't working
Milestone

Comments

@govargo
Copy link
Collaborator

govargo commented Jul 1, 2022

What happened:

I'm new to OpenMatch and I tried the first tutorial How to build a basic Matchmaker.
When I tried the building images of frontend, director, matchfunction, I could not build these with the error.

% docker build -t $REGISTRY/mm101-tutorial-frontend .
[+] Building 4.7s (9/9) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                                  0.0s
 => => transferring dockerfile: 740B                                                                                                                                                                  0.0s
 => [internal] load .dockerignore                                                                                                                                                                     0.0s
 => => transferring context: 2B                                                                                                                                                                       0.0s
 => [internal] load metadata for docker.io/library/golang:alpine                                                                                                                                      2.1s
 => [auth] library/golang:pull token for registry-1.docker.io                                                                                                                                         0.0s
 => [1/4] FROM docker.io/library/golang:alpine@sha256:7cc62574fcf9c5fb87ad42a9789d5539a6a085971d58ee75dd2ee146cb8a8695                                                                                0.0s
 => [internal] load build context                                                                                                                                                                     0.0s
 => => transferring context: 90.73kB                                                                                                                                                                  0.0s
 => CACHED [2/4] WORKDIR /app                                                                                                                                                                         0.0s
 => CACHED [3/4] COPY . .                                                                                                                                                                             0.0s
 => ERROR [4/4] RUN go build -o frontend .                                                                                                                                                            2.3s
------
 > [4/4] RUN go build -o frontend .:
#9 1.027 go: open-match.dev/open-match@v0.0.0-dev (replaced by ../../../): reading /go.mod: open /go.mod: no such file or directory
#9 1.030 go: downloading google.golang.org/grpc v1.36.0
#9 2.220 go: open-match.dev/open-match@v0.0.0-dev (replaced by ../../../): reading /go.mod: open /go.mod: no such file or directory
------
executor failed running [/bin/sh -c go build -o frontend .]: exit code: 1

What you expected to happen:

I can build the images of frontend, director, matchfunction.

How to reproduce it (as minimally and precisely as possible):

# ref: https://open-match.dev/site/docs/tutorials/matchmaker101/
REGISTRY=[MY_REGISTRY_URL]
git clone https://github.com/googleforgames/open-match.git
cd open-match
TUTORIALROOT=$(pwd)/tutorials/matchmaker101

kubectl create namespace mm101-tutorial

# ref: https://open-match.dev/site/docs/tutorials/matchmaker101/frontend/
# edit frontend/ticket.go, director/profile.go, matchfunction/mmf/matchfunction.go
cd $TUTORIALROOT
docker build -t $REGISTRY/mm101-tutorial-frontend frontend/

I described the frontend image, however, the director and matchfunction also have build problem.

Anything else we need to know?:

The reason why the build failed is go.mod specified open-match root directory, however, docker build context doesn't include the root directory.

# go.mod
replace open-match.dev/open-match v0.0.0-dev => ../../../  // this is targeted at root path of open-match

docker build command docker build -t $REGISTRY/mm101-tutorial-frontend frontend/ specifies only frontend/ directory.

To fix this, we have to fix build context path and file copy path.

I think this issue is similar to #1171.

Output of kubectl version:

Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.7", GitCommit:"1dd5338295409edcfff11505e7bb246f0d325d15", GitTreeState:"clean", BuildDate:"2021-01-13T13:23:52Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.3", GitCommit:"816c97ab8cff8a1c72eccca1026f7820e93e0d25", GitTreeState:"clean", BuildDate:"2022-01-25T21:19:12Z", GoVersion:"go1.17.6", Compiler:"gc", Platform:"linux/amd64"}

Cloud Provider/Platform (AKS, GKE, Minikube etc.):

Minikube v1.25.2

Open Match Release Version:

v1.24.0-rc

Install Method(yaml/helm):

YAML
https://open-match.dev/site/docs/installation/yaml/

@govargo govargo added the kind/bug Something isn't working label Jul 1, 2022
@govargo
Copy link
Collaborator Author

govargo commented Jul 1, 2022

I'll send PR to fix this.
I'll separte PR to this repository and site-docs repository.

@mridulji
Copy link
Contributor

mridulji commented Jul 1, 2022

Hey @govargo , Would you like to try once this tutorial on either release-1.4 or release-1.3 branch ?

@govargo
Copy link
Collaborator Author

govargo commented Jul 1, 2022

Thank you!
I tried release-1.3 and it works fine.

I didn't notice that release-1.X and main branch differ...
1.4: https://github.com/googleforgames/open-match/blob/release-1.4/tutorials/matchmaker101/frontend/Dockerfile
main: https://github.com/googleforgames/open-match/blob/main/tutorials/matchmaker101/frontend/Dockerfile

Is this as expected?

@mridulji
Copy link
Contributor

mridulji commented Jul 1, 2022

I didn't notice that release-1.X and main branch differ...

Yes, The documentation for tutorial instruction is to be updated very soon to try on release-x.y branch.

@govargo
Copy link
Collaborator Author

govargo commented Jul 2, 2022

Thank you. I already sent PR, but I'll update the PR to use release-x.y branch.

@govargo
Copy link
Collaborator Author

govargo commented Jul 4, 2022

I updated the PR to use release-x.y branch of Open Match Git repository.
googleforgames/open-match-docs#266

Thank you.

@mridulji
Copy link
Contributor

mridulji commented Jul 25, 2022

@govargo Thanks for the PR. Closing this issue as it is resolved.

@mridulji mridulji added this to the v1.5.0 milestone Aug 16, 2022
@mridulji mridulji added the area/developer-experience This issue impacts developer experience when building a Matchmaker using Open Match label Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/developer-experience This issue impacts developer experience when building a Matchmaker using Open Match kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants