Search in sources :

Example 16 with ConfigserverConfig

use of com.yahoo.cloud.config.ConfigserverConfig in project vespa by vespa-engine.

the class ContainerClusterTest method requreThatWeCanGetTheZoneConfig.

@Test
public void requreThatWeCanGetTheZoneConfig() {
    DeployState state = new DeployState.Builder().properties(new DeployProperties.Builder().hostedVespa(true).build()).zone(new Zone(SystemName.cd, Environment.test, RegionName.from("some-region"))).build(true);
    MockRoot root = new MockRoot("foo", state);
    ContainerCluster cluster = new ContainerCluster(root, "container0", "container1");
    ConfigserverConfig.Builder builder = new ConfigserverConfig.Builder();
    cluster.getConfig(builder);
    ConfigserverConfig config = new ConfigserverConfig(builder);
    assertEquals(Environment.test.value(), config.environment());
    assertEquals("some-region", config.region());
    assertEquals("cd", config.system());
}
Also used : ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) DeployState(com.yahoo.config.model.deploy.DeployState) MockRoot(com.yahoo.config.model.test.MockRoot) Zone(com.yahoo.config.provision.Zone) DeployProperties(com.yahoo.config.model.deploy.DeployProperties) Test(org.junit.Test)

Example 17 with ConfigserverConfig

use of com.yahoo.cloud.config.ConfigserverConfig in project vespa by vespa-engine.

the class HostProvisionerProvider method withProvisioner.

// for testing
public static HostProvisionerProvider withProvisioner(Provisioner provisioner) {
    ComponentRegistry<Provisioner> registry = new ComponentRegistry<>();
    registry.register(ComponentId.createAnonymousComponentId("foobar"), provisioner);
    return new HostProvisionerProvider(registry, new ConfigserverConfig(new ConfigserverConfig.Builder().hostedVespa(true)));
}
Also used : ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) ComponentRegistry(com.yahoo.component.provider.ComponentRegistry) Provisioner(com.yahoo.config.provision.Provisioner)

Example 18 with ConfigserverConfig

use of com.yahoo.cloud.config.ConfigserverConfig in project vespa by vespa-engine.

the class TestWithRpc method createAndStartRpcServer.

protected void createAndStartRpcServer(boolean hostedVespa) {
    ConfigserverConfig configserverConfig = new ConfigserverConfig(new ConfigserverConfig.Builder());
    rpcServer = new RpcServer(new ConfigserverConfig(new ConfigserverConfig.Builder().rpcport(port).numRpcThreads(1).maxgetconfigclients(1).hostedVespa(hostedVespa)), new SuperModelRequestHandler(new TestConfigDefinitionRepo(), configserverConfig, new SuperModelManager(configserverConfig, emptyNodeFlavors(), generationCounter)), Metrics.createTestMetrics(), new HostRegistries(), hostLivenessTracker, new FileServer(FileDistribution.getDefaultFileDBPath()));
    rpcServer.onTenantCreate(TenantName.from("default"), tenantProvider);
    t = new Thread(rpcServer);
    t.start();
    sup = new Supervisor(new Transport());
    pingServer();
}
Also used : ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) Supervisor(com.yahoo.jrt.Supervisor) HostRegistries(com.yahoo.vespa.config.server.host.HostRegistries) Transport(com.yahoo.jrt.Transport) FileServer(com.yahoo.vespa.config.server.filedistribution.FileServer)

Example 19 with ConfigserverConfig

use of com.yahoo.cloud.config.ConfigserverConfig in project vespa by vespa-engine.

the class ConfigServerBootstrapTest method testBootStrap.

@Test
// TODO: An issue with how MockCurator.MockLock is implemented make this not work (it will hang
@Ignore
public // not being able to acquire activate lock in ConfigServerBootstrap
void testBootStrap() throws Exception {
    ConfigserverConfig configserverConfig = createConfigserverConfig();
    DeployTester tester = new DeployTester("src/test/apps/hosted/", configserverConfig);
    tester.deployApp("myApp", "4.5.6", Instant.now());
    File versionFile = temporaryFolder.newFile();
    VersionState versionState = new VersionState(versionFile);
    assertTrue(versionState.isUpgraded());
    RpcServer rpcServer = createRpcServer(configserverConfig);
    ConfigServerBootstrap bootstrap = new ConfigServerBootstrap(tester.applicationRepository(), rpcServer, versionState, createStateMonitor());
    waitUntil(() -> bootstrap.status() == StateMonitor.Status.up, "failed waiting for status 'up'");
    waitUntil(rpcServer::isRunning, "failed waiting for Rpc server running");
    bootstrap.deconstruct();
    assertEquals(StateMonitor.Status.down, bootstrap.status());
    assertFalse(rpcServer.isRunning());
}
Also used : ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) RpcServer(com.yahoo.vespa.config.server.rpc.RpcServer) DeployTester(com.yahoo.vespa.config.server.deploy.DeployTester) File(java.io.File) VersionState(com.yahoo.vespa.config.server.version.VersionState) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 20 with ConfigserverConfig

use of com.yahoo.cloud.config.ConfigserverConfig in project vespa by vespa-engine.

the class SuperModelRequestHandlerTest method setup.

@Before
public void setup() throws IOException {
    counter = new SuperModelGenerationCounter(new MockCurator());
    ConfigserverConfig configserverConfig = new ConfigserverConfig(new ConfigserverConfig.Builder());
    manager = new SuperModelManager(configserverConfig, emptyNodeFlavors(), counter);
    controller = new SuperModelRequestHandler(new TestConfigDefinitionRepo(), configserverConfig, manager);
}
Also used : ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) MockCurator(com.yahoo.vespa.curator.mock.MockCurator) Before(org.junit.Before)

Aggregations

ConfigserverConfig (com.yahoo.cloud.config.ConfigserverConfig)23 Test (org.junit.Test)16 File (java.io.File)4 RpcServer (com.yahoo.vespa.config.server.rpc.RpcServer)3 Before (org.junit.Before)3 Zone (com.yahoo.config.provision.Zone)2 PermanentApplicationPackage (com.yahoo.vespa.config.server.application.PermanentApplicationPackage)2 DeployTester (com.yahoo.vespa.config.server.deploy.DeployTester)2 FileServer (com.yahoo.vespa.config.server.filedistribution.FileServer)2 HostRegistries (com.yahoo.vespa.config.server.host.HostRegistries)2 SessionHandlerTest (com.yahoo.vespa.config.server.http.SessionHandlerTest)2 VersionState (com.yahoo.vespa.config.server.version.VersionState)2 MockCurator (com.yahoo.vespa.curator.mock.MockCurator)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ComponentRegistry (com.yahoo.component.provider.ComponentRegistry)1 NullConfigModelRegistry (com.yahoo.config.model.NullConfigModelRegistry)1 DeployProperties (com.yahoo.config.model.deploy.DeployProperties)1 DeployState (com.yahoo.config.model.deploy.DeployState)1 MockRoot (com.yahoo.config.model.test.MockRoot)1 ApplicationId (com.yahoo.config.provision.ApplicationId)1