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

Add initial .devcontainer for go 1.19 #15383

Merged
merged 1 commit into from
Mar 3, 2023

Conversation

jmhbnz
Copy link
Member

@jmhbnz jmhbnz commented Mar 1, 2023

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

@serathius
Copy link
Member

cc @ahrtr

@ahrtr
Copy link
Member

ahrtr commented Mar 2, 2023

Thanks @jmhbnz

A quick question, did you follow https://github.com/devcontainers/cli#try-out-the-cli ?

cc @craiglpeters

@jmhbnz
Copy link
Member Author

jmhbnz commented Mar 2, 2023

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 .devcontainer present:

 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"}

Copy link
Member

@ahrtr ahrtr left a 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>
@ahrtr
Copy link
Member

ahrtr commented Mar 2, 2023

Thanks both @craiglpeters and @jkeech , could you please approve this PR if no any other objections or comments?

@ptabor
Copy link
Contributor

ptabor commented Mar 3, 2023

LGTM. I don't think we need to engage github engineers for low-risk and streightforward use-case.

@ahrtr
Copy link
Member

ahrtr commented Mar 3, 2023

Thank you @jkeech

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Support for Codespaces and remote container development
6 participants