Search in sources :

Example 1 with Deployment

use of com.yahoo.vespa.config.server.deploy.Deployment in project vespa by vespa-engine.

the class ApplicationRepository method activate.

public ApplicationId activate(Tenant tenant, long sessionId, TimeoutBudget timeoutBudget, boolean ignoreLockFailure, boolean ignoreSessionStaleFailure) {
    LocalSession localSession = getLocalSession(tenant, sessionId);
    Deployment deployment = deployFromPreparedSession(localSession, tenant, timeoutBudget.timeLeft());
    deployment.setIgnoreLockFailure(ignoreLockFailure);
    deployment.setIgnoreSessionStaleFailure(ignoreSessionStaleFailure);
    deployment.activate();
    return localSession.getApplicationId();
}
Also used : LocalSession(com.yahoo.vespa.config.server.session.LocalSession) Deployment(com.yahoo.vespa.config.server.deploy.Deployment)

Example 2 with Deployment

use of com.yahoo.vespa.config.server.deploy.Deployment in project vespa by vespa-engine.

the class ApplicationRepository method redeployAllApplications.

void redeployAllApplications() throws InterruptedException {
    ExecutorService executor = Executors.newFixedThreadPool(configserverConfig.numParallelTenantLoaders(), new DaemonThreadFactory("redeploy apps"));
    // Keep track of deployment per application
    Map<ApplicationId, Future<?>> futures = new HashMap<>();
    tenants.getAllTenants().forEach(tenant -> listApplicationIds(tenant).forEach(appId -> deployFromLocalActive(appId).ifPresent(deployment -> futures.put(appId, executor.submit(deployment::activate)))));
    for (Map.Entry<ApplicationId, Future<?>> f : futures.entrySet()) {
        try {
            f.getValue().get();
        } catch (ExecutionException e) {
            throw new RuntimeException("Redeploying of " + f.getKey() + " failed", e);
        }
    }
    executor.shutdown();
    // Timeout should never happen
    executor.awaitTermination(365, TimeUnit.DAYS);
}
Also used : ApplicationMetaData(com.yahoo.config.application.api.ApplicationMetaData) FileDistributionStatus(com.yahoo.vespa.config.server.application.FileDistributionStatus) RemoteSession(com.yahoo.vespa.config.server.session.RemoteSession) Inject(com.google.inject.Inject) Vtag(com.yahoo.component.Vtag) ApplicationFile(com.yahoo.config.application.api.ApplicationFile) ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) DeployLogger(com.yahoo.config.application.api.DeployLogger) TenantName(com.yahoo.config.provision.TenantName) LogServerLogGrabber(com.yahoo.vespa.config.server.application.LogServerLogGrabber) Future(java.util.concurrent.Future) Path(com.yahoo.path.Path) Rotations(com.yahoo.vespa.config.server.tenant.Rotations) Provisioner(com.yahoo.config.provision.Provisioner) Duration(java.time.Duration) Map(java.util.Map) LogLevel(com.yahoo.log.LogLevel) CompressedApplicationInputStream(com.yahoo.vespa.config.server.http.CompressedApplicationInputStream) URI(java.net.URI) Application(com.yahoo.vespa.config.server.application.Application) Instant(java.time.Instant) Logger(java.util.logging.Logger) Executors(java.util.concurrent.Executors) HostFilter(com.yahoo.config.provision.HostFilter) RestartActions(com.yahoo.vespa.config.server.configchange.RestartActions) List(java.util.List) HostProvisionerProvider(com.yahoo.vespa.config.server.provision.HostProvisionerProvider) Optional(java.util.Optional) DeployHandlerLogger(com.yahoo.vespa.config.server.deploy.DeployHandlerLogger) HttpResponse(com.yahoo.container.jdisc.HttpResponse) ConfigChangeActions(com.yahoo.vespa.config.server.configchange.ConfigChangeActions) Version(com.yahoo.component.Version) ApplicationId(com.yahoo.config.provision.ApplicationId) Slime(com.yahoo.slime.Slime) DaemonThreadFactory(com.yahoo.concurrent.DaemonThreadFactory) Tenant(com.yahoo.vespa.config.server.tenant.Tenant) HashMap(java.util.HashMap) IOUtils(com.yahoo.io.IOUtils) TenantApplications(com.yahoo.vespa.config.server.application.TenantApplications) ApplicationConvergenceChecker(com.yahoo.vespa.config.server.application.ApplicationConvergenceChecker) Level(java.util.logging.Level) RefeedActions(com.yahoo.vespa.config.server.configchange.RefeedActions) Files(com.google.common.io.Files) NestedTransaction(com.yahoo.transaction.NestedTransaction) PrepareParams(com.yahoo.vespa.config.server.session.PrepareParams) ExecutorService(java.util.concurrent.ExecutorService) HttpProxy(com.yahoo.vespa.config.server.application.HttpProxy) PrepareResult(com.yahoo.vespa.config.server.http.v2.PrepareResult) SilentDeployLogger(com.yahoo.vespa.config.server.session.SilentDeployLogger) LocalSessionRepo(com.yahoo.vespa.config.server.session.LocalSessionRepo) ApplicationSet(com.yahoo.vespa.config.server.application.ApplicationSet) Environment(com.yahoo.config.provision.Environment) IOException(java.io.IOException) Tenants(com.yahoo.vespa.config.server.tenant.Tenants) SessionFactory(com.yahoo.vespa.config.server.session.SessionFactory) File(java.io.File) Deployment(com.yahoo.vespa.config.server.deploy.Deployment) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) LocalSession(com.yahoo.vespa.config.server.session.LocalSession) SimpleHttpFetcher(com.yahoo.vespa.config.server.http.SimpleHttpFetcher) Clock(java.time.Clock) Session(com.yahoo.vespa.config.server.session.Session) InputStream(java.io.InputStream) HashMap(java.util.HashMap) DaemonThreadFactory(com.yahoo.concurrent.DaemonThreadFactory) ExecutorService(java.util.concurrent.ExecutorService) Future(java.util.concurrent.Future) ApplicationId(com.yahoo.config.provision.ApplicationId) ExecutionException(java.util.concurrent.ExecutionException) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

Deployment (com.yahoo.vespa.config.server.deploy.Deployment)2 LocalSession (com.yahoo.vespa.config.server.session.LocalSession)2 Files (com.google.common.io.Files)1 Inject (com.google.inject.Inject)1 ConfigserverConfig (com.yahoo.cloud.config.ConfigserverConfig)1 Version (com.yahoo.component.Version)1 Vtag (com.yahoo.component.Vtag)1 DaemonThreadFactory (com.yahoo.concurrent.DaemonThreadFactory)1 ApplicationFile (com.yahoo.config.application.api.ApplicationFile)1 ApplicationMetaData (com.yahoo.config.application.api.ApplicationMetaData)1 DeployLogger (com.yahoo.config.application.api.DeployLogger)1 ApplicationId (com.yahoo.config.provision.ApplicationId)1 Environment (com.yahoo.config.provision.Environment)1 HostFilter (com.yahoo.config.provision.HostFilter)1 Provisioner (com.yahoo.config.provision.Provisioner)1 TenantName (com.yahoo.config.provision.TenantName)1 HttpResponse (com.yahoo.container.jdisc.HttpResponse)1 IOUtils (com.yahoo.io.IOUtils)1 LogLevel (com.yahoo.log.LogLevel)1 Path (com.yahoo.path.Path)1