use of com.walmartlabs.concord.runtime.v2.runner.guice.BaseRunnerModule in project concord by walmartlabs.
the class MainTest method setUp.
@BeforeEach
public void setUp() throws IOException {
workDir = Files.createTempDirectory("test");
instanceId = UUID.randomUUID();
Path formsDir = workDir.resolve(Constants.Files.JOB_ATTACHMENTS_DIR_NAME).resolve(Constants.Files.JOB_STATE_DIR_NAME).resolve(Constants.Files.JOB_FORMS_V2_DIR_NAME);
formService = new FormService(formsDir);
processStatusCallback = mock(ProcessStatusCallback.class);
checkpointService = spy(new TestCheckpointUploader());
testServices = new AbstractModule() {
@Override
protected void configure() {
install(new BaseRunnerModule());
bind(ClassLoader.class).annotatedWith(Names.named("runtime")).toInstance(MainTest.class.getClassLoader());
bind(CheckpointUploader.class).toInstance(checkpointService);
bind(CheckpointService.class).to(DefaultCheckpointService.class);
bind(DependencyManager.class).to(DefaultDependencyManager.class);
bind(DockerService.class).to(DefaultDockerService.class);
bind(FileService.class).to(DefaultFileService.class);
bind(LockService.class).to(DefaultLockService.class);
bind(PersistenceService.class).toInstance(mock(PersistenceService.class));
bind(ProcessStatusCallback.class).toInstance(processStatusCallback);
bind(SecretService.class).to(DefaultSecretService.class);
Multibinder<TaskProvider> taskProviders = Multibinder.newSetBinder(binder(), TaskProvider.class);
taskProviders.addBinding().to(TaskV2Provider.class);
Multibinder<TaskCallListener> taskCallListeners = Multibinder.newSetBinder(binder(), TaskCallListener.class);
taskCallListeners.addBinding().to(TaskCallPolicyChecker.class);
taskCallListeners.addBinding().to(TaskResultListener.class);
Multibinder.newSetBinder(binder(), ExecutionListener.class);
}
};
allLogs = null;
}
use of com.walmartlabs.concord.runtime.v2.runner.guice.BaseRunnerModule in project concord by walmartlabs.
the class CliServicesModule method configure.
@Override
protected void configure() {
install(new BaseRunnerModule());
bind(RunnerLogger.class).to(SimpleLogger.class);
bind(SecretService.class).toInstance(new CliSecretService(workDir, secretStoreDir, vaultProvider));
bind(DockerService.class).to(CliDockerService.class);
bind(CheckpointService.class).to(CliCheckpointService.class);
bind(PersistenceService.class).to(DefaultPersistenceService.class);
bind(ProcessStatusCallback.class).toInstance(instanceId -> {
});
bind(DefaultTaskVariablesService.class).toInstance(new MapBackedDefaultTaskVariablesService(readDefaultVars()));
bind(LockService.class).to(CliLockService.class);
bind(DependencyManager.class).toInstance(dependencyManager);
bind(com.walmartlabs.concord.runtime.v2.sdk.DependencyManager.class).to(DefaultDependencyManager.class).in(Singleton.class);
Multibinder.newSetBinder(binder(), ExecutionListener.class);
}
Aggregations