use of co.cask.cdap.internal.app.deploy.pipeline.AppDeploymentInfo in project cdap by caskdata.
the class PreviewRunnerModule method configure.
@Override
protected void configure() {
bind(ArtifactRepository.class).toInstance(artifactRepository);
expose(ArtifactRepository.class);
bind(ArtifactStore.class).toInstance(artifactStore);
expose(ArtifactStore.class);
bind(AuthorizerInstantiator.class).toInstance(authorizerInstantiator);
expose(AuthorizerInstantiator.class);
bind(AuthorizationEnforcer.class).toInstance(authorizationEnforcer);
expose(AuthorizationEnforcer.class);
bind(PrivilegesManager.class).toInstance(privilegesManager);
expose(PrivilegesManager.class);
bind(StreamConsumerFactory.class).to(InMemoryStreamConsumerFactory.class).in(Scopes.SINGLETON);
expose(StreamConsumerFactory.class);
bind(StreamCoordinatorClient.class).toInstance(streamCoordinatorClient);
expose(StreamCoordinatorClient.class);
bind(PreferencesStore.class).toInstance(preferencesStore);
// bind explore client to mock.
bind(ExploreClient.class).to(MockExploreClient.class);
expose(ExploreClient.class);
bind(StorageProviderNamespaceAdmin.class).to(LocalStorageProviderNamespaceAdmin.class);
bind(PipelineFactory.class).to(SynchronousPipelineFactory.class);
install(new FactoryModuleBuilder().implement(new TypeLiteral<Manager<AppDeploymentInfo, ApplicationWithPrograms>>() {
}, new TypeLiteral<PreviewApplicationManager<AppDeploymentInfo, ApplicationWithPrograms>>() {
}).build(new TypeLiteral<ManagerFactory<AppDeploymentInfo, ApplicationWithPrograms>>() {
}));
bind(Store.class).to(DefaultStore.class);
bind(RouteStore.class).to(LocalRouteStore.class).in(Scopes.SINGLETON);
bind(UGIProvider.class).to(UnsupportedUGIProvider.class);
expose(UGIProvider.class);
bind(RuntimeStore.class).to(DefaultStore.class);
expose(RuntimeStore.class);
// we don't delete namespaces in preview as we just delete preview directory when its done
bind(NamespaceResourceDeleter.class).to(NoopNamespaceResourceDeleter.class).in(Scopes.SINGLETON);
bind(NamespaceAdmin.class).to(DefaultNamespaceAdmin.class).in(Scopes.SINGLETON);
bind(NamespaceQueryAdmin.class).to(DefaultNamespaceAdmin.class).in(Scopes.SINGLETON);
expose(NamespaceAdmin.class);
expose(NamespaceQueryAdmin.class);
bind(PreviewRunner.class).to(DefaultPreviewRunner.class).in(Scopes.SINGLETON);
expose(PreviewRunner.class);
bind(PreviewStore.class).to(DefaultPreviewStore.class).in(Scopes.SINGLETON);
bind(Scheduler.class).to(NoOpScheduler.class);
bind(DataTracerFactory.class).to(DefaultDataTracerFactory.class);
expose(DataTracerFactory.class);
bind(OwnerStore.class).to(DefaultOwnerStore.class);
expose(OwnerStore.class);
bind(OwnerAdmin.class).to(DefaultOwnerAdmin.class);
expose(OwnerAdmin.class);
}
use of co.cask.cdap.internal.app.deploy.pipeline.AppDeploymentInfo in project cdap by caskdata.
the class AppFabricTestHelper method deployApplicationWithManager.
public static ApplicationWithPrograms deployApplicationWithManager(Id.Namespace namespace, Class<?> appClass, Supplier<File> folderSupplier, Config config) throws Exception {
ensureNamespaceExists(namespace.toEntityId());
Location deployedJar = createAppJar(appClass, folderSupplier);
ArtifactVersion artifactVersion = new ArtifactVersion(String.format("1.0.%d", System.currentTimeMillis()));
ArtifactId artifactId = new ArtifactId(appClass.getSimpleName(), artifactVersion, ArtifactScope.USER);
ArtifactDescriptor artifactDescriptor = new ArtifactDescriptor(artifactId, deployedJar);
ArtifactRepository artifactRepository = getInjector().getInstance(ArtifactRepository.class);
artifactRepository.addArtifact(Id.Artifact.fromEntityId(Artifacts.toArtifactId(namespace.toEntityId(), artifactId)), new File(deployedJar.toURI()));
AppDeploymentInfo info = new AppDeploymentInfo(artifactDescriptor, namespace.toEntityId(), appClass.getName(), null, null, config == null ? null : new Gson().toJson(config));
return getLocalManager().deploy(info).get();
}
Aggregations