@Test public void shouldPropagateCreateExecutionToStub() { client.createExecution(DOMAIN, PROJECT, LP_IDENTIFIER); assertThat( stubService.createExecutionRequest, equalTo( ExecutionOuterClass.ExecutionCreateRequest.newBuilder() .setDomain(DOMAIN) .setProject(PROJECT) .setSpec(newExecutionSpec()) .build())); }
void createExecution(String domain, String project, LaunchPlanIdentifier launchPlanId) { LOG.debug("createExecution {} {} {}", domain, project, launchPlanId); ExecutionOuterClass.ExecutionMetadata metadata = ExecutionOuterClass.ExecutionMetadata.newBuilder() .setMode(ExecutionOuterClass.ExecutionMetadata.ExecutionMode.MANUAL) .setPrincipal(TRIGGERING_PRINCIPAL) .setNesting(USER_TRIGGERED_EXECUTION_NESTING) .build(); ExecutionOuterClass.ExecutionSpec spec = ExecutionOuterClass.ExecutionSpec.newBuilder() .setLaunchPlan(ProtoUtil.serialize(launchPlanId)) .setMetadata(metadata) .build(); ExecutionOuterClass.ExecutionCreateResponse response = stub.createExecution( ExecutionOuterClass.ExecutionCreateRequest.newBuilder() .setDomain(domain) .setProject(project) .setSpec(spec) .build()); verifyNotNull( response, "Unexpected null response when creating execution %s on project %s domain %s", launchPlanId, project, domain); }
FlyteAdminClient implements AutoCloseable { void createExecution(String domain, String project, LaunchPlanIdentifier launchPlanId) { LOG.debug("createExecution {} {} {}", domain, project, launchPlanId); ExecutionOuterClass.ExecutionMetadata metadata = ExecutionOuterClass.ExecutionMetadata.newBuilder() .setMode(ExecutionOuterClass.ExecutionMetadata.ExecutionMode.MANUAL) .setPrincipal(TRIGGERING_PRINCIPAL) .setNesting(USER_TRIGGERED_EXECUTION_NESTING) .build(); ExecutionOuterClass.ExecutionSpec spec = ExecutionOuterClass.ExecutionSpec.newBuilder() .setLaunchPlan(ProtoUtil.serialize(launchPlanId)) .setMetadata(metadata) .build(); ExecutionOuterClass.ExecutionCreateResponse response = stub.createExecution( ExecutionOuterClass.ExecutionCreateRequest.newBuilder() .setDomain(domain) .setProject(project) .setSpec(spec) .build()); verifyNotNull( response, "Unexpected null response when creating execution %s on project %s domain %s", launchPlanId, project, domain); } }
FlyteAdminClient implements AutoCloseable { void createExecution(String domain, String project, LaunchPlanIdentifier launchPlanId) { LOG.debug("createExecution {} {} {}", domain, project, launchPlanId); ExecutionOuterClass.ExecutionMetadata metadata = ExecutionOuterClass.ExecutionMetadata.newBuilder() .setMode(ExecutionOuterClass.ExecutionMetadata.ExecutionMode.MANUAL) .setPrincipal(TRIGGERING_PRINCIPAL) .setNesting(USER_TRIGGERED_EXECUTION_NESTING) .build(); ExecutionOuterClass.ExecutionSpec spec = ExecutionOuterClass.ExecutionSpec.newBuilder() .setLaunchPlan(ProtoUtil.serialize(launchPlanId)) .setMetadata(metadata) .build(); ExecutionOuterClass.ExecutionCreateResponse response = stub.createExecution( ExecutionOuterClass.ExecutionCreateRequest.newBuilder() .setDomain(domain) .setProject(project) .setSpec(spec) .build()); verifyNotNull( response, "Unexpected null response when creating execution %s on project %s domain %s", launchPlanId, project, domain); } @VisibleForTesting  FlyteAdminClient(AdminServiceGrpc.AdminServiceBlockingStub stub, ManagedChannel channel); }
FlyteAdminClient implements AutoCloseable { void createExecution(String domain, String project, LaunchPlanIdentifier launchPlanId) { LOG.debug("createExecution {} {} {}", domain, project, launchPlanId); ExecutionOuterClass.ExecutionMetadata metadata = ExecutionOuterClass.ExecutionMetadata.newBuilder() .setMode(ExecutionOuterClass.ExecutionMetadata.ExecutionMode.MANUAL) .setPrincipal(TRIGGERING_PRINCIPAL) .setNesting(USER_TRIGGERED_EXECUTION_NESTING) .build(); ExecutionOuterClass.ExecutionSpec spec = ExecutionOuterClass.ExecutionSpec.newBuilder() .setLaunchPlan(ProtoUtil.serialize(launchPlanId)) .setMetadata(metadata) .build(); ExecutionOuterClass.ExecutionCreateResponse response = stub.createExecution( ExecutionOuterClass.ExecutionCreateRequest.newBuilder() .setDomain(domain) .setProject(project) .setSpec(spec) .build()); verifyNotNull( response, "Unexpected null response when creating execution %s on project %s domain %s", launchPlanId, project, domain); } @VisibleForTesting  FlyteAdminClient(AdminServiceGrpc.AdminServiceBlockingStub stub, ManagedChannel channel); @Override void close(); }
FlyteAdminClient implements AutoCloseable { void createExecution(String domain, String project, LaunchPlanIdentifier launchPlanId) { LOG.debug("createExecution {} {} {}", domain, project, launchPlanId); ExecutionOuterClass.ExecutionMetadata metadata = ExecutionOuterClass.ExecutionMetadata.newBuilder() .setMode(ExecutionOuterClass.ExecutionMetadata.ExecutionMode.MANUAL) .setPrincipal(TRIGGERING_PRINCIPAL) .setNesting(USER_TRIGGERED_EXECUTION_NESTING) .build(); ExecutionOuterClass.ExecutionSpec spec = ExecutionOuterClass.ExecutionSpec.newBuilder() .setLaunchPlan(ProtoUtil.serialize(launchPlanId)) .setMetadata(metadata) .build(); ExecutionOuterClass.ExecutionCreateResponse response = stub.createExecution( ExecutionOuterClass.ExecutionCreateRequest.newBuilder() .setDomain(domain) .setProject(project) .setSpec(spec) .build()); verifyNotNull( response, "Unexpected null response when creating execution %s on project %s domain %s", launchPlanId, project, domain); } @VisibleForTesting  FlyteAdminClient(AdminServiceGrpc.AdminServiceBlockingStub stub, ManagedChannel channel); @Override void close();  }