elasticsearch/x-pack/plugin/inference/build.gradle
David Turner d5d81a57db
Upgrade AWS v2 SDK to 2.30.38 (#124738)
Adopts fix for https://github.com/aws/aws-sdk-java-v2/issues/5754,
removing the need for read permissions of sensitive files in
`${HOME}/.aws`.
2025-03-14 07:38:39 +11:00

403 lines
20 KiB
Groovy

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
apply plugin: 'elasticsearch.internal-es-plugin'
apply plugin: 'elasticsearch.internal-cluster-test'
apply plugin: 'elasticsearch.internal-yaml-rest-test'
restResources {
restApi {
include '_common', 'bulk', 'indices', 'inference', 'index', 'get', 'update', 'reindex', 'search', 'field_caps', 'capabilities'
}
}
esplugin {
name = 'x-pack-inference'
description = 'Configuration and evaluation of inference models'
classname ='org.elasticsearch.xpack.inference.InferencePlugin'
extendedPlugins = ['x-pack-core']
}
base {
archivesName = 'x-pack-inference'
}
dependencies {
implementation project(path: ':libs:logging')
compileOnly project(":server")
compileOnly project(path: xpackModule('core'))
testImplementation(testArtifact(project(xpackModule('core'))))
testImplementation(testArtifact(project(':server')))
testImplementation(project(':x-pack:plugin:inference:qa:test-service-plugin'))
testImplementation project(':modules:reindex')
testImplementation project(':modules:mapper-extras')
clusterPlugins project(':x-pack:plugin:inference:qa:test-service-plugin')
api "com.ibm.icu:icu4j:${versions.icu4j}"
runtimeOnly 'com.google.guava:guava:32.0.1-jre'
implementation 'com.google.code.gson:gson:2.10'
implementation "com.google.protobuf:protobuf-java-util:${versions.protobuf}"
implementation "com.google.protobuf:protobuf-java:${versions.protobuf}"
implementation 'com.google.api.grpc:proto-google-iam-v1:1.6.2'
implementation 'com.google.auth:google-auth-library-credentials:1.11.0'
implementation 'com.google.auth:google-auth-library-oauth2-http:1.11.0'
implementation "com.google.oauth-client:google-oauth-client:${versions.google_oauth_client}"
implementation 'com.google.api-client:google-api-client:2.1.1'
implementation 'com.google.http-client:google-http-client:1.42.3'
implementation 'com.google.http-client:google-http-client-gson:1.42.3'
implementation 'com.google.http-client:google-http-client-appengine:1.42.3'
implementation 'com.google.http-client:google-http-client-jackson2:1.42.3'
implementation "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
implementation 'com.google.api:gax-httpjson:0.105.1'
implementation 'io.grpc:grpc-context:1.49.2'
implementation 'io.opencensus:opencensus-api:0.31.1'
implementation 'io.opencensus:opencensus-contrib-http-util:0.31.1'
/* AWS SDK v2 */
implementation ("software.amazon.awssdk:bedrockruntime:${versions.awsv2sdk}")
api "software.amazon.awssdk:protocol-core:${versions.awsv2sdk}"
api "software.amazon.awssdk:aws-json-protocol:${versions.awsv2sdk}"
api "software.amazon.awssdk:third-party-jackson-core:${versions.awsv2sdk}"
api "software.amazon.awssdk:http-auth-aws:${versions.awsv2sdk}"
api "software.amazon.awssdk:checksums-spi:${versions.awsv2sdk}"
api "software.amazon.awssdk:checksums:${versions.awsv2sdk}"
api "software.amazon.awssdk:sdk-core:${versions.awsv2sdk}"
api "org.reactivestreams:reactive-streams:${versions.reactive_streams}"
api "org.reactivestreams:reactive-streams-tck:${versions.reactive_streams}"
api "software.amazon.awssdk:profiles:${versions.awsv2sdk}"
api "software.amazon.awssdk:retries:${versions.awsv2sdk}"
api "software.amazon.awssdk:auth:${versions.awsv2sdk}"
api "software.amazon.awssdk:http-auth-aws-eventstream:${versions.awsv2sdk}"
api "software.amazon.eventstream:eventstream:1.0.1"
api "software.amazon.awssdk:http-auth-spi:${versions.awsv2sdk}"
api "software.amazon.awssdk:http-auth:${versions.awsv2sdk}"
api "software.amazon.awssdk:identity-spi:${versions.awsv2sdk}"
api "software.amazon.awssdk:http-client-spi:${versions.awsv2sdk}"
api "software.amazon.awssdk:regions:${versions.awsv2sdk}"
api "software.amazon.awssdk:annotations:${versions.awsv2sdk}"
api "software.amazon.awssdk:utils:${versions.awsv2sdk}"
api "software.amazon.awssdk:aws-core:${versions.awsv2sdk}"
api "software.amazon.awssdk:metrics-spi:${versions.awsv2sdk}"
api "software.amazon.awssdk:json-utils:${versions.awsv2sdk}"
api "software.amazon.awssdk:endpoints-spi:${versions.awsv2sdk}"
api "software.amazon.awssdk:retries-spi:${versions.awsv2sdk}"
/* Netty (via AWS SDKv2) */
implementation "software.amazon.awssdk:netty-nio-client:${versions.awsv2sdk}"
runtimeOnly "io.netty:netty-buffer:${versions.netty}"
runtimeOnly "io.netty:netty-codec-dns:${versions.netty}"
runtimeOnly "io.netty:netty-codec-http2:${versions.netty}"
runtimeOnly "io.netty:netty-codec-http:${versions.netty}"
runtimeOnly "io.netty:netty-codec:${versions.netty}"
runtimeOnly "io.netty:netty-common:${versions.netty}"
runtimeOnly "io.netty:netty-handler:${versions.netty}"
runtimeOnly "io.netty:netty-resolver-dns:${versions.netty}"
runtimeOnly "io.netty:netty-resolver:${versions.netty}"
runtimeOnly "io.netty:netty-transport-classes-epoll:${versions.netty}"
runtimeOnly "io.netty:netty-transport-native-unix-common:${versions.netty}"
runtimeOnly "io.netty:netty-transport:${versions.netty}"
/* SLF4J (via AWS SDKv2) */
api "org.slf4j:slf4j-api:${versions.slf4j}"
runtimeOnly "org.slf4j:slf4j-nop:${versions.slf4j}"
}
tasks.named("dependencyLicenses").configure {
mapping from: /google-auth-.*/, to: 'google-auth'
mapping from: /google-http-.*/, to: 'google-http'
mapping from: /opencensus.*/, to: 'opencensus'
mapping from: /protobuf.*/, to: 'protobuf'
mapping from: /proto-google.*/, to: 'proto-google'
mapping from: /jackson.*/, to: 'jackson'
mapping from: /reactive-streams.*/, to: 'reactive-streams'
mapping from: /eventstream.*/, to: 'eventstream'
mapping from: /slf4j.*/, to: 'slf4j'
mapping from: /protocol-core.*/, to: 'aws-sdk-2'
mapping from: /aws-json-protocol.*/, to: 'aws-sdk-2'
mapping from: /third-party-jackson-core.*/, to: 'aws-sdk-2'
mapping from: /checksums-spi.*/, to: 'aws-sdk-2'
mapping from: /checksums.*/, to: 'aws-sdk-2'
mapping from: /sdk-core.*/, to: 'aws-sdk-2'
mapping from: /profiles.*/, to: 'aws-sdk-2'
mapping from: /retries.*/, to: 'aws-sdk-2'
mapping from: /auth.*/, to: 'aws-sdk-2'
mapping from: /http-auth-aws-eventstream.*/, to: 'aws-sdk-2'
mapping from: /http-auth-spi.*/, to: 'aws-sdk-2'
mapping from: /http-auth.*/, to: 'aws-sdk-2'
mapping from: /http-auth-aws.*/, to: 'aws-sdk-2'
mapping from: /identity-spi.*/, to: 'aws-sdk-2'
mapping from: /http-client-spi.*/, to: 'aws-sdk-2'
mapping from: /regions.*/, to: 'aws-sdk-2'
mapping from: /annotations.*/, to: 'aws-sdk-2'
mapping from: /utils.*/, to: 'aws-sdk-2'
mapping from: /aws-core.*/, to: 'aws-sdk-2'
mapping from: /metrics-spi.*/, to: 'aws-sdk-2'
mapping from: /json-utils.*/, to: 'aws-sdk-2'
mapping from: /endpoints-spi.*/, to: 'aws-sdk-2'
mapping from: /bedrockruntime.*/, to: 'aws-sdk-2'
mapping from: /netty-nio-client/, to: 'aws-sdk-2'
/* Cannot use REGEX to match netty-* because netty-nio-client is an AWS package */
mapping from: /netty-buffer/, to: 'netty'
mapping from: /netty-codec-dns/, to: 'netty'
mapping from: /netty-codec-http2/, to: 'netty'
mapping from: /netty-codec-http/, to: 'netty'
mapping from: /netty-codec/, to: 'netty'
mapping from: /netty-common/, to: 'netty'
mapping from: /netty-handler/, to: 'netty'
mapping from: /netty-resolver-dns/, to: 'netty'
mapping from: /netty-resolver/, to: 'netty'
mapping from: /netty-transport-classes-epoll/, to: 'netty'
mapping from: /netty-transport-native-unix-common/, to: 'netty'
mapping from: /netty-transport/, to: 'netty'
}
tasks.named("thirdPartyAudit").configure {
ignoreViolations(
// uses internal java api: sun.misc.Unsafe
'com.google.protobuf.UnsafeUtil',
'com.google.protobuf.UnsafeUtil$1',
'com.google.protobuf.UnsafeUtil$JvmMemoryAccessor',
'com.google.protobuf.UnsafeUtil$MemoryAccessor',
'com.google.protobuf.MessageSchema',
'com.google.protobuf.UnsafeUtil$Android32MemoryAccessor',
'com.google.protobuf.UnsafeUtil$Android64MemoryAccessor',
'com.google.common.cache.Striped64',
'com.google.common.cache.Striped64$1',
'com.google.common.cache.Striped64$Cell',
'com.google.common.hash.Striped64',
'com.google.common.hash.Striped64$1',
'com.google.common.hash.Striped64$Cell',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$1',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$2',
'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper',
'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper$1',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray',
'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator',
'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1',
'io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator',
'io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator$1',
'io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator$2',
'io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator$3',
'io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator$4',
'io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator$5',
'io.netty.util.internal.PlatformDependent0',
'io.netty.util.internal.PlatformDependent0$1',
'io.netty.util.internal.PlatformDependent0$2',
'io.netty.util.internal.PlatformDependent0$3',
'io.netty.util.internal.PlatformDependent0$4',
'io.netty.util.internal.PlatformDependent0$6',
'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueConsumerNodeRef',
'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueProducerNodeRef',
'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueColdProducerFields',
'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueConsumerFields',
'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueProducerFields',
'io.netty.util.internal.shaded.org.jctools.queues.LinkedQueueNode',
'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueConsumerIndexField',
'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerIndexField',
'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerLimitField',
'io.netty.util.internal.shaded.org.jctools.queues.MpmcArrayQueueConsumerIndexField',
'io.netty.util.internal.shaded.org.jctools.queues.MpmcArrayQueueProducerIndexField',
'io.netty.util.internal.shaded.org.jctools.queues.unpadded.MpscUnpaddedArrayQueueConsumerIndexField',
'io.netty.util.internal.shaded.org.jctools.queues.unpadded.MpscUnpaddedArrayQueueProducerIndexField',
'io.netty.util.internal.shaded.org.jctools.queues.unpadded.MpscUnpaddedArrayQueueProducerLimitField',
'io.netty.util.internal.shaded.org.jctools.util.UnsafeAccess',
'io.netty.util.internal.shaded.org.jctools.util.UnsafeRefArrayAccess',
'io.netty.util.internal.shaded.org.jctools.util.UnsafeLongArrayAccess'
)
ignoreMissingClasses(
'com.google.api.AnnotationsProto',
'com.google.api.ClientProto',
'com.google.api.FieldBehaviorProto',
'com.google.api.ResourceProto',
'com.google.api.core.AbstractApiFuture',
'com.google.api.core.ApiFunction',
'com.google.api.core.ApiFuture',
'com.google.api.core.ApiFutureCallback',
'com.google.api.core.ApiFutures',
'com.google.api.gax.core.BackgroundResource',
'com.google.api.gax.core.ExecutorProvider',
'com.google.api.gax.core.GaxProperties',
'com.google.api.gax.core.GoogleCredentialsProvider',
'com.google.api.gax.core.GoogleCredentialsProvider$Builder',
'com.google.api.gax.core.InstantiatingExecutorProvider',
'com.google.api.gax.core.InstantiatingExecutorProvider$Builder',
'com.google.api.gax.longrunning.OperationSnapshot',
'com.google.api.gax.paging.AbstractFixedSizeCollection',
'com.google.api.gax.paging.AbstractPage',
'com.google.api.gax.paging.AbstractPagedListResponse',
'com.google.api.gax.retrying.RetrySettings',
'com.google.api.gax.retrying.RetrySettings$Builder',
'com.google.api.gax.rpc.ApiCallContext',
'com.google.api.gax.rpc.ApiCallContext$Key',
'com.google.api.gax.rpc.ApiClientHeaderProvider',
'com.google.api.gax.rpc.ApiClientHeaderProvider$Builder',
'com.google.api.gax.rpc.ApiException',
'com.google.api.gax.rpc.ApiExceptionFactory',
'com.google.api.gax.rpc.BatchingCallSettings',
'com.google.api.gax.rpc.Callables',
'com.google.api.gax.rpc.ClientContext',
'com.google.api.gax.rpc.ClientSettings',
'com.google.api.gax.rpc.ClientSettings$Builder',
'com.google.api.gax.rpc.FixedHeaderProvider',
'com.google.api.gax.rpc.HeaderProvider',
'com.google.api.gax.rpc.LongRunningClient',
'com.google.api.gax.rpc.OperationCallSettings',
'com.google.api.gax.rpc.OperationCallable',
'com.google.api.gax.rpc.PageContext',
'com.google.api.gax.rpc.PagedCallSettings',
'com.google.api.gax.rpc.PagedCallSettings$Builder',
'com.google.api.gax.rpc.PagedListDescriptor',
'com.google.api.gax.rpc.PagedListResponseFactory',
'com.google.api.gax.rpc.ResponseObserver',
'com.google.api.gax.rpc.ServerStreamingCallSettings',
'com.google.api.gax.rpc.ServerStreamingCallable',
'com.google.api.gax.rpc.StateCheckingResponseObserver',
'com.google.api.gax.rpc.StatusCode',
'com.google.api.gax.rpc.StatusCode$Code',
'com.google.api.gax.rpc.StreamController',
'com.google.api.gax.rpc.StubSettings',
'com.google.api.gax.rpc.StubSettings$Builder',
'com.google.api.gax.rpc.TranslatingUnaryCallable',
'com.google.api.gax.rpc.TransportChannel',
'com.google.api.gax.rpc.TransportChannelProvider',
'com.google.api.gax.rpc.UnaryCallSettings',
'com.google.api.gax.rpc.UnaryCallSettings$Builder',
'com.google.api.gax.rpc.UnaryCallable',
'com.google.api.gax.rpc.internal.ApiCallContextOptions',
'com.google.api.gax.rpc.internal.Headers',
'com.google.api.gax.rpc.mtls.MtlsProvider',
'com.google.api.gax.tracing.ApiTracer',
'com.google.api.gax.tracing.BaseApiTracer',
'com.google.api.gax.tracing.SpanName',
'com.google.api.pathtemplate.PathTemplate',
'com.google.common.util.concurrent.internal.InternalFutureFailureAccess',
'com.google.common.util.concurrent.internal.InternalFutures',
'com.google.longrunning.CancelOperationRequest',
'com.google.longrunning.CancelOperationRequest$Builder',
'com.google.longrunning.DeleteOperationRequest',
'com.google.longrunning.DeleteOperationRequest$Builder',
'com.google.longrunning.GetOperationRequest',
'com.google.longrunning.GetOperationRequest$Builder',
'com.google.longrunning.ListOperationsRequest',
'com.google.longrunning.ListOperationsRequest$Builder',
'com.google.longrunning.ListOperationsResponse',
'com.google.longrunning.Operation',
'com.google.rpc.Code',
'com.google.rpc.Status',
'com.google.type.Expr',
'com.google.type.Expr$Builder',
'com.google.type.ExprOrBuilder',
'com.google.type.ExprProto',
'org.threeten.bp.Duration',
'org.threeten.bp.Instant',
'com.google.api.client.http.apache.v2.ApacheHttpTransport',
'com.google.appengine.api.datastore.Blob',
'com.google.appengine.api.datastore.DatastoreService',
'com.google.appengine.api.datastore.DatastoreServiceFactory',
'com.google.appengine.api.datastore.Entity',
'com.google.appengine.api.datastore.Key',
'com.google.appengine.api.datastore.KeyFactory',
'com.google.appengine.api.datastore.PreparedQuery',
'com.google.appengine.api.datastore.Query',
'com.google.appengine.api.memcache.Expiration',
'com.google.appengine.api.memcache.MemcacheService',
'com.google.appengine.api.memcache.MemcacheServiceFactory',
'com.google.appengine.api.urlfetch.FetchOptions$Builder',
'com.google.appengine.api.urlfetch.FetchOptions',
'com.google.appengine.api.urlfetch.HTTPHeader',
'com.google.appengine.api.urlfetch.HTTPMethod',
'com.google.appengine.api.urlfetch.HTTPRequest',
'com.google.appengine.api.urlfetch.HTTPResponse',
'com.google.appengine.api.urlfetch.URLFetchService',
'com.aayushatharva.brotli4j.Brotli4jLoader',
'com.aayushatharva.brotli4j.decoder.DecoderJNI$Status',
'com.aayushatharva.brotli4j.decoder.DecoderJNI$Wrapper',
'com.aayushatharva.brotli4j.encoder.BrotliEncoderChannel',
'com.aayushatharva.brotli4j.encoder.Encoder$Mode',
'com.aayushatharva.brotli4j.encoder.Encoder$Parameters',
'com.github.luben.zstd.Zstd',
'com.github.luben.zstd.ZstdInputStreamNoFinalizer',
'com.github.luben.zstd.util.Native',
'com.google.appengine.api.urlfetch.URLFetchServiceFactory',
'com.google.protobuf.nano.CodedOutputByteBufferNano',
'com.google.protobuf.nano.MessageNano',
'com.jcraft.jzlib.Deflater',
'com.jcraft.jzlib.Inflater',
'com.jcraft.jzlib.JZlib',
'com.jcraft.jzlib.JZlib$WrapperType',
'com.ning.compress.BufferRecycler',
'com.ning.compress.lzf.ChunkDecoder',
'com.ning.compress.lzf.ChunkEncoder',
'com.ning.compress.lzf.LZFChunk',
'com.ning.compress.lzf.LZFEncoder',
'com.ning.compress.lzf.util.ChunkDecoderFactory',
'com.ning.compress.lzf.util.ChunkEncoderFactory',
'io.netty.internal.tcnative.AsyncSSLPrivateKeyMethod',
'io.netty.internal.tcnative.AsyncTask',
'io.netty.internal.tcnative.Buffer',
'io.netty.internal.tcnative.CertificateCallback',
'io.netty.internal.tcnative.CertificateCompressionAlgo',
'io.netty.internal.tcnative.CertificateVerifier',
'io.netty.internal.tcnative.Library',
'io.netty.internal.tcnative.ResultCallback',
'io.netty.internal.tcnative.SSL',
'io.netty.internal.tcnative.SSLContext',
'io.netty.internal.tcnative.SSLPrivateKeyMethod',
'io.netty.internal.tcnative.SSLSession',
'io.netty.internal.tcnative.SSLSessionCache',
'io.netty.internal.tcnative.SessionTicketKey',
'io.netty.internal.tcnative.SniHostNameMatcher',
'lzma.sdk.lzma.Encoder',
'org.bouncycastle.cert.X509v3CertificateBuilder',
'org.bouncycastle.cert.jcajce.JcaX509CertificateConverter',
'org.bouncycastle.openssl.PEMEncryptedKeyPair',
'org.bouncycastle.openssl.PEMParser',
'org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter',
'org.bouncycastle.openssl.jcajce.JceOpenSSLPKCS8DecryptorProviderBuilder',
'org.bouncycastle.openssl.jcajce.JcePEMDecryptorProviderBuilder',
'org.bouncycastle.operator.jcajce.JcaContentSignerBuilder',
'org.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfo',
'org.conscrypt.AllocatedBuffer',
'org.conscrypt.BufferAllocator',
'org.conscrypt.Conscrypt',
'org.conscrypt.HandshakeListener',
'org.eclipse.jetty.alpn.ALPN',
'org.eclipse.jetty.alpn.ALPN$ClientProvider',
'org.eclipse.jetty.alpn.ALPN$ServerProvider',
'org.eclipse.jetty.npn.NextProtoNego',
'org.eclipse.jetty.npn.NextProtoNego$ClientProvider',
'org.eclipse.jetty.npn.NextProtoNego$ServerProvider',
'org.jboss.marshalling.ByteInput',
'org.jboss.marshalling.ByteOutput',
'org.jboss.marshalling.Marshaller',
'org.jboss.marshalling.MarshallerFactory',
'org.jboss.marshalling.MarshallingConfiguration',
'org.jboss.marshalling.Unmarshaller',
'org.reactivestreams.example.unicast.AsyncIterablePublisher',
'org.testng.Assert',
'reactor.blockhound.BlockHound$Builder',
'reactor.blockhound.integration.BlockHoundIntegration',
'software.amazon.awssdk.crt.auth.credentials.Credentials',
'software.amazon.awssdk.crt.auth.signing.AwsSigner',
'software.amazon.awssdk.crt.auth.signing.AwsSigningConfig',
'software.amazon.awssdk.crt.auth.signing.AwsSigningConfig$AwsSignatureType',
'software.amazon.awssdk.crt.auth.signing.AwsSigningConfig$AwsSignedBodyHeaderType',
'software.amazon.awssdk.crt.auth.signing.AwsSigningConfig$AwsSigningAlgorithm',
'software.amazon.awssdk.crt.auth.signing.AwsSigningResult',
'software.amazon.awssdk.crt.http.HttpHeader',
'software.amazon.awssdk.crt.http.HttpRequest',
'software.amazon.awssdk.crt.http.HttpRequestBodyStream',
)
}
tasks.named('yamlRestTest') {
usesDefaultDistribution()
}