From 22925b966b5c62709cd01a8cb0ad6fc2fba7a2ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Fri, 19 Feb 2021 16:39:38 +0100 Subject: [PATCH 1/5] chore: append "-amd64" suffix to docker images --- e2e/_suites/fleet/stand-alone.go | 2 +- e2e/_suites/metricbeat/metricbeat_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/_suites/fleet/stand-alone.go b/e2e/_suites/fleet/stand-alone.go index 54c9efaf19..b08699e3d5 100644 --- a/e2e/_suites/fleet/stand-alone.go +++ b/e2e/_suites/fleet/stand-alone.go @@ -96,7 +96,7 @@ func (sats *StandAloneTestSuite) aStandaloneAgentIsDeployed(image string) error profileEnv["elasticAgentContainerName"] = containerName profileEnv["elasticAgentConfigFile"] = sats.AgentConfigFilePath profileEnv["elasticAgentPlatform"] = "linux/amd64" - profileEnv["elasticAgentTag"] = agentVersion + profileEnv["elasticAgentTag"] = agentVersion + "-amd64" err = serviceManager.AddServicesToCompose(context.Background(), FleetProfileName, []string{ElasticAgentServiceName}, profileEnv) if err != nil { diff --git a/e2e/_suites/metricbeat/metricbeat_test.go b/e2e/_suites/metricbeat/metricbeat_test.go index 9fbaa23f38..db8dffd2a5 100644 --- a/e2e/_suites/metricbeat/metricbeat_test.go +++ b/e2e/_suites/metricbeat/metricbeat_test.go @@ -436,7 +436,7 @@ func (mts *MetricbeatTestSuite) runMetricbeatService() error { "metricbeatConfigFile": mts.configurationFile, "metricbeatTag": mts.Version, "stackVersion": stackVersion, - mts.ServiceName + "Tag": mts.ServiceVersion, + mts.ServiceName + "Tag": mts.ServiceVersion + "-amd64", "serviceName": mts.ServiceName, } From ec80c92f3f70afbfe0bd5ab970b0dbdee1906147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Fri, 19 Feb 2021 16:44:20 +0100 Subject: [PATCH 2/5] chore: append "-amd64" suffix for locally-loaded Docker images --- e2e/_suites/fleet/installers.go | 2 +- e2e/_suites/metricbeat/metricbeat_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/_suites/fleet/installers.go b/e2e/_suites/fleet/installers.go index 4862e893b5..a88cd437a0 100644 --- a/e2e/_suites/fleet/installers.go +++ b/e2e/_suites/fleet/installers.go @@ -154,7 +154,7 @@ func (i *DockerPackage) Preinstall() error { // and we want it to use the 'pr-12345' format. return docker.TagImage( "docker.elastic.co/beats/"+i.artifact+":"+agentVersionBase, - "docker.elastic.co/observability-ci/"+i.artifact+":"+i.originalVersion, + "docker.elastic.co/observability-ci/"+i.artifact+":"+i.originalVersion+"-amd64", ) } diff --git a/e2e/_suites/metricbeat/metricbeat_test.go b/e2e/_suites/metricbeat/metricbeat_test.go index db8dffd2a5..1e9310790f 100644 --- a/e2e/_suites/metricbeat/metricbeat_test.go +++ b/e2e/_suites/metricbeat/metricbeat_test.go @@ -408,7 +408,7 @@ func (mts *MetricbeatTestSuite) runMetricbeatService() error { err = docker.TagImage( "docker.elastic.co/beats/metricbeat:"+metricbeatVersionBase, - "docker.elastic.co/observability-ci/metricbeat:"+mts.Version, + "docker.elastic.co/observability-ci/metricbeat:"+mts.Version+"-amd64", ) } From 2f978eff7c1ade6dc9e45d3287120573f087a320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Fri, 19 Feb 2021 16:49:15 +0100 Subject: [PATCH 3/5] chore: make sure we tag the image after it's loaded --- e2e/_suites/fleet/installers.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/e2e/_suites/fleet/installers.go b/e2e/_suites/fleet/installers.go index a88cd437a0..e004e70c5d 100644 --- a/e2e/_suites/fleet/installers.go +++ b/e2e/_suites/fleet/installers.go @@ -6,6 +6,7 @@ package main import ( "fmt" + "time" "github.com/elastic/e2e-testing/cli/docker" "github.com/elastic/e2e-testing/e2e" @@ -150,6 +151,9 @@ func (i *DockerPackage) Preinstall() error { return err } + // wait for tagging to ensure the loaded image is present + e2e.Sleep(3 * time.Second) + // we need to tag the loaded image because its tag relates to the target branch, // and we want it to use the 'pr-12345' format. return docker.TagImage( From 39a9b0c16d876794f94b1fb524e4fec9dc3a2bca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Fri, 19 Feb 2021 17:10:48 +0100 Subject: [PATCH 4/5] fix: properly load & tag ubi8 images --- e2e/_suites/fleet/services.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/e2e/_suites/fleet/services.go b/e2e/_suites/fleet/services.go index 5888fd5ca9..eda5f00371 100644 --- a/e2e/_suites/fleet/services.go +++ b/e2e/_suites/fleet/services.go @@ -355,6 +355,7 @@ func newDockerInstaller(ubi8 bool, version string) (ElasticAgentInstaller, error artifactName := artifact if ubi8 { artifactName = "elastic-agent-ubi8" + image = "elastic-agent-ubi8" } os := "linux" @@ -383,9 +384,9 @@ func newDockerInstaller(ubi8 bool, version string) (ElasticAgentInstaller, error return nil } - installerPackage := NewDockerPackage(binaryName, profile, image, service, binaryPath, ubi8). + installerPackage := NewDockerPackage(binaryName, profile, artifactName, service, binaryPath, ubi8). WithArch(arch). - WithArtifact(artifact). + WithArtifact(artifactName). WithOS(os). WithVersion(version) From 1f29a34f5f20d762674446ff21fdf59c3fd7ab23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Fri, 19 Feb 2021 17:50:32 +0100 Subject: [PATCH 5/5] fix: only add the platform label for local or CI snapshots --- e2e/_suites/fleet/stand-alone.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/e2e/_suites/fleet/stand-alone.go b/e2e/_suites/fleet/stand-alone.go index b08699e3d5..9636b81ba6 100644 --- a/e2e/_suites/fleet/stand-alone.go +++ b/e2e/_suites/fleet/stand-alone.go @@ -63,6 +63,8 @@ func (sats *StandAloneTestSuite) contributeSteps(s *godog.ScenarioContext) { func (sats *StandAloneTestSuite) aStandaloneAgentIsDeployed(image string) error { log.Trace("Deploying an agent to Fleet") + dockerImageTag := agentVersion + useCISnapshots := shell.GetEnvBool("BEATS_USE_CI_SNAPSHOTS") beatsLocalPath := shell.GetEnv("BEATS_LOCAL_PATH", "") if useCISnapshots || beatsLocalPath != "" { @@ -72,6 +74,8 @@ func (sats *StandAloneTestSuite) aStandaloneAgentIsDeployed(image string) error dockerInstaller := GetElasticAgentInstaller("docker", image, agentVersion) dockerInstaller.PreInstallFn() + + dockerImageTag += "-amd64" } serviceManager := services.NewServiceManager() @@ -96,7 +100,7 @@ func (sats *StandAloneTestSuite) aStandaloneAgentIsDeployed(image string) error profileEnv["elasticAgentContainerName"] = containerName profileEnv["elasticAgentConfigFile"] = sats.AgentConfigFilePath profileEnv["elasticAgentPlatform"] = "linux/amd64" - profileEnv["elasticAgentTag"] = agentVersion + "-amd64" + profileEnv["elasticAgentTag"] = dockerImageTag err = serviceManager.AddServicesToCompose(context.Background(), FleetProfileName, []string{ElasticAgentServiceName}, profileEnv) if err != nil {