Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Azure repository SDK to v12 #65140

Merged
merged 43 commits into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e6c2396
Upgrade azure sdk
fcofdez Jul 10, 2020
01c744e
Fix tests
fcofdez Nov 17, 2020
f3ef260
Delegate to regular scheduler instead of into a custom one
fcofdez Nov 18, 2020
782ac90
Update default max connections.
fcofdez Nov 18, 2020
1eb89fd
More efficient blob reading
fcofdez Nov 19, 2020
61039c9
Merge remote-tracking branch 'origin/master' into azure-sdk-upgrade
fcofdez Nov 19, 2020
9bd2455
Take into account retries during reads
fcofdez Nov 20, 2020
5325997
Merge remote-tracking branch 'origin/master' into azure-sdk-upgrade
fcofdez Nov 20, 2020
f380443
Fix failing test
fcofdez Nov 20, 2020
d9f2e88
Grant permissions to tasks executed in reactor schedulers.
fcofdez Nov 23, 2020
b839a28
Merge remote-tracking branch 'origin/master' into azure-sdk-upgrade
fcofdez Nov 23, 2020
dded822
Merge remote-tracking branch 'origin/master' into azure-sdk-upgrade
fcofdez Nov 24, 2020
0e8049f
Use regular delete requests instead of the batch API
fcofdez Nov 24, 2020
c47fcf4
Initialize jackson parser during AzureRepositoryPlugin class
fcofdez Nov 26, 2020
0f522ad
Force azure impl to be public
rjernst Dec 2, 2020
49ec9f5
Make public additional sdk interfaces to avoid permission issues
fcofdez Dec 2, 2020
a27c23b
Fix precommit error
fcofdez Dec 2, 2020
16a0dc9
Fix wiring of tasks
rjernst Dec 2, 2020
eff0b69
Handle timeout configuration correctly
fcofdez Dec 3, 2020
ea047b4
Merge remote-tracking branch 'origin/master' into azure-sdk-upgrade
fcofdez Dec 4, 2020
6569f18
Remove unused dependency
fcofdez Dec 4, 2020
302c366
Add tests for LocationMode configurations
fcofdez Dec 4, 2020
8791953
Make InnerClass marker public too durin the azure sdk services rewrite.
fcofdez Dec 4, 2020
3449e3b
Add tests for using SECONDARY_ONLY endpoints
fcofdez Dec 4, 2020
fde3984
Add min values to AzureClientProvider settings
fcofdez Dec 4, 2020
cb72104
Cleanup publicifier
rjernst Dec 4, 2020
f2c17b5
restore docker maybe...
rjernst Dec 4, 2020
8f9f715
Read eagerly on AzureInputStream
fcofdez Dec 4, 2020
eae2cee
Add tests for retry strategies
fcofdez Dec 4, 2020
32e0161
Merge remote-tracking branch 'fcofdez/azure-sdk-upgrade-new' into azu…
fcofdez Dec 4, 2020
993e761
Fix checkStyle
fcofdez Dec 4, 2020
9001110
Merge remote-tracking branch 'origin/master' into azure-sdk-upgrade
fcofdez Dec 8, 2020
904c60a
Move to read the entire stream instead of reading it in chunks
fcofdez Dec 11, 2020
59f6ab3
Merge remote-tracking branch 'origin/master' into azure-sdk-upgrade
fcofdez Dec 13, 2020
2c3eefa
Use a concurrent queue
fcofdez Dec 14, 2020
974bc38
Use the proper max chunk size
fcofdez Dec 14, 2020
2c19d71
Remove unnecessary settings
fcofdez Dec 14, 2020
8295186
Merge remote-tracking branch 'origin/master' into azure-sdk-upgrade
fcofdez Dec 14, 2020
5ab14d3
Revert line break
fcofdez Dec 15, 2020
e5563f2
Merge remote-tracking branch 'origin/master' into azure-sdk-upgrade
fcofdez Dec 15, 2020
8db3d00
Remove dead code
fcofdez Dec 15, 2020
9c6ea82
Remove unused import
fcofdez Dec 15, 2020
e1ff337
Merge remote-tracking branch 'origin/master' into azure-sdk-upgrade
fcofdez Dec 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,33 @@ public class LicenseAnalyzer {
Pattern.DOTALL
)
),
new LicenseMatcher(
"MIT-0",
true,
false,
Pattern.compile(
("MIT No Attribution\n"
+ "Copyright .+\n"
+ "\n"
+ "Permission is hereby granted, free of charge, to any person obtaining a copy of "
+ "this software and associated documentation files \\(the \"Software\"\\), to deal in the Software without "
+ "restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, "
+ "and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so.\n"
+ "\n"
+ "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, "
+ "INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND "
+ "NONINFRINGEMENT\\. IN NO EVENT SHALL THE AUTHORS OR "
+ "COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR "
+ "OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
.replaceAll("\\s+", "\\\\s*"),
Pattern.DOTALL
)
),
new LicenseMatcher("MPL-1.1", true, false, Pattern.compile("Mozilla Public License.*Version 1.1", Pattern.DOTALL)),
new LicenseMatcher("MPL-2.0", true, false, Pattern.compile("Mozilla\\s*Public\\s*License\\s*Version\\s*2\\.0", Pattern.DOTALL)),
new LicenseMatcher("XZ", false, false, Pattern.compile("Licensing of XZ for Java", Pattern.DOTALL)),
new LicenseMatcher("EPL-2.0", true, false, Pattern.compile("Eclipse Public License - v 2.0", Pattern.DOTALL)),
new LicenseMatcher("EDL-1.0", true, false, Pattern.compile("Eclipse Distribution License - v 1.0", Pattern.DOTALL)),
new LicenseMatcher("LGPL-2.1", true, true, Pattern.compile("GNU LESSER GENERAL PUBLIC LICENSE.*Version 2.1", Pattern.DOTALL)),
new LicenseMatcher("LGPL-3.0", true, true, Pattern.compile("GNU LESSER GENERAL PUBLIC LICENSE.*Version 3", Pattern.DOTALL)) };

Expand Down
272 changes: 251 additions & 21 deletions plugins/repository-azure/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,62 @@ esplugin {
classname 'org.elasticsearch.repositories.azure.AzureRepositoryPlugin'
}

versions << [
'azure': '12.9.0',
'azureCore': '1.10.0',
'azureCoreHttpNetty': '1.6.3',

'jakartaActivation': '1.2.1',
'jakartaXMLBind': '2.3.2',
'stax2API': '4.2',
'woodstox': '6.0.2',

'reactorNetty': '0.9.12.RELEASE',
'reactorCore': '3.3.10.RELEASE',
'reactiveStreams': '1.0.3',
]

dependencies {
api 'com.microsoft.azure:azure-storage:8.6.2'
api 'com.microsoft.azure:azure-keyvault-core:1.0.0'
runtimeOnly 'com.google.guava:guava:20.0'
api 'org.apache.commons:commons-lang3:3.4'
api "com.azure:azure-storage-blob:${versions.azure}"
api "com.azure:azure-storage-blob-batch:12.6.0"
api "com.azure:azure-storage-common:${versions.azure}"
api "com.azure:azure-core-http-netty:${versions.azureCoreHttpNetty}"
api "com.azure:azure-core:${versions.azureCore}"

// jackson
api "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
api "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"

// jackson xml
api "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${versions.jackson}"
api "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${versions.jackson}"
api "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${versions.jackson}"
api "jakarta.activation:jakarta.activation-api:${versions.jakartaActivation}"
api "jakarta.xml.bind:jakarta.xml.bind-api:${versions.jakartaXMLBind}"
api "org.codehaus.woodstox:stax2-api:${versions.stax2API}"
api "com.fasterxml.woodstox:woodstox-core:${versions.woodstox}"

// netty
api "io.netty:netty-buffer:${versions.netty}"
api "io.netty:netty-codec-http:${versions.netty}"
api "io.netty:netty-codec-http2:${versions.netty}"
api "io.netty:netty-codec-socks:${versions.netty}"
api "io.netty:netty-codec:${versions.netty}"
api "io.netty:netty-common:${versions.netty}"
api "io.netty:netty-handler-proxy:${versions.netty}"
api "io.netty:netty-handler:${versions.netty}"
api "io.netty:netty-resolver:${versions.netty}"
api "io.netty:netty-transport:${versions.netty}"

// reactor
api "io.projectreactor.netty:reactor-netty:${versions.reactorNetty}"
api "io.projectreactor:reactor-core:${versions.reactorCore}"
api "org.reactivestreams:reactive-streams:${versions.reactiveStreams}"

api "org.slf4j:slf4j-api:${versions.slf4j}"

testImplementation project(':test:fixtures:azure-fixture')
}

Expand All @@ -48,31 +99,210 @@ restResources {
tasks.named("dependencyLicenses").configure {
mapping from: /azure-.*/, to: 'azure'
mapping from: /jackson-.*/, to: 'jackson'
mapping from: /jersey-.*/, to: 'jersey'
mapping from: /netty-.*/, to: 'netty'
mapping from: /jaxb-.*/, to: 'jaxb'
mapping from: /stax-.*/, to: 'stax'
mapping from: /reactive-streams.*/, to: 'reactive-streams'
}

tasks.named("thirdPartyAudit").configure {
ignoreMissingClasses(
// Optional and not enabled by Elasticsearch
'org.slf4j.Logger',
'org.slf4j.LoggerFactory'
// from reactory-netty metric collection
'io.micrometer.core.instrument.Clock',
'io.micrometer.core.instrument.Counter',
'io.micrometer.core.instrument.Counter$Builder',
'io.micrometer.core.instrument.DistributionSummary',
'io.micrometer.core.instrument.DistributionSummary$Builder',
'io.micrometer.core.instrument.Meter',
'io.micrometer.core.instrument.MeterRegistry',
'io.micrometer.core.instrument.Metrics',
'io.micrometer.core.instrument.Tag',
'io.micrometer.core.instrument.Tags',
'io.micrometer.core.instrument.Timer',
'io.micrometer.core.instrument.Timer$Builder',
'io.micrometer.core.instrument.Timer$Sample',
'io.micrometer.core.instrument.binder.jvm.ExecutorServiceMetrics',
'io.micrometer.core.instrument.composite.CompositeMeterRegistry',
'io.micrometer.core.instrument.search.Search',
'io.micrometer.core.instrument.Gauge',
'io.micrometer.core.instrument.Gauge$Builder',

// from reactor-core kotlin extensions (to be deprecated from the library at some point on 3.3.x release)
'kotlin.TypeCastException',
'kotlin.collections.ArraysKt',
'kotlin.jvm.JvmClassMappingKt',
'kotlin.jvm.functions.Function0',
'kotlin.jvm.functions.Function1',
'kotlin.jvm.internal.FunctionReference',
'kotlin.jvm.internal.Intrinsics',
'kotlin.jvm.internal.Reflection',
'kotlin.jvm.internal.markers.KMappedMarker',
'kotlin.reflect.KClass',
'kotlin.reflect.KDeclarationContainer',
'kotlin.sequences.Sequence',

// from com.azure.storage.blob.changefeed
'com.azure.storage.internal.avro.implementation.AvroObject',
'com.azure.storage.internal.avro.implementation.AvroReader',
'com.azure.storage.internal.avro.implementation.AvroReaderFactory',
'com.azure.storage.internal.avro.implementation.schema.AvroSchema',

// from io.netty.handler.codec.protobuf.ProtobufDecoder (netty)
'com.google.protobuf.ExtensionRegistry',
'com.google.protobuf.MessageLite$Builder',
'com.google.protobuf.MessageLite',
'com.google.protobuf.Parser',
'com.google.protobuf.ExtensionRegistryLite',
'com.google.protobuf.MessageLiteOrBuilder',
'com.google.protobuf.nano.CodedOutputByteBufferNano',
'com.google.protobuf.nano.MessageNano',

// from io.netty.logging.CommonsLoggerFactory (netty)
'org.apache.commons.logging.Log',
'org.apache.commons.logging.LogFactory',

// from Log4j (deliberate, Netty will fallback to Log4j 2)
'org.apache.log4j.Level',
'org.apache.log4j.Logger',

// from io.netty.handler.ssl.util.BouncyCastleSelfSignedCertGenerator (netty)
'org.bouncycastle.cert.X509v3CertificateBuilder',
'org.bouncycastle.cert.jcajce.JcaX509CertificateConverter',
'org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder',
'org.bouncycastle.jce.provider.BouncyCastleProvider',
'org.bouncycastle.operator.jcajce.JcaContentSignerBuilder',
'org.bouncycastle.asn1.x500.X500Name',

// from io.netty.handler.ssl.JettyNpnSslEngine (netty)
'org.eclipse.jetty.npn.NextProtoNego$ClientProvider',
'org.eclipse.jetty.npn.NextProtoNego$ServerProvider',
'org.eclipse.jetty.npn.NextProtoNego',

// from io.netty.handler.codec.marshalling.ChannelBufferByteInput (netty)
'org.jboss.marshalling.ByteInput',

// from io.netty.handler.codec.marshalling.ChannelBufferByteOutput (netty)
'org.jboss.marshalling.ByteOutput',

// from io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder (netty)
'org.jboss.marshalling.Marshaller',

// from io.netty.handler.codec.marshalling.ContextBoundUnmarshallerProvider (netty)
'org.jboss.marshalling.MarshallerFactory',
'org.jboss.marshalling.MarshallingConfiguration',
'org.jboss.marshalling.Unmarshaller',

// from io.netty.handler.codec.spdy.SpdyHeaderBlockJZlibEncoder (netty-codec-http)
'com.jcraft.jzlib.Deflater',
'com.jcraft.jzlib.Inflater',
'com.jcraft.jzlib.JZlib$WrapperType',
'com.jcraft.jzlib.JZlib',

// from io.netty.handler.codec.compression.LzfDecoder
// from io.netty.handler.codec.compression.LzfEncoder (netty-codec)
'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',

// from io.netty.handler.codec.compression.LzmaFrameEncoder (netty-codec)
'lzma.sdk.lzma.Encoder',

// from io.netty.handler.codec.compression.Lz4FrameDecoder (netty-codec)
'net.jpountz.lz4.LZ4Compressor',
'net.jpountz.lz4.LZ4Factory',
'net.jpountz.lz4.LZ4FastDecompressor',

// from io.netty.handler.codec.compression.Lz4XXHash32 (netty-codec)
'net.jpountz.xxhash.XXHash32',
'net.jpountz.xxhash.XXHashFactory',

// from io.netty.handler.ssl.JettyAlpnSslEngin (netty-handler optional dependency)
'org.eclipse.jetty.alpn.ALPN$ClientProvider',
'org.eclipse.jetty.alpn.ALPN$ServerProvider',
'org.eclipse.jetty.alpn.ALPN',

// from io.netty.handler.ssl.ConscryptAlpnSslEngine (netty-handler optional dependency)
'org.conscrypt.AllocatedBuffer',
'org.conscrypt.BufferAllocator',
'org.conscrypt.Conscrypt',
'org.conscrypt.HandshakeListener',

// from io.netty.handler.ssl.OpenSslEngine (netty)
'io.netty.internal.tcnative.Buffer',
'io.netty.internal.tcnative.Library',
'io.netty.internal.tcnative.SSL',
'io.netty.internal.tcnative.SSLContext',
'io.netty.internal.tcnative.SSLPrivateKeyMethod',
'io.netty.internal.tcnative.CertificateCallback',
'io.netty.internal.tcnative.CertificateVerifier',
'io.netty.internal.tcnative.SessionTicketKey',
'io.netty.internal.tcnative.SniHostNameMatcher',

// from io.netty.util.internal.Hidden (netty-common optional dependency)
'reactor.blockhound.BlockHound$Builder',
'reactor.blockhound.integration.BlockHoundIntegration',

// it uses NIO
'io.netty.channel.kqueue.KQueue',
'io.netty.channel.kqueue.KQueueDatagramChannel',
'io.netty.channel.kqueue.KQueueEventLoopGroup',
'io.netty.channel.kqueue.KQueueServerSocketChannel',
'io.netty.channel.kqueue.KQueueSocketChannel',
'io.netty.channel.epoll.Epoll',
'io.netty.channel.epoll.EpollDatagramChannel',
'io.netty.channel.epoll.EpollEventLoopGroup',
'io.netty.channel.epoll.EpollServerSocketChannel',
'io.netty.channel.epoll.EpollSocketChannel',

// from reactor.netty.http.server.HttpServer (reactor-netty)
'io.netty.handler.codec.haproxy.HAProxyMessage',
'io.netty.handler.codec.haproxy.HAProxyMessageDecoder',

// from com.ctc.wstx.osgi.WstxBundleActivator (woodstox-core)
'org.osgi.framework.BundleActivator',
'org.osgi.framework.BundleContext',

// from com.ctc.wstx.shaded.msv_core.driver.textui.Driver (woodstox-core)
'com.sun.org.apache.xml.internal.resolver.Catalog',
'com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver',

'org.slf4j.impl.StaticLoggerBinder',
'org.slf4j.impl.StaticMDCBinder',
'org.slf4j.impl.StaticMarkerBinder',
)

ignoreViolations(
// uses internal java api: sun.misc.Unsafe
'com.google.common.cache.Striped64',
'com.google.common.cache.Striped64$1',
'com.google.common.cache.Striped64$Cell',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$1',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$2',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$3',
'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.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$5',
'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.util.UnsafeAccess',
'io.netty.util.internal.shaded.org.jctools.util.UnsafeRefArrayAccess',

'javax.activation.MailcapCommandMap',
'javax.activation.MimetypesFileTypeMap',

'reactor.core.publisher.MultiProducerRingBuffer',
'reactor.core.publisher.RingBufferFields',
'reactor.core.publisher.Traces$SharedSecretsCallSiteSupplierFactory$TracingException',
'reactor.core.publisher.UnsafeSequence',
'reactor.core.publisher.UnsafeSupport'
)
}

Expand All @@ -82,7 +312,7 @@ def azureAddress = {
assert useFixture: 'closure should not be used without a fixture'
int ephemeralPort = project(':test:fixtures:azure-fixture').postProcessFixture.ext."test.fixtures.azure-fixture.tcp.8091"
assert ephemeralPort > 0
return 'ignored;DefaultEndpointsProtocol=http;BlobEndpoint=http://127.0.0.1:' + ephemeralPort + '/'
return 'ignored;DefaultEndpointsProtocol=http;BlobEndpoint=http://127.0.0.1:' + ephemeralPort + '/azure_integration_test_account'
}

String azureAccount = System.getenv("azure_storage_account")
Expand Down
Loading