Search in sources :

Example 86 with Endpoint

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);
    }
}
Also used : ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) ServiceTarget(org.jboss.msc.service.ServiceTarget) OperationFailedException(org.jboss.as.controller.OperationFailedException) EndpointService(org.jboss.as.remoting.EndpointService) ProcessStateNotifier(org.jboss.as.controller.ProcessStateNotifier) ServiceRegistryException(org.jboss.msc.service.ServiceRegistryException) HostControllerConnectionService(org.jboss.as.server.mgmt.domain.HostControllerConnectionService) Endpoint(org.jboss.remoting3.Endpoint) ServiceName(org.jboss.msc.service.ServiceName) OptionMap(org.xnio.OptionMap) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) ExecutorService(java.util.concurrent.ExecutorService)

Example 87 with Endpoint

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();
}
Also used : ListenerRegistry(io.undertow.server.ListenerRegistry) ChannelUpgradeHandler(io.undertow.server.handlers.ChannelUpgradeHandler) ServiceTarget(org.jboss.msc.service.ServiceTarget) SaslAuthenticationFactory(org.wildfly.security.auth.server.SaslAuthenticationFactory) Endpoint(org.jboss.remoting3.Endpoint) ServiceName(org.jboss.msc.service.ServiceName)

Example 88 with Endpoint

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();
}
Also used : NetworkInterfaceBinding(org.jboss.as.network.NetworkInterfaceBinding) SSLContext(javax.net.ssl.SSLContext) SocketBindingManager(org.jboss.as.network.SocketBindingManager) SaslAuthenticationFactory(org.wildfly.security.auth.server.SaslAuthenticationFactory) Endpoint(org.jboss.remoting3.Endpoint) ServiceName(org.jboss.msc.service.ServiceName) AcceptingChannel(org.xnio.channels.AcceptingChannel)

Example 89 with Endpoint

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();
}
Also used : SocketBinding(org.jboss.as.network.SocketBinding) SSLContext(javax.net.ssl.SSLContext) SocketBindingManager(org.jboss.as.network.SocketBindingManager) SaslAuthenticationFactory(org.wildfly.security.auth.server.SaslAuthenticationFactory) Endpoint(org.jboss.remoting3.Endpoint) ServiceName(org.jboss.msc.service.ServiceName) AcceptingChannel(org.xnio.channels.AcceptingChannel)

Example 90 with Endpoint

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);
    }
}
Also used : ModelName(com.google.cloud.aiplatform.v1.ModelName) EndpointName(com.google.cloud.aiplatform.v1.EndpointName) HashMap(java.util.HashMap) EndpointServiceClient(com.google.cloud.aiplatform.v1.EndpointServiceClient) UndeployModelResponse(com.google.cloud.aiplatform.v1.UndeployModelResponse) EndpointServiceSettings(com.google.cloud.aiplatform.v1.EndpointServiceSettings) UndeployModelOperationMetadata(com.google.cloud.aiplatform.v1.UndeployModelOperationMetadata)

Aggregations

Endpoint (zipkin2.Endpoint)73 Span (zipkin2.Span)33 Test (org.junit.Test)28 Endpoint (org.jboss.remoting3.Endpoint)22 Test (org.junit.jupiter.api.Test)20 V1Span (zipkin2.v1.V1Span)16 NoopHealthCheckManager (com.wavefront.agent.channel.NoopHealthCheckManager)10 SpanSampler (com.wavefront.agent.sampler.SpanSampler)10 ByteBuf (io.netty.buffer.ByteBuf)10 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)10 DefaultFullHttpRequest (io.netty.handler.codec.http.DefaultFullHttpRequest)10 FullHttpRequest (io.netty.handler.codec.http.FullHttpRequest)10 Span (wavefront.report.Span)10 IOException (java.io.IOException)8 URI (java.net.URI)8 HashMap (java.util.HashMap)8 Annotation (wavefront.report.Annotation)8 ServiceName (org.jboss.msc.service.ServiceName)7 RateSampler (com.wavefront.sdk.entities.tracing.sampling.RateSampler)6 SaslAuthenticationFactory (org.wildfly.security.auth.server.SaslAuthenticationFactory)6