diff --git a/components/engine/Makefile b/components/engine/Makefile index 403c6792ee..7767409a6f 100644 --- a/components/engine/Makefile +++ b/components/engine/Makefile @@ -13,6 +13,12 @@ DOCKERFILE := $(shell bash -c 'source hack/make/.detect-daemon-osarch && echo $$ DOCKER_GITCOMMIT := $(shell git rev-parse --short HEAD || echo unsupported) export DOCKER_GITCOMMIT +# allow overriding the repository and branch that validation scripts are running +# against these are used in hack/validate/.validate to check what changed in the PR. +export VALIDATE_REPO +export VALIDATE_BRANCH +export VALIDATE_ORIGIN_BRANCH + # env vars passed through directly to Docker's build scripts # to allow things like `make KEEPBUNDLE=1 binary` easily # `project/PACKAGERS.md` have some limited documentation of some of these @@ -49,6 +55,9 @@ DOCKER_ENVS := \ -e TESTDIRS \ -e TESTFLAGS \ -e TIMEOUT \ + -e VALIDATE_REPO \ + -e VALIDATE_BRANCH \ + -e VALIDATE_ORIGIN_BRANCH \ -e HTTP_PROXY \ -e HTTPS_PROXY \ -e NO_PROXY \ diff --git a/components/engine/daemon/daemon_windows.go b/components/engine/daemon/daemon_windows.go index e534d7eccc..4be55b7b87 100644 --- a/components/engine/daemon/daemon_windows.go +++ b/components/engine/daemon/daemon_windows.go @@ -343,8 +343,10 @@ func (daemon *Daemon) initNetworkController(config *config.Config, activeSandbox controller.WalkNetworks(s) drvOptions := make(map[string]string) - + nid := "" if n != nil { + nid = n.ID() + // global networks should not be deleted by local HNS if n.Info().Scope() == datastore.GlobalScope { continue @@ -389,7 +391,7 @@ func (daemon *Daemon) initNetworkController(config *config.Config, activeSandbox } v6Conf := []*libnetwork.IpamConf{} - _, err := controller.NewNetwork(strings.ToLower(v.Type), name, "", + _, err := controller.NewNetwork(strings.ToLower(v.Type), name, nid, libnetwork.NetworkOptionGeneric(options.Generic{ netlabel.GenericData: netOption, }), diff --git a/components/engine/hack/make/.integration-daemon-start b/components/engine/hack/make/.integration-daemon-start index 20801fccee..dabcfbe262 100644 --- a/components/engine/hack/make/.integration-daemon-start +++ b/components/engine/hack/make/.integration-daemon-start @@ -3,7 +3,7 @@ # see test-integration for example usage of this script base="$ABS_DEST/.." -export PATH="$base/binary-daemon:$base/dynbinary-daemon:$PATH" +export PATH="$base/dynbinary-daemon:$base/binary-daemon:$PATH" export TEST_CLIENT_BINARY=docker diff --git a/components/engine/hack/validate/.validate b/components/engine/hack/validate/.validate index 32cb6b6d64..6ed3a59a73 100644 --- a/components/engine/hack/validate/.validate +++ b/components/engine/hack/validate/.validate @@ -6,13 +6,16 @@ if [ -z "$VALIDATE_UPSTREAM" ]; then # this is kind of an expensive check, so let's not do this twice if we # are running more than one validate bundlescript - VALIDATE_REPO='https://github.com/docker/docker.git' - VALIDATE_BRANCH='master' + VALIDATE_REPO="${VALIDATE_REPO:-https://github.com/docker/docker.git}" + VALIDATE_BRANCH="${VALIDATE_BRANCH:-master}" VALIDATE_HEAD="$(git rev-parse --verify HEAD)" - git fetch -q "$VALIDATE_REPO" "refs/heads/$VALIDATE_BRANCH" - VALIDATE_UPSTREAM="$(git rev-parse --verify FETCH_HEAD)" + if [ -z "$VALIDATE_ORIGIN_BRANCH" ]; then + git fetch -q "$VALIDATE_REPO" "refs/heads/$VALIDATE_BRANCH" + VALIDATE_ORIGIN_BRANCH=FETCH_HEAD + fi + VALIDATE_UPSTREAM="$(git rev-parse --verify $VALIDATE_ORIGIN_BRANCH)" VALIDATE_COMMIT_LOG="$VALIDATE_UPSTREAM..$VALIDATE_HEAD" VALIDATE_COMMIT_DIFF="$VALIDATE_UPSTREAM...$VALIDATE_HEAD" diff --git a/components/engine/integration-cli/docker_api_swarm_test.go b/components/engine/integration-cli/docker_api_swarm_test.go index 10b9938486..ddbcd56556 100644 --- a/components/engine/integration-cli/docker_api_swarm_test.go +++ b/components/engine/integration-cli/docker_api_swarm_test.go @@ -9,6 +9,7 @@ import ( "net" "net/http" "path/filepath" + "runtime" "strings" "sync" "time" @@ -294,6 +295,13 @@ func (s *DockerSwarmSuite) TestAPISwarmLeaderProxy(c *check.C) { } func (s *DockerSwarmSuite) TestAPISwarmLeaderElection(c *check.C) { + if runtime.GOARCH == "s390x" { + c.Skip("Disabled on s390x") + } + if runtime.GOARCH == "ppc64le" { + c.Skip("Disabled on ppc64le") + } + // Create 3 nodes d1 := s.AddDaemon(c, true, true) d2 := s.AddDaemon(c, true, true) @@ -357,6 +365,13 @@ func (s *DockerSwarmSuite) TestAPISwarmLeaderElection(c *check.C) { } func (s *DockerSwarmSuite) TestAPISwarmRaftQuorum(c *check.C) { + if runtime.GOARCH == "s390x" { + c.Skip("Disabled on s390x") + } + if runtime.GOARCH == "ppc64le" { + c.Skip("Disabled on ppc64le") + } + d1 := s.AddDaemon(c, true, true) d2 := s.AddDaemon(c, true, true) d3 := s.AddDaemon(c, true, true) diff --git a/components/engine/integration-cli/docker_cli_run_unix_test.go b/components/engine/integration-cli/docker_cli_run_unix_test.go index 5f782ee530..64b33703b4 100644 --- a/components/engine/integration-cli/docker_cli_run_unix_test.go +++ b/components/engine/integration-cli/docker_cli_run_unix_test.go @@ -497,7 +497,7 @@ func (s *DockerSuite) TestRunWithInvalidCpuPeriod(c *check.C) { } func (s *DockerSuite) TestRunWithKernelMemory(c *check.C) { - testRequires(c, kernelMemorySupport) + testRequires(c, DaemonIsLinux, kernelMemorySupport) file := "/sys/fs/cgroup/memory/memory.kmem.limit_in_bytes" cli.DockerCmd(c, "run", "--kernel-memory", "50M", "--name", "test1", "busybox", "cat", file).Assert(c, icmd.Expected{ @@ -510,7 +510,7 @@ func (s *DockerSuite) TestRunWithKernelMemory(c *check.C) { } func (s *DockerSuite) TestRunWithInvalidKernelMemory(c *check.C) { - testRequires(c, kernelMemorySupport) + testRequires(c, DaemonIsLinux, kernelMemorySupport) out, _, err := dockerCmdWithError("run", "--kernel-memory", "2M", "busybox", "true") c.Assert(err, check.NotNil) diff --git a/components/engine/integration-cli/docker_cli_swarm_test.go b/components/engine/integration-cli/docker_cli_swarm_test.go index f6fadcf995..3433e3b39a 100644 --- a/components/engine/integration-cli/docker_cli_swarm_test.go +++ b/components/engine/integration-cli/docker_cli_swarm_test.go @@ -13,6 +13,7 @@ import ( "net/http/httptest" "os" "path/filepath" + "runtime" "strings" "time" @@ -1374,6 +1375,13 @@ func (s *DockerSwarmSuite) TestSwarmRotateUnlockKey(c *check.C) { // This one keeps the leader up, and asserts that other manager nodes in the cluster also have their unlock // key rotated. func (s *DockerSwarmSuite) TestSwarmClusterRotateUnlockKey(c *check.C) { + if runtime.GOARCH == "s390x" { + c.Skip("Disabled on s390x") + } + if runtime.GOARCH == "ppc64le" { + c.Skip("Disabled on ppc64le") + } + d1 := s.AddDaemon(c, true, true) // leader - don't restart this one, we don't want leader election delays d2 := s.AddDaemon(c, true, true) d3 := s.AddDaemon(c, true, true) diff --git a/components/engine/integration-cli/requirements_unix_test.go b/components/engine/integration-cli/requirements_unix_test.go index 7c594f7db4..7ac79c4fe2 100644 --- a/components/engine/integration-cli/requirements_unix_test.go +++ b/components/engine/integration-cli/requirements_unix_test.go @@ -38,6 +38,17 @@ func pidsLimit() bool { } func kernelMemorySupport() bool { + // TODO remove this once kmem support in RHEL kernels is fixed. See https://github.com/opencontainers/runc/pull/1921 + daemonV, err := kernel.ParseRelease(testEnv.DaemonInfo.KernelVersion) + if err != nil { + return false + } + requiredV := kernel.VersionInfo{Kernel: 3, Major: 10} + if kernel.CompareKernelVersion(*daemonV, requiredV) < 1 { + // On Kernel 3.10 and under, don't consider kernel memory to be supported, + // even if the kernel (and thus the daemon) reports it as being supported + return false + } return testEnv.DaemonInfo.KernelMemory } diff --git a/components/engine/integration/plugin/logging/helpers_test.go b/components/engine/integration/plugin/logging/helpers_test.go index dbdd36b905..128bf7d73b 100644 --- a/components/engine/integration/plugin/logging/helpers_test.go +++ b/components/engine/integration/plugin/logging/helpers_test.go @@ -31,7 +31,7 @@ func ensurePlugin(t *testing.T, name string) string { } cmd := exec.Command(goBin, "build", "-o", installPath, "./"+filepath.Join("cmd", name)) - cmd.Env = append(cmd.Env, "CGO_ENABLED=0") + cmd.Env = append(os.Environ(), "CGO_ENABLED=0") if out, err := cmd.CombinedOutput(); err != nil { t.Fatal(errors.Wrapf(err, "error building basic plugin bin: %s", string(out))) } diff --git a/components/engine/integration/plugin/volumes/helpers_test.go b/components/engine/integration/plugin/volumes/helpers_test.go index 36aafd59c2..53e671b509 100644 --- a/components/engine/integration/plugin/volumes/helpers_test.go +++ b/components/engine/integration/plugin/volumes/helpers_test.go @@ -37,7 +37,7 @@ func ensurePlugin(t *testing.T, name string) string { } cmd := exec.Command(goBin, "build", "-o", installPath, "./"+filepath.Join("cmd", name)) - cmd.Env = append(cmd.Env, "CGO_ENABLED=0") + cmd.Env = append(os.Environ(), "CGO_ENABLED=0") if out, err := cmd.CombinedOutput(); err != nil { t.Fatal(errors.Wrapf(err, "error building basic plugin bin: %s", string(out))) } diff --git a/components/engine/internal/test/fixtures/plugin/plugin.go b/components/engine/internal/test/fixtures/plugin/plugin.go index 523a261ad2..b80634a8d7 100644 --- a/components/engine/internal/test/fixtures/plugin/plugin.go +++ b/components/engine/internal/test/fixtures/plugin/plugin.go @@ -208,7 +208,7 @@ func ensureBasicPluginBin() (string, error) { installPath := filepath.Join(os.Getenv("GOPATH"), "bin", name) sourcePath := filepath.Join("github.com", "docker", "docker", "internal", "test", "fixtures", "plugin", "basic") cmd := exec.Command(goBin, "build", "-o", installPath, sourcePath) - cmd.Env = append(cmd.Env, "GOPATH="+os.Getenv("GOPATH"), "CGO_ENABLED=0") + cmd.Env = append(os.Environ(), "CGO_ENABLED=0") if out, err := cmd.CombinedOutput(); err != nil { return "", errors.Wrapf(err, "error building basic plugin bin: %s", string(out)) } diff --git a/components/engine/pkg/namesgenerator/names-generator.go b/components/engine/pkg/namesgenerator/names-generator.go index 8d19caa0d7..a64fdfcc1c 100644 --- a/components/engine/pkg/namesgenerator/names-generator.go +++ b/components/engine/pkg/namesgenerator/names-generator.go @@ -196,9 +196,6 @@ var ( // Emmett Brown invented time travel. https://en.wikipedia.org/wiki/Emmett_Brown (thanks Brian Goff) "brown", - // Dame Susan Jocelyn Bell Burnell - discoverer of pulsars while a graduate student, "one of the most significant scientific achievements of the 20th Century". - https://en.wikipedia.org/wiki/Jocelyn_Bell_Burnell - "burnell", - // Linda Brown Buck - American biologist and Nobel laureate best known for her genetic and molecular analyses of the mechanisms of smell. https://en.wikipedia.org/wiki/Linda_B._Buck "buck", @@ -211,6 +208,9 @@ var ( // Dame Mary Lucy Cartwright - British mathematician who was one of the first to study what is now known as chaos theory. Also known for Cartwright's theorem which finds applications in signal processing. https://en.wikipedia.org/wiki/Mary_Cartwright "cartwright", + // Vinton Gray Cerf - American Internet pioneer, recognised as one of "the fathers of the Internet". With Robert Elliot Kahn, he designed TCP and IP, the primary data communication protocols of the Internet and other computer networks. https://en.wikipedia.org/wiki/Vint_Cerf + "cerf", + // Subrahmanyan Chandrasekhar - Astrophysicist known for his mathematical theory on different stages and evolution in structures of the stars. He has won nobel prize for physics - https://en.wikipedia.org/wiki/Subrahmanyan_Chandrasekhar "chandrasekhar", @@ -226,9 +226,6 @@ var ( // Pafnuty Chebyshev - Russian mathematician. He is known fo his works on probability, statistics, mechanics, analytical geometry and number theory https://en.wikipedia.org/wiki/Pafnuty_Chebyshev "chebyshev", - // Clifford Christopher Cocks - British mathematician and cryptographer employed by the GCHQ. Invented in 1973 an equivalent of what is now known as the RSA public-key cryptosystem (Rivest, Shamir and Adleman first publicly described RSA in 1978). https://en.wikipedia.org/wiki/Clifford_Cocks - "cocks", - // Bram Cohen - American computer programmer and author of the BitTorrent peer-to-peer protocol. https://en.wikipedia.org/wiki/Bram_Cohen "cohen", @@ -666,6 +663,9 @@ var ( // Mildred Sanderson - American mathematician best known for Sanderson's theorem concerning modular invariants. https://en.wikipedia.org/wiki/Mildred_Sanderson "sanderson", + // Adi Shamir - Israeli cryptographer whose numerous inventions and contributions to cryptography include the Ferge Fiat Shamir identification scheme, the Rivest Shamir Adleman (RSA) public-key cryptosystem, the Shamir's secret sharing scheme, the breaking of the Merkle-Hellman cryptosystem, the TWINKLE and TWIRL factoring devices and the discovery of differential cryptanalysis (with Eli Biham). https://en.wikipedia.org/wiki/Adi_Shamir + "shamir", + // Claude Shannon - The father of information theory and founder of digital circuit design theory. (https://en.wikipedia.org/wiki/Claude_Shannon) "shannon", @@ -696,6 +696,9 @@ var ( // Michael Stonebraker is a database research pioneer and architect of Ingres, Postgres, VoltDB and SciDB. Winner of 2014 ACM Turing Award. https://en.wikipedia.org/wiki/Michael_Stonebraker "stonebraker", + // Ivan Edward Sutherland - American computer scientist and Internet pioneer, widely regarded as the father of computer graphics. https://en.wikipedia.org/wiki/Ivan_Sutherland + "sutherland", + // Janese Swanson (with others) developed the first of the Carmen Sandiego games. She went on to found Girl Tech. https://en.wikipedia.org/wiki/Janese_Swanson "swanson", @@ -747,6 +750,9 @@ var ( // Marlyn Wescoff - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Marlyn_Meltzer "wescoff", + // Sylvia B. Wilbur - British computer scientist who helped develop the ARPANET, was one of the first to exchange email in the UK and a leading researcher in computer-supported collaborative work. https://en.wikipedia.org/wiki/Sylvia_Wilbur + "wilbur", + // Andrew Wiles - Notable British mathematician who proved the enigmatic Fermat's Last Theorem - https://en.wikipedia.org/wiki/Andrew_Wiles "wiles", diff --git a/components/engine/pkg/parsers/kernel/kernel_unix_test.go b/components/engine/pkg/parsers/kernel/kernel_unix_test.go index 2f36490c53..9d2e496af5 100644 --- a/components/engine/pkg/parsers/kernel/kernel_unix_test.go +++ b/components/engine/pkg/parsers/kernel/kernel_unix_test.go @@ -27,6 +27,7 @@ func TestParseRelease(t *testing.T) { assertParseRelease(t, "3.4.54.longterm-1", &VersionInfo{Kernel: 3, Major: 4, Minor: 54, Flavor: ".longterm-1"}, 0) assertParseRelease(t, "3.4.54.longterm-1", &VersionInfo{Kernel: 3, Major: 4, Minor: 54, Flavor: ".longterm-1"}, 0) assertParseRelease(t, "3.8.0-19-generic", &VersionInfo{Kernel: 3, Major: 8, Minor: 0, Flavor: "-19-generic"}, 0) + assertParseRelease(t, "3.10.0-862.2.3.el7.x86_64", &VersionInfo{Kernel: 3, Major: 10, Minor: 0, Flavor: "-862.2.3.el7.x86_64"}, 0) assertParseRelease(t, "3.12.8tag", &VersionInfo{Kernel: 3, Major: 12, Minor: 8, Flavor: "tag"}, 0) assertParseRelease(t, "3.12-1-amd64", &VersionInfo{Kernel: 3, Major: 12, Minor: 0, Flavor: "-1-amd64"}, 0) assertParseRelease(t, "3.8.0", &VersionInfo{Kernel: 4, Major: 8, Minor: 0}, -1)