diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-06-30 10:41:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-30 10:41:50 +0200 |
commit | 41bdf5a8939faec9fe68db3f6fcd81d733123aa4 (patch) | |
tree | fb4e3d0606dbe54f6872ace251ee8911d69748ea | |
parent | 0a1ae76aa090985823a546bc29e32f61373ad8b5 (diff) | |
parent | 17d282c222b4214920e2f07fe031c6cf05191bb3 (diff) |
Merge pull request #13680 from vespa-engine/mortent/install-testrunner-bundles
install testrunner bundles
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | cloud-tenant-cd/CMakeLists.txt | 2 | ||||
-rw-r--r-- | cloud-tenant-cd/pom.xml | 4 | ||||
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java | 8 | ||||
-rwxr-xr-x | config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java | 44 | ||||
-rw-r--r-- | dist/vespa.spec | 3 | ||||
-rw-r--r-- | tenant-cd-api/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tenant-cd-api/pom.xml | 4 | ||||
-rw-r--r-- | vespa-osgi-testrunner/CMakeLists.txt | 2 | ||||
-rw-r--r-- | vespa-osgi-testrunner/pom.xml | 4 |
10 files changed, 66 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index da9cb6da6a4..e1e3219a5d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,7 @@ add_subdirectory(container-messagebus) add_subdirectory(container-search) add_subdirectory(container-search-gui) add_subdirectory(container-search-and-docproc) +add_subdirectory(cloud-tenant-cd) add_subdirectory(clustercontroller-apps) add_subdirectory(clustercontroller-apputil) add_subdirectory(clustercontroller-utils) @@ -127,11 +128,13 @@ add_subdirectory(storageframework) add_subdirectory(storageserver) add_subdirectory(statistics) add_subdirectory(streamingvisitors) +add_subdirectory(tenant-cd-api) add_subdirectory(vbench) add_subdirectory(vdslib) add_subdirectory(vdstestlib) add_subdirectory(vespa-athenz) add_subdirectory(vespa-http-client) +add_subdirectory(vespa-osgi-testrunner) add_subdirectory(vespa-testrunner-components) add_subdirectory(vespa_feed_perf) add_subdirectory(vespa_jersey2) diff --git a/cloud-tenant-cd/CMakeLists.txt b/cloud-tenant-cd/CMakeLists.txt new file mode 100644 index 00000000000..2d30b9c4611 --- /dev/null +++ b/cloud-tenant-cd/CMakeLists.txt @@ -0,0 +1,2 @@ +# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +install_fat_java_artifact(cloud-tenant-cd) diff --git a/cloud-tenant-cd/pom.xml b/cloud-tenant-cd/pom.xml index c771e2dd1c3..b4670e6e83f 100644 --- a/cloud-tenant-cd/pom.xml +++ b/cloud-tenant-cd/pom.xml @@ -78,9 +78,7 @@ <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> <configuration> - <attachBundleArtifact>true</attachBundleArtifact> - <bundleClassifierName>deploy</bundleClassifierName> - <useCommonAssemblyIds>false</useCommonAssemblyIds> + <useCommonAssemblyIds>true</useCommonAssemblyIds> </configuration> </plugin> <plugin> diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java index 71d16303573..234387f5a6b 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java @@ -124,8 +124,14 @@ public final class ApplicationContainerCluster extends ContainerCluster<Applicat } private void addTestrunnerComponentsIfTester(DeployState deployState) { - if (deployState.isHosted() && deployState.getProperties().applicationId().instance().isTester()) + if (deployState.isHosted() && deployState.getProperties().applicationId().instance().isTester()) { addPlatformBundle(Paths.get(Defaults.getDefaults().underVespaHome("lib/jars/vespa-testrunner-components-jar-with-dependencies.jar"))); + addPlatformBundle(Paths.get(Defaults.getDefaults().underVespaHome("lib/jars/vespa-osgi-testrunner-jar-with-dependencies.jar"))); + addPlatformBundle(Paths.get(Defaults.getDefaults().underVespaHome("lib/jars/tenant-cd-api-jar-with-dependencies.jar"))); + if(deployState.zone().system().isPublic()) { + addPlatformBundle(Paths.get(Defaults.getDefaults().underVespaHome("lib/jars/cloud-tenant-cd-jar-with-dependencies.jar"))); + } + } } public void setModelEvaluation(ContainerModelEvaluation modelEvaluation) { diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java index 739ae055ec7..03c05af1145 100755 --- a/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java @@ -4,16 +4,19 @@ package com.yahoo.vespa.model.container; import com.yahoo.cloud.config.ClusterInfoConfig; import com.yahoo.cloud.config.ConfigserverConfig; import com.yahoo.cloud.config.RoutingProviderConfig; +import com.yahoo.config.FileReference; import com.yahoo.config.application.api.DeployLogger; import com.yahoo.config.model.deploy.DeployState; import com.yahoo.config.model.deploy.TestProperties; import com.yahoo.config.model.test.MockRoot; +import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.Environment; import com.yahoo.config.provision.Flavor; import com.yahoo.config.provision.RegionName; import com.yahoo.config.provision.SystemName; import com.yahoo.config.provision.Zone; import com.yahoo.config.provisioning.FlavorsConfig; +import com.yahoo.container.BundlesConfig; import com.yahoo.container.handler.ThreadpoolConfig; import com.yahoo.search.config.QrStartConfig; import com.yahoo.vespa.model.Host; @@ -24,13 +27,19 @@ import com.yahoo.vespa.model.container.component.Component; import com.yahoo.vespa.model.container.docproc.ContainerDocproc; import com.yahoo.vespa.model.container.search.ContainerSearch; import com.yahoo.vespa.model.container.search.searchchain.SearchChains; +import org.hamcrest.CoreMatchers; import org.junit.Test; +import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; +import java.util.List; +import java.util.stream.Collectors; +import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertThat; /** * @author Simon Thoresen Hult @@ -259,6 +268,41 @@ public class ContainerClusterTest { assertFalse(config.enabled()); } + @Test + public void requireThatBundlesForTesterApplicationAreInstalled() { + List<String> expectedOnpremBundles = + List.of("vespa-testrunner-components-jar-with-dependencies.jar", + "vespa-osgi-testrunner-jar-with-dependencies.jar", + "tenant-cd-api-jar-with-dependencies.jar"); + verifyTesterApplicationInstalledBundles(Zone.defaultZone(), expectedOnpremBundles); + + List<String> expectedPublicBundles = new ArrayList<>(expectedOnpremBundles); + expectedPublicBundles.add("cloud-tenant-cd-jar-with-dependencies.jar"); + Zone publicZone = new Zone(SystemName.PublicCd, Environment.dev, RegionName.defaultName()); + verifyTesterApplicationInstalledBundles(publicZone, expectedPublicBundles); + + } + + private void verifyTesterApplicationInstalledBundles(Zone zone, List<String> expectedBundleNames) { + ApplicationId appId = ApplicationId.from("tenant", "application", "instance-t"); + DeployState state = new DeployState.Builder().properties( + new TestProperties() + .setHostedVespa(true) + .setApplicationId(appId)) + .zone(zone).build(); + MockRoot root = new MockRoot("foo", state); + ApplicationContainerCluster cluster = new ApplicationContainerCluster(root, "container0", "container1", state); + BundlesConfig.Builder bundleBuilder = new BundlesConfig.Builder(); + cluster.getConfig(bundleBuilder); + List<String> installedBundles = bundleBuilder.build().bundle().stream().map(FileReference::value).collect(Collectors.toList()); + + assertEquals(expectedBundleNames.size(), installedBundles.size()); + assertThat(installedBundles, containsInAnyOrder( + expectedBundleNames.stream().map(CoreMatchers::endsWith).collect(Collectors.toList()) + )); + } + + private static void addContainer(DeployLogger deployLogger, ApplicationContainerCluster cluster, String name, String hostName) { ApplicationContainer container = new ApplicationContainer(cluster, name, 0, cluster.isHostedVespa()); container.setHostResource(new HostResource(new Host(null, hostName))); diff --git a/dist/vespa.spec b/dist/vespa.spec index 1e1658d3d55..9353acf5c68 100644 --- a/dist/vespa.spec +++ b/dist/vespa.spec @@ -441,6 +441,7 @@ fi %{_prefix}/lib/jars/application-model-jar-with-dependencies.jar %{_prefix}/lib/jars/application-preprocessor-jar-with-dependencies.jar %{_prefix}/lib/jars/athenz-identity-provider-service-jar-with-dependencies.jar +%{_prefix}/lib/jars/cloud-tenant-cd-jar-with-dependencies.jar %{_prefix}/lib/jars/clustercontroller-apps-jar-with-dependencies.jar %{_prefix}/lib/jars/clustercontroller-apputil-jar-with-dependencies.jar %{_prefix}/lib/jars/clustercontroller-core-jar-with-dependencies.jar @@ -460,7 +461,9 @@ fi %{_prefix}/lib/jars/searchlib.jar %{_prefix}/lib/jars/searchlib-jar-with-dependencies.jar %{_prefix}/lib/jars/service-monitor-jar-with-dependencies.jar +%{_prefix}/lib/jars/tenant-cd-api-jar-with-dependencies.jar %{_prefix}/lib/jars/vespa_feed_perf-jar-with-dependencies.jar +%{_prefix}/lib/jars/vespa-osgi-testrunner-jar-with-dependencies.jar %{_prefix}/lib/jars/vespa-testrunner-components.jar %{_prefix}/lib/jars/vespa-testrunner-components-jar-with-dependencies.jar %{_prefix}/lib/jars/zookeeper-command-line-client-jar-with-dependencies.jar diff --git a/tenant-cd-api/CMakeLists.txt b/tenant-cd-api/CMakeLists.txt new file mode 100644 index 00000000000..971aa974aa2 --- /dev/null +++ b/tenant-cd-api/CMakeLists.txt @@ -0,0 +1,2 @@ +# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +install_fat_java_artifact(tenant-cd-api) diff --git a/tenant-cd-api/pom.xml b/tenant-cd-api/pom.xml index b19d42d094f..23e5f3ec3f4 100644 --- a/tenant-cd-api/pom.xml +++ b/tenant-cd-api/pom.xml @@ -57,9 +57,7 @@ <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> <configuration> - <attachBundleArtifact>true</attachBundleArtifact> - <bundleClassifierName>deploy</bundleClassifierName> - <useCommonAssemblyIds>false</useCommonAssemblyIds> + <useCommonAssemblyIds>true</useCommonAssemblyIds> </configuration> </plugin> <plugin> diff --git a/vespa-osgi-testrunner/CMakeLists.txt b/vespa-osgi-testrunner/CMakeLists.txt new file mode 100644 index 00000000000..58aba186710 --- /dev/null +++ b/vespa-osgi-testrunner/CMakeLists.txt @@ -0,0 +1,2 @@ +# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +install_fat_java_artifact(vespa-osgi-testrunner) diff --git a/vespa-osgi-testrunner/pom.xml b/vespa-osgi-testrunner/pom.xml index 5ed9f75c9eb..62ea578f14f 100644 --- a/vespa-osgi-testrunner/pom.xml +++ b/vespa-osgi-testrunner/pom.xml @@ -79,9 +79,7 @@ <version>${project.version}</version> <extensions>true</extensions> <configuration> - <attachBundleArtifact>true</attachBundleArtifact> - <bundleClassifierName>deploy</bundleClassifierName> - <useCommonAssemblyIds>false</useCommonAssemblyIds> + <useCommonAssemblyIds>true</useCommonAssemblyIds> </configuration> </plugin> <plugin> |