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());
}
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)));
}
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();
}
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());
}
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);
}
Aggregations