-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Add initial .devcontainer for go 1.19 #15383
Conversation
cc @ahrtr |
Thanks @jmhbnz A quick question, did you follow https://github.com/devcontainers/cli#try-out-the-cli ? |
Yep - works great :) See below - running from the root of cloned etcd directory that has this james feat/add_devcon..
➜ devcontainer up --workspace-folder .
[10 ms] @devcontainers/cli 0.31.0. Node.js v19.7.0. linux 6.1.11-76060111-generic x64.
{"outcome":"success","containerId":"62b00884d2852165077a28d131c1a898e3bbfc0251e469d705e648675621884f","remoteUser":"vscode","rem
oteWorkspaceFolder":"/workspaces/etcd"}
james feat/add_devcon.. 22:17:49
➜ devcontainer exec --workspace-folder . make build
GO_BUILD_FLAGS=" -v" ./scripts/build.sh
Running etcd_build
% 'rm' '-f' 'bin/etcd'
% (cd server && 'env' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS= -v' 'GOOS=' 'GOARCH=' 'go' 'build' '-v' '-trimpath' '-installsuffix=cgo' '-ldflags=-X=go.etcd.io/etcd/api/v3/version.GitSHA=f2bd3154a' '-o=../bin/etcd' '.')
stderr: go.etcd.io/etcd/server/v3
% 'rm' '-f' 'bin/etcdutl'
% (cd etcdutl && 'env' 'GO_BUILD_FLAGS= -v' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS= -v' 'GOOS=' 'GOARCH=' 'go' 'build' '-v' '-trimpath' '-installsuffix=cgo' '-ldflags=-X=go.etcd.io/etcd/api/v3/version.GitSHA=f2bd3154a' '-o=../bin/etcdutl' '.')
stderr: go.etcd.io/etcd/etcdutl/v3
% 'rm' '-f' 'bin/etcdctl'
% (cd etcdctl && 'env' 'GO_BUILD_FLAGS= -v' 'CGO_ENABLED=0' 'GO_BUILD_FLAGS= -v' 'GOOS=' 'GOARCH=' 'go' 'build' '-v' '-trimpath' '-installsuffix=cgo' '-ldflags=-X=go.etcd.io/etcd/api/v3/version.GitSHA=f2bd3154a' '-o=../bin/etcdctl' '.')
stderr: go.etcd.io/etcd/etcdctl/v3
SUCCESS: etcd_build (GOARCH=)
./bin/etcd --version
etcd Version: 3.6.0-alpha.0
Git SHA: f2bd3154a
Go Version: go1.19.6
Go OS/Arch: linux/amd64
./bin/etcdctl version
etcdctl version: 3.6.0-alpha.0
API version: 3.6
./bin/etcdutl version
etcdutl version: 3.6.0-alpha.0
API version: 3.6
{"outcome":"success"}
|
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.
Please @craiglpeters take a look, thx
When the devcontainer starts it will run make build to ensure compiled binaries are immediately available for use. I've confirmed make test is also behaving as expected within the devcontainer. Signed-off-by: James Blair <mail@jamesblair.net>
f2bd315
to
9783253
Compare
Thanks both @craiglpeters and @jkeech , could you please approve this PR if no any other objections or comments? |
LGTM. I don't think we need to engage github engineers for low-risk and streightforward use-case. |
Thank you @jkeech |
When the devcontainer starts it will run
make build
to ensure compiled etcd binaries are immediately available for use.I've confirmed
make test
is also successfully running unit and integration tests within the container.Standard etcd ports are forwarded in-case the user wants to interact with the etcd components from outside the container.
This is just an initial proposal and creates a foundation that other contributors can add to moving forward.
Fixes #15377