-
Notifications
You must be signed in to change notification settings - Fork 10
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
Docker file #45
Docker file #45
Conversation
.github/workflows/deploy.yml
Outdated
@@ -2,8 +2,8 @@ name: "Deploy EVM Gateway to Cloud Run" | |||
|
|||
on: | |||
push: | |||
branches: | |||
- main | |||
# branches: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intentional? Do we want them to be commented-out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll revert these changes, they were only for testing
@@ -45,7 +45,7 @@ func TestServerJSONRPCOveHTTPHandler(t *testing.T) { | |||
blockchainAPI := api.NewBlockChainAPI(config, store, mockFlowClient) | |||
supportedAPIs := api.SupportedAPIs(blockchainAPI) | |||
srv.EnableRPC(supportedAPIs) | |||
srv.SetListenAddr("localhost", 8545) | |||
srv.SetListenAddr("", 8545) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious, did you encounter a problem with "localhost"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, there was an issue in cloud run
it's a specific requirement for cloud run
The ingress container within an instance must listen for requests on 0.0.0.0 on the port to which requests are sent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar comment as above about the port needing to be an injected variable
Dockerfile
Outdated
RUN CGO_ENABLED=0 go build -o evm-gateway ./cmd/server/main.go | ||
RUN chmod a+x evm-gateway | ||
RUN chmod a+x ./scripts/run.sh | ||
RUN git clone https://github.com/m-Peter/flow-cli-custom-builds.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, I run into a glitch the first time building the image locally:
> [builder 10/10] RUN git clone https://github.com/m-Peter/flow-cli-custom-builds.git:
0.344 Cloning into 'flow-cli-custom-builds'...
66.27 error: 3872 bytes of body are still expected
66.28 fetch-pack: unexpected disconnect while reading sideband packet
66.29 fatal: early EOF
66.31 fatal: fetch-pack: invalid index-pack output
------
ERROR: failed to solve: executor failed running [/bin/sh -c git clone https://github.com/m-Peter/flow-cli-custom-builds.git]: exit code: 128
Maybe another alternative could be:
RUN wget https://github.com/m-Peter/flow-cli-custom-builds/raw/main/flow-x86_64-linux-
RUN chmod a+x flow-x86_64-linux-
With the 2nd attempt, I was able to build the image and run a container, so it is not a big deal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
I built an image locally and ran the container. It worked very well 👏
COPY --from=builder /flow-evm-gateway/flow.json /flow-evm-gateway/flow.json | ||
COPY --from=builder /flow-evm-gateway/api/cadence/transactions/create_bridged_account.cdc /flow-evm-gateway/create_bridged_account.cdc | ||
COPY --from=builder /flow-evm-gateway/scripts/run.sh /flow-evm-gateway/run.sh | ||
EXPOSE 8545 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to expose this so it can be templated and set externally
@@ -45,7 +45,7 @@ func TestServerJSONRPCOveHTTPHandler(t *testing.T) { | |||
blockchainAPI := api.NewBlockChainAPI(config, store, mockFlowClient) | |||
supportedAPIs := api.SupportedAPIs(blockchainAPI) | |||
srv.EnableRPC(supportedAPIs) | |||
srv.SetListenAddr("localhost", 8545) | |||
srv.SetListenAddr("", 8545) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar comment as above about the port needing to be an injected variable
@@ -460,7 +460,7 @@ func TestServerJSONRPCOveWebSocketHandler(t *testing.T) { | |||
blockchainAPI := api.NewBlockChainAPI(config, store, flowClient) | |||
supportedAPIs := api.SupportedAPIs(blockchainAPI) | |||
srv.EnableWS(supportedAPIs) | |||
srv.SetListenAddr("localhost", 8545) | |||
srv.SetListenAddr("", 8545) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment
@@ -182,7 +182,7 @@ func runServer(config *api.Config, store *storage.Store, logger zerolog.Logger) | |||
srv.EnableRPC(supportedAPIs) | |||
srv.EnableWS(supportedAPIs) | |||
|
|||
srv.SetListenAddr("localhost", 8545) | |||
srv.SetListenAddr("", 8545) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same again
|
||
# Run the second process | ||
|
||
./flow-x86_64-linux- transactions send /flow-evm-gateway/create_bridged_account.cdc 1500.0 --network=emulator --signer=emulator-account && ./evm-gateway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need to be able to pass in the network to be used, whether emulator or other network
Closes: #???
Description
Dockerfile for a build to deploy
For contributor use:
master
branchFiles changed
in the Github PR explorer