use of com.google.cloud.aiplatform.v1.Endpoint in project wildfly-core by wildfly.
the class DomainServerCommunicationServices method activate.
@Override
public void activate(final ServiceActivatorContext serviceActivatorContext) throws ServiceRegistryException {
final ServiceTarget serviceTarget = serviceActivatorContext.getServiceTarget();
final ServiceName endpointName = managementSubsystemEndpoint ? RemotingServices.SUBSYSTEM_ENDPOINT : ManagementRemotingServices.MANAGEMENT_ENDPOINT;
final EndpointService.EndpointType endpointType = managementSubsystemEndpoint ? EndpointService.EndpointType.SUBSYSTEM : EndpointService.EndpointType.MANAGEMENT;
try {
ManagementWorkerService.installService(serviceTarget);
// TODO see if we can figure out a way to work in the vault resolver instead of having to use ExpressionResolver.SIMPLE
@SuppressWarnings("deprecation") final OptionMap options = EndpointConfigFactory.create(ExpressionResolver.SIMPLE, endpointConfig, DEFAULTS);
ManagementRemotingServices.installRemotingManagementEndpoint(serviceTarget, endpointName, WildFlySecurityManager.getPropertyPrivileged(ServerEnvironment.NODE_NAME, null), endpointType, options);
// Install the communication services
final ServiceBuilder<?> sb = serviceTarget.addService(HostControllerConnectionService.SERVICE_NAME);
final Supplier<ExecutorService> esSupplier = Services.requireServerExecutor(sb);
final Supplier<ScheduledExecutorService> sesSupplier = sb.requires(ServerService.JBOSS_SERVER_SCHEDULED_EXECUTOR);
final Supplier<Endpoint> eSupplier = sb.requires(endpointName);
final Supplier<ProcessStateNotifier> cpsnSupplier = sb.requires(ControlledProcessStateService.INTERNAL_SERVICE_NAME);
sb.setInstance(new HostControllerConnectionService(managementURI, serverName, serverProcessName, authKey, initialOperationID, managementSubsystemEndpoint, sslContextSupplier, esSupplier, sesSupplier, eSupplier, cpsnSupplier));
sb.install();
} catch (OperationFailedException e) {
throw new ServiceRegistryException(e);
}
}
use of com.google.cloud.aiplatform.v1.Endpoint in project wildfly-core by wildfly.
the class RemotingHttpUpgradeService method installServices.
public static void installServices(final OperationContext context, final String remotingConnectorName, final String httpConnectorName, final ServiceName endpointName, final OptionMap connectorPropertiesOptionMap, final String saslAuthenticationFactory) {
final ServiceTarget serviceTarget = context.getServiceTarget();
final ServiceName serviceName = UPGRADE_SERVICE_NAME.append(remotingConnectorName);
final ServiceBuilder<?> sb = serviceTarget.addService(serviceName);
final Consumer<RemotingHttpUpgradeService> serviceConsumer = sb.provides(serviceName);
final Supplier<ChannelUpgradeHandler> urSupplier = sb.requires(HTTP_UPGRADE_REGISTRY.append(httpConnectorName));
final Supplier<ListenerRegistry> lrSupplier = sb.requires(RemotingServices.HTTP_LISTENER_REGISTRY);
final Supplier<Endpoint> eSupplier = sb.requires(endpointName);
final Supplier<SaslAuthenticationFactory> safSupplier = saslAuthenticationFactory != null ? sb.requires(context.getCapabilityServiceName(SASL_AUTHENTICATION_FACTORY_CAPABILITY, saslAuthenticationFactory, SaslAuthenticationFactory.class)) : null;
sb.setInstance(new RemotingHttpUpgradeService(serviceConsumer, urSupplier, lrSupplier, eSupplier, safSupplier, httpConnectorName, endpointName.getSimpleName(), connectorPropertiesOptionMap));
sb.setInitialMode(ServiceController.Mode.ACTIVE);
sb.install();
}
use of com.google.cloud.aiplatform.v1.Endpoint in project wildfly-core by wildfly.
the class RemotingServices method installConnectorServicesForNetworkInterfaceBinding.
@Deprecated
public static void installConnectorServicesForNetworkInterfaceBinding(final ServiceTarget serviceTarget, final ServiceName endpointName, final String connectorName, final ServiceName networkInterfaceBindingName, final int port, final OptionMap connectorPropertiesOptionMap, final ServiceName saslAuthenticationFactory, final ServiceName sslContext, final ServiceName socketBindingManager) {
final ServiceName serviceName = serverServiceName(connectorName);
final ServiceBuilder<?> builder = serviceTarget.addService(serviceName);
final Consumer<AcceptingChannel<StreamConnection>> streamServerConsumer = builder.provides(serviceName);
final Supplier<Endpoint> eSupplier = builder.requires(endpointName);
final Supplier<SaslAuthenticationFactory> safSupplier = saslAuthenticationFactory != null ? builder.requires(saslAuthenticationFactory) : null;
final Supplier<SSLContext> scSupplier = sslContext != null ? builder.requires(sslContext) : null;
final Supplier<SocketBindingManager> sbmSupplier = socketBindingManager != null ? builder.requires(socketBindingManager) : null;
final Supplier<NetworkInterfaceBinding> ibSupplier = builder.requires(networkInterfaceBindingName);
builder.setInstance(new InjectedNetworkBindingStreamServerService(streamServerConsumer, eSupplier, safSupplier, scSupplier, sbmSupplier, ibSupplier, connectorPropertiesOptionMap, port));
builder.install();
}
use of com.google.cloud.aiplatform.v1.Endpoint in project wildfly-core by wildfly.
the class RemotingServices method installConnectorServicesForSocketBinding.
public static void installConnectorServicesForSocketBinding(final ServiceTarget serviceTarget, final ServiceName endpointName, final String connectorName, final ServiceName socketBindingName, final OptionMap connectorPropertiesOptionMap, final ServiceName saslAuthenticationFactory, final ServiceName sslContext, final ServiceName socketBindingManager) {
final ServiceName serviceName = serverServiceName(connectorName);
final ServiceBuilder<?> builder = serviceTarget.addService(serviceName);
final Consumer<AcceptingChannel<StreamConnection>> streamServerConsumer = builder.provides(serviceName);
final Supplier<Endpoint> eSupplier = builder.requires(endpointName);
final Supplier<SaslAuthenticationFactory> safSupplier = saslAuthenticationFactory != null ? builder.requires(saslAuthenticationFactory) : null;
final Supplier<SSLContext> scSupplier = sslContext != null ? builder.requires(sslContext) : null;
final Supplier<SocketBindingManager> sbmSupplier = builder.requires(socketBindingManager);
final Supplier<SocketBinding> sbSupplier = builder.requires(socketBindingName);
builder.setInstance(new InjectedSocketBindingStreamServerService(streamServerConsumer, eSupplier, safSupplier, scSupplier, sbmSupplier, sbSupplier, connectorPropertiesOptionMap));
builder.install();
}
use of com.google.cloud.aiplatform.v1.Endpoint in project java-aiplatform by googleapis.
the class UndeployModelSample method undeployModelSample.
static void undeployModelSample(String project, String endpointId, String modelId) throws IOException, InterruptedException, ExecutionException, TimeoutException {
EndpointServiceSettings endpointServiceSettings = EndpointServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
// the "close" method on the client to safely clean up any remaining background resources.
try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create(endpointServiceSettings)) {
String location = "us-central1";
EndpointName endpointName = EndpointName.of(project, location, endpointId);
ModelName modelName = ModelName.of(project, location, modelId);
// key '0' assigns traffic for the newly deployed model
// Traffic percentage values must add up to 100
// Leave dictionary empty if endpoint should not accept any traffic
Map<String, Integer> trafficSplit = new HashMap<>();
trafficSplit.put("0", 100);
OperationFuture<UndeployModelResponse, UndeployModelOperationMetadata> operation = endpointServiceClient.undeployModelAsync(endpointName.toString(), modelName.toString(), trafficSplit);
System.out.format("Operation name: %s\n", operation.getInitialFuture().get().getName());
System.out.println("Waiting for operation to finish...");
UndeployModelResponse undeployModelResponse = operation.get(180, TimeUnit.SECONDS);
System.out.format("Undeploy Model Response: %s\n", undeployModelResponse);
}
}
Aggregations