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

Log docker server info #548

Merged
merged 5 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
"os"
"os/exec"
"path/filepath"
"reflect"
"runtime"
"strings"
"time"

Expand All @@ -32,6 +34,7 @@ import (
"github.com/magiconair/properties"
"github.com/moby/term"
specs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/shirou/gopsutil/v3/mem"
mdelapenya marked this conversation as resolved.
Show resolved Hide resolved

"github.com/testcontainers/testcontainers-go/wait"
)
Expand Down Expand Up @@ -770,9 +773,26 @@ func NewDockerProvider(provOpts ...DockerProviderOption) (*DockerProvider, error
config: tcConfig,
}

logDockerServerInfo(p)

return p, nil
}

func logDockerServerInfo(p *DockerProvider) {
type empty struct{}
info := `%v - Connected to docker:
Server Version: %v
API Version: %v
Operating System: %v
Total Memory: %v MB
`

sv, _ := p.client.ServerVersion(context.Background())
v, _ := mem.VirtualMemory()
mdelapenya marked this conversation as resolved.
Show resolved Hide resolved
p.Logger.Printf(info, reflect.TypeOf(empty{}).PkgPath(),
sv.Version, sv.APIVersion, runtime.GOOS, v.Total/1024/1024)
mdelapenya marked this conversation as resolved.
Show resolved Hide resolved
}

// configureTC reads from testcontainers properties file, if it exists
// it is possible that certain values get overridden when set as environment variables
func configureTC() TestContainersConfig {
Expand Down
51 changes: 44 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,63 @@ go 1.18

require (
github.com/cenkalti/backoff/v4 v4.1.3
github.com/containerd/cgroups v1.0.4 // indirect
github.com/containerd/containerd v1.6.8
github.com/containerd/continuity v0.3.0 // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker v20.10.17+incompatible
github.com/docker/go-connections v0.4.0
github.com/docker/go-units v0.5.0
github.com/go-redis/redis/v8 v8.11.5
github.com/go-sql-driver/mysql v1.6.0
github.com/google/uuid v1.3.0
github.com/magiconair/properties v1.8.6
github.com/moby/sys/mount v0.3.3 // indirect
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799
github.com/opencontainers/runc v1.1.3 // indirect
github.com/shirou/gopsutil/v3 v3.22.9
github.com/stretchr/testify v1.8.0
golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 // indirect
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8
google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad // indirect
gopkg.in/yaml.v3 v3.0.1
gotest.tools/gotestsum v1.8.2
gotest.tools/v3 v3.3.0
)

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/Microsoft/hcsshim v0.9.4 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/containerd/cgroups v1.0.4 // indirect
github.com/containerd/continuity v0.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dnephin/pflag v1.0.7 // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/moby/sys/mount v0.3.3 // indirect
github.com/moby/sys/mountinfo v0.6.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/runc v1.1.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 // indirect
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect
golang.org/x/tools v0.1.11 // indirect
google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad // indirect
google.golang.org/grpc v1.47.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
)
Loading