Skip to content

Commit

Permalink
go_deps: upgrade docker, pgx and jwx (#6224)
Browse files Browse the repository at this point in the history
  • Loading branch information
sluongng committed Mar 25, 2024
1 parent cfcb474 commit eea1869
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 84 deletions.
25 changes: 0 additions & 25 deletions buildpatches/docker-host.patch

This file was deleted.

65 changes: 40 additions & 25 deletions deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,12 @@ def install_go_mod_dependencies(workspace_name = "buildbuddy"):
sum = "h1:WSf9o9EQ0KGHiUx2ESFZ+PKf4nxK9BcvV/nJDX8RkB4=",
version = "v1.1.7",
)
go_repository(
name = "com_github_containerd_log",
importpath = "github.com/containerd/log",
sum = "h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=",
version = "v0.1.0",
)
go_repository(
name = "com_github_containerd_nri",
importpath = "github.com/containerd/nri",
Expand Down Expand Up @@ -1280,6 +1286,12 @@ def install_go_mod_dependencies(workspace_name = "buildbuddy"):
sum = "h1:RMLoZVzv4GliuWafOuPuQDKSm1SJph7uCRnnS61JAn4=",
version = "v0.0.0-20181026042036-e10d5fee7954",
)
go_repository(
name = "com_github_distribution_reference",
importpath = "github.com/distribution/reference",
sum = "h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=",
version = "v0.5.0",
)
go_repository(
name = "com_github_djarvur_go_err113",
importpath = "github.com/Djarvur/go-err113",
Expand Down Expand Up @@ -1326,11 +1338,8 @@ def install_go_mod_dependencies(workspace_name = "buildbuddy"):
go_repository(
name = "com_github_docker_docker",
importpath = "github.com/docker/docker",
# TODO(sluongng): remove this patch once https://github.com/moby/moby/issues/45935 is fixed.
patch_args = ["-p1"],
patches = ["@{}//buildpatches:docker-host.patch".format(workspace_name)],
sum = "h1:eATx+oLz9WdNVkQrr0qjQ8HvRJ4bOOxfzEo8R+dA3cg=",
version = "v24.0.2+incompatible",
sum = "h1:Ng2qi+gdKADUa/VM+6b6YaY2nlZhk/lVJiKR/2bMudU=",
version = "v26.0.0+incompatible",
)
go_repository(
name = "com_github_docker_docker_credential_helpers",
Expand Down Expand Up @@ -2795,8 +2804,8 @@ def install_go_mod_dependencies(workspace_name = "buildbuddy"):
go_repository(
name = "com_github_jackc_pgx_v5",
importpath = "github.com/jackc/pgx/v5",
sum = "h1:oKfB/FhuVtit1bBM3zNRRsZ925ZkMN3HXL+LgLUM9lE=",
version = "v5.4.1",
sum = "h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw=",
version = "v5.5.5",
)
go_repository(
name = "com_github_jackc_puddle",
Expand All @@ -2807,8 +2816,8 @@ def install_go_mod_dependencies(workspace_name = "buildbuddy"):
go_repository(
name = "com_github_jackc_puddle_v2",
importpath = "github.com/jackc/puddle/v2",
sum = "h1:RdcDk92EJBuBS55nQMMYFXTxwstHug4jkhT5pq8VxPk=",
version = "v2.2.0",
sum = "h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk=",
version = "v2.2.1",
)
go_repository(
name = "com_github_jbenet_go_context",
Expand Down Expand Up @@ -3268,8 +3277,8 @@ def install_go_mod_dependencies(workspace_name = "buildbuddy"):
go_repository(
name = "com_github_lestrrat_go_blackmagic",
importpath = "github.com/lestrrat-go/blackmagic",
sum = "h1:lS5Zts+5HIC/8og6cGHb0uCcNCa3OUt1ygh3Qz2Fe80=",
version = "v1.0.1",
sum = "h1:Cg2gVSc9h7sz9NOByczrbUvLopQmXrfFx//N+AkAr5k=",
version = "v1.0.2",
)
go_repository(
name = "com_github_lestrrat_go_httpcc",
Expand All @@ -3286,8 +3295,8 @@ def install_go_mod_dependencies(workspace_name = "buildbuddy"):
go_repository(
name = "com_github_lestrrat_go_jwx",
importpath = "github.com/lestrrat-go/jwx",
sum = "h1:4iFo8FPRZGDYe1t19mQP0zTRqA7n8HnJ5lkIiDvJcB0=",
version = "v1.2.26",
sum = "h1:QT0utmUJ4/12rmsVQrJ3u55bycPkKqGYuGT4tyRhxSQ=",
version = "v1.2.29",
)
go_repository(
name = "com_github_lestrrat_go_option",
Expand Down Expand Up @@ -3700,6 +3709,12 @@ def install_go_mod_dependencies(workspace_name = "buildbuddy"):
sum = "h1:nAco9/aI9Lg2kiuROBY6BhCI/z0t5jEvJfjWbL8qXLU=",
version = "v0.5.0",
)
go_repository(
name = "com_github_moby_docker_image_spec",
importpath = "github.com/moby/docker-image-spec",
sum = "h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=",
version = "v1.3.1",
)
go_repository(
name = "com_github_moby_locker",
importpath = "github.com/moby/locker",
Expand Down Expand Up @@ -4569,14 +4584,14 @@ def install_go_mod_dependencies(workspace_name = "buildbuddy"):
go_repository(
name = "com_github_stretchr_objx",
importpath = "github.com/stretchr/objx",
sum = "h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=",
version = "v0.5.0",
sum = "h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=",
version = "v0.5.2",
)
go_repository(
name = "com_github_stretchr_testify",
importpath = "github.com/stretchr/testify",
sum = "h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=",
version = "v1.8.4",
sum = "h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=",
version = "v1.9.0",
)
go_repository(
name = "com_github_subosito_gotenv",
Expand Down Expand Up @@ -6371,8 +6386,8 @@ def install_go_mod_dependencies(workspace_name = "buildbuddy"):
go_repository(
name = "org_golang_x_crypto",
importpath = "golang.org/x/crypto",
sum = "h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=",
version = "v0.18.0",
sum = "h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=",
version = "v0.21.0",
)
go_repository(
name = "org_golang_x_exp",
Expand Down Expand Up @@ -6413,8 +6428,8 @@ def install_go_mod_dependencies(workspace_name = "buildbuddy"):
go_repository(
name = "org_golang_x_net",
importpath = "golang.org/x/net",
sum = "h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=",
version = "v0.20.0",
sum = "h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=",
version = "v0.21.0",
)
go_repository(
name = "org_golang_x_oauth2",
Expand All @@ -6431,14 +6446,14 @@ def install_go_mod_dependencies(workspace_name = "buildbuddy"):
go_repository(
name = "org_golang_x_sys",
importpath = "golang.org/x/sys",
sum = "h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=",
version = "v0.16.0",
sum = "h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=",
version = "v0.18.0",
)
go_repository(
name = "org_golang_x_term",
importpath = "golang.org/x/term",
sum = "h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE=",
version = "v0.16.0",
sum = "h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=",
version = "v0.18.0",
)
go_repository(
name = "org_golang_x_text",
Expand Down
1 change: 1 addition & 0 deletions enterprise/server/remote_execution/containers/docker/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ go_library(
"//server/util/status",
"@com_github_docker_docker//api/types",
"@com_github_docker_docker//api/types/container",
"@com_github_docker_docker//api/types/registry",
"@com_github_docker_docker//client",
"@com_github_docker_docker//pkg/stdcopy",
"@com_github_docker_go_units//:go-units",
Expand Down
15 changes: 8 additions & 7 deletions enterprise/server/remote_execution/containers/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/buildbuddy-io/buildbuddy/server/util/log"
"github.com/buildbuddy-io/buildbuddy/server/util/random"
"github.com/buildbuddy-io/buildbuddy/server/util/status"
"github.com/docker/docker/api/types/registry"
"github.com/docker/docker/pkg/stdcopy"
"golang.org/x/sync/errgroup"
"google.golang.org/grpc/codes"
Expand Down Expand Up @@ -236,7 +237,7 @@ func (r *dockerCommandContainer) Run(ctx context.Context, command *repb.Command,
}
cid := createResponse.ID

hijackedResp, err := r.client.ContainerAttach(ctx, cid, dockertypes.ContainerAttachOptions{
hijackedResp, err := r.client.ContainerAttach(ctx, cid, dockercontainer.AttachOptions{
Stream: true,
Stdout: true,
Stderr: true,
Expand All @@ -247,7 +248,7 @@ func (r *dockerCommandContainer) Run(ctx context.Context, command *repb.Command,
}
defer hijackedResp.Close()

err = r.client.ContainerStart(ctx, cid, dockertypes.ContainerStartOptions{})
err = r.client.ContainerStart(ctx, cid, dockercontainer.StartOptions{})
if err != nil {
result.Error = wrapDockerErr(err, "failed to start docker container")
return result
Expand All @@ -268,7 +269,7 @@ func (r *dockerCommandContainer) Run(ctx context.Context, command *repb.Command,
log.Errorf("Failed to kill docker container: %s", err)
}
}
if err := r.client.ContainerRemove(ctx, cid, dockertypes.ContainerRemoveOptions{}); err != nil {
if err := r.client.ContainerRemove(ctx, cid, dockercontainer.RemoveOptions{}); err != nil {
log.Errorf("Failed to remove docker container: %s", err)
}
}()
Expand Down Expand Up @@ -484,7 +485,7 @@ func (r *dockerCommandContainer) PullImage(ctx context.Context, creds oci.Creden

func PullImage(ctx context.Context, client *dockerclient.Client, image string, creds oci.Credentials) error {
if !creds.IsEmpty() {
authCfg := dockertypes.AuthConfig{
authCfg := registry.AuthConfig{
Username: creds.Username,
Password: creds.Password,
}
Expand Down Expand Up @@ -576,7 +577,7 @@ func (r *dockerCommandContainer) create(ctx context.Context, workDir string) err
return wrapDockerErr(err, "failed to create container")
}
r.id = createResponse.ID
if err := r.client.ContainerStart(ctx, r.id, dockertypes.ContainerStartOptions{}); err != nil {
if err := r.client.ContainerStart(ctx, r.id, dockercontainer.StartOptions{}); err != nil {
return wrapDockerErr(err, "failed to start container")
}
r.workDir = workDir
Expand Down Expand Up @@ -694,7 +695,7 @@ func (r *dockerCommandContainer) Pause(ctx context.Context) error {

func (r *dockerCommandContainer) Remove(ctx context.Context) error {
r.removed = true
if err := r.client.ContainerRemove(ctx, r.id, dockertypes.ContainerRemoveOptions{Force: true}); err != nil {
if err := r.client.ContainerRemove(ctx, r.id, dockercontainer.RemoveOptions{Force: true}); err != nil {
return wrapDockerErr(err, fmt.Sprintf("failed to remove docker container %s", r.id))
}
return nil
Expand Down Expand Up @@ -739,7 +740,7 @@ type statsResponse struct {
}

// encodeAuthToBase64 serializes the auth configuration as JSON base64 payload
func encodeAuthToBase64(authConfig dockertypes.AuthConfig) (string, error) {
func encodeAuthToBase64(authConfig registry.AuthConfig) (string, error) {
buf, err := json.Marshal(authConfig)
if err != nil {
return "", err
Expand Down
22 changes: 13 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ require (
github.com/creack/pty v1.1.18
github.com/crewjam/saml v0.4.14
github.com/docker/distribution v2.8.2+incompatible
github.com/docker/docker v24.0.2+incompatible
github.com/docker/docker v26.0.0+incompatible
github.com/docker/go-units v0.5.0
github.com/dop251/goja v0.0.0-20230626124041-ba8a63e79201
github.com/elastic/gosigar v0.14.2
Expand All @@ -80,14 +80,14 @@ require (
github.com/hashicorp/memberlist v0.5.0
github.com/hashicorp/serf v0.10.1
github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa
github.com/jackc/pgx/v5 v5.4.1
github.com/jackc/pgx/v5 v5.5.5
github.com/jhump/protoreflect v1.15.1
github.com/jonboulle/clockwork v0.4.0
github.com/jotfs/fastcdc-go v0.2.0
github.com/jsimonetti/rtnetlink v1.3.3
github.com/klauspost/compress v1.17.2
github.com/klauspost/cpuid v1.2.1
github.com/lestrrat-go/jwx v1.2.26
github.com/lestrrat-go/jwx v1.2.29
github.com/lni/dragonboat/v4 v4.0.0-00010101000000-000000000000
github.com/lni/goutils v1.3.1-0.20220604063047-388d67b4dbc4
github.com/logrusorgru/aurora v2.0.3+incompatible
Expand All @@ -113,7 +113,7 @@ require (
github.com/shurcooL/githubv4 v0.0.0-20231126234147-1cffa1f02456
github.com/sirupsen/logrus v1.9.3
github.com/smacker/go-tree-sitter v0.0.0-20230501083651-a7d92773b3aa
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.9.0
github.com/tebeka/selenium v0.9.9
github.com/throttled/throttled/v2 v2.12.0
github.com/tink-crypto/tink-go-awskms/v2 v2.0.0
Expand All @@ -132,12 +132,12 @@ require (
go.opentelemetry.io/otel/sdk v1.21.0
go.opentelemetry.io/otel/trace v1.22.0
go.uber.org/atomic v1.11.0
golang.org/x/crypto v0.18.0
golang.org/x/crypto v0.21.0
golang.org/x/exp v0.0.0-20231127185646-65229373498e
golang.org/x/mod v0.14.0
golang.org/x/oauth2 v0.16.0
golang.org/x/sync v0.6.0
golang.org/x/sys v0.16.0
golang.org/x/sys v0.18.0
golang.org/x/text v0.14.0
golang.org/x/time v0.5.0
golang.org/x/tools v0.16.0
Expand Down Expand Up @@ -204,6 +204,7 @@ require (
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/containerd/fifo v1.1.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
github.com/containernetworking/cni v1.1.2 // indirect
github.com/containernetworking/plugins v1.3.0 // indirect
Expand All @@ -212,6 +213,7 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
github.com/docker/cli v24.0.2+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
Expand Down Expand Up @@ -267,6 +269,7 @@ require (
github.com/imdario/mergo v0.3.16 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jinzhu/configor v1.2.1 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
Expand All @@ -281,7 +284,7 @@ require (
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect
github.com/lestrrat-go/blackmagic v1.0.1 // indirect
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
Expand All @@ -300,6 +303,7 @@ require (
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/oklog/ulid v1.3.1 // indirect
Expand Down Expand Up @@ -334,8 +338,8 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/term v0.16.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/tools/go/vcs v0.1.0-deprecated // indirect
google.golang.org/appengine v1.6.8 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
Expand Down

0 comments on commit eea1869

Please sign in to comment.