Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into snapshot-lifecycle-…
Browse files Browse the repository at this point in the history
…management
  • Loading branch information
dakrone committed Mar 15, 2019
2 parents 25ebdf3 + c079729 commit 6d0aad5
Show file tree
Hide file tree
Showing 119 changed files with 2,007 additions and 435 deletions.
8 changes: 4 additions & 4 deletions TESTING.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,8 @@ sudo bash $PACKAGING_TESTS/run-tests.sh
# run specific test cases
sudo bash $PACKAGING_TESTS/run-tests.sh \
org.elasticsearch.packaging.test.DefaultZipTests \
org.elasticsearch.packaging.test.OssZipTests
org.elasticsearch.packaging.test.DefaultWindowsZipTests \
org.elasticsearch.packaging.test.OssWindowsZipTests
--------------------------------------------

or on Windows, from a terminal running as Administrator
Expand All @@ -510,8 +510,8 @@ powershell -File $Env:PACKAGING_TESTS/run-tests.ps1
# run specific test cases
powershell -File $Env:PACKAGING_TESTS/run-tests.ps1 `
org.elasticsearch.packaging.test.DefaultZipTests `
org.elasticsearch.packaging.test.OssZipTests
org.elasticsearch.packaging.test.DefaultWindowsZipTests `
org.elasticsearch.packaging.test.OssWindowsZipTests
--------------------------------------------

Note that on Windows boxes when running from inside the GUI, you may have to log out and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,15 @@ class VagrantTestPlugin implements Plugin<Project> {
'packages:rpm',
'packages:oss-rpm',
'packages:deb',
'packages:oss-deb'
'packages:oss-deb',
'archives:no-jdk-linux-tar',
'archives:oss-no-jdk-linux-tar',
'archives:no-jdk-windows-zip',
'archives:oss-no-jdk-windows-zip',
'packages:no-jdk-rpm',
'packages:oss-no-jdk-rpm',
'packages:no-jdk-deb',
'packages:oss-no-jdk-deb'
])

/** Packages onboarded for upgrade tests **/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,6 @@ public void onFailure(Exception e) {
}

public void testGetSslCertificates() throws Exception {
assumeFalse("Awaits fix: https://github.com/elastic/elasticsearch/issues/40041", inFipsJvm());
RestHighLevelClient client = highLevelClient();
{
//tag::get-certificates-execute
Expand All @@ -980,39 +979,39 @@ public void testGetSslCertificates() throws Exception {
assertThat(certificates.size(), Matchers.equalTo(9));
final Iterator<CertificateInfo> it = certificates.iterator();
CertificateInfo c = it.next();
assertThat(c.getSubjectDn(), Matchers.equalTo("CN=testnode-client-profile"));
assertThat(c.getSerialNumber(), Matchers.equalTo("c0ea4216e8ff0fd8"));
assertThat(c.getPath(), Matchers.equalTo("testnode.jks"));
assertThat(c.getFormat(), Matchers.equalTo("jks"));
c = it.next();
assertThat(c.getSubjectDn(), Matchers.equalTo("CN=Elasticsearch Test Node, OU=elasticsearch, O=org"));
assertThat(c.getSerialNumber(), Matchers.equalTo("b8b96c37e332cccb"));
assertThat(c.getPath(), Matchers.equalTo("testnode.crt"));
assertThat(c.getFormat(), Matchers.equalTo("PEM"));
c = it.next();
assertThat(c.getSubjectDn(), Matchers.equalTo("CN=OpenLDAP, OU=Elasticsearch, O=Elastic, L=Mountain View, ST=CA, C=US"));
assertThat(c.getSerialNumber(), Matchers.equalTo("d3850b2b1995ad5f"));
assertThat(c.getPath(), Matchers.equalTo("testnode.jks"));
assertThat(c.getFormat(), Matchers.equalTo("jks"));
c = it.next();
assertThat(c.getSubjectDn(), Matchers.equalTo("CN=Elasticsearch Test Node, OU=elasticsearch, O=org"));
assertThat(c.getSerialNumber(), Matchers.equalTo("b8b96c37e332cccb"));
assertThat(c.getPath(), Matchers.equalTo("testnode.jks"));
assertThat(c.getFormat(), Matchers.equalTo("jks"));
c = it.next();
assertThat(c.getSubjectDn(), Matchers.equalTo("CN=Elasticsearch Test Client, OU=elasticsearch, O=org"));
assertThat(c.getSerialNumber(), Matchers.equalTo("b9d497f2924bbe29"));
assertThat(c.getPath(), Matchers.equalTo("testnode.jks"));
assertThat(c.getFormat(), Matchers.equalTo("jks"));
c = it.next();
assertThat(c.getSubjectDn(), Matchers.equalTo("CN=ad-ELASTICSEARCHAD-CA, DC=ad, DC=test, DC=elasticsearch, DC=com"));
assertThat(c.getSerialNumber(), Matchers.equalTo("580db8ad52bb168a4080e1df122a3f56"));
assertThat(c.getPath(), Matchers.equalTo("testnode.jks"));
assertThat(c.getFormat(), Matchers.equalTo("jks"));
c = it.next();
assertThat(c.getSubjectDn(), Matchers.equalTo("CN=Elasticsearch Test Node"));
assertThat(c.getSerialNumber(), Matchers.equalTo("7268203b"));
assertThat(c.getPath(), Matchers.equalTo("testnode.jks"));
assertThat(c.getFormat(), Matchers.equalTo("jks"));
c = it.next();
assertThat(c.getSubjectDn(), Matchers.equalTo("CN=samba4"));
assertThat(c.getSerialNumber(), Matchers.equalTo("3151a81eec8d4e34c56a8466a8510bcfbe63cc31"));
assertThat(c.getPath(), Matchers.equalTo("testnode.jks"));
assertThat(c.getFormat(), Matchers.equalTo("jks"));
c = it.next();
assertThat(c.getSubjectDn(), Matchers.equalTo("CN=Elasticsearch Test Node"));
assertThat(c.getSerialNumber(), Matchers.equalTo("223c736a"));
assertThat(c.getPath(), Matchers.equalTo("testnode.jks"));
assertThat(c.getFormat(), Matchers.equalTo("jks"));
}
Expand Down
54 changes: 45 additions & 9 deletions distribution/archives/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ task createPluginsDir(type: EmptyDirTask) {
dirMode 0755
}

CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String platform, boolean oss) {
CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String platform, boolean oss, boolean jdk) {
return copySpec {
into("elasticsearch-${version}") {
into('lib') {
Expand All @@ -59,7 +59,7 @@ CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String pla
into('bin') {
with binFiles(distributionType, oss)
}
if (platform != null) {
if (jdk) {
into('jdk') {
with jdkFiles(platform)
}
Expand Down Expand Up @@ -107,19 +107,31 @@ Closure commonZipConfig = {

task buildIntegTestZip(type: Zip) {
configure(commonZipConfig)
with archiveFiles(transportModulesFiles, 'zip', null, true)
with archiveFiles(transportModulesFiles, 'zip', null, true, false)
}

task buildWindowsZip(type: Zip) {
configure(commonZipConfig)
archiveClassifier = 'windows-x86_64'
with archiveFiles(modulesFiles(false), 'zip', 'windows', false)
with archiveFiles(modulesFiles(false), 'zip', 'windows', false, true)
}

task buildOssWindowsZip(type: Zip) {
configure(commonZipConfig)
archiveClassifier = 'windows-x86_64'
with archiveFiles(modulesFiles(true), 'zip', 'windows', true)
with archiveFiles(modulesFiles(true), 'zip', 'windows', true, true)
}

task buildNoJdkWindowsZip(type: Zip) {
configure(commonZipConfig)
archiveClassifier = 'no-jdk-windows-x86_64'
with archiveFiles(modulesFiles(false), 'zip', 'windows', false, false)
}

task buildOssNoJdkWindowsZip(type: Zip) {
configure(commonZipConfig)
archiveClassifier = 'no-jdk-windows-x86_64'
with archiveFiles(modulesFiles(true), 'zip', 'windows', true, false)
}

Closure commonTarConfig = {
Expand All @@ -132,25 +144,49 @@ Closure commonTarConfig = {
task buildDarwinTar(type: Tar) {
configure(commonTarConfig)
archiveClassifier = 'darwin-x86_64'
with archiveFiles(modulesFiles(false), 'tar', 'darwin', false)
with archiveFiles(modulesFiles(false), 'tar', 'darwin', false, true)
}

task buildOssDarwinTar(type: Tar) {
configure(commonTarConfig)
archiveClassifier = 'darwin-x86_64'
with archiveFiles(modulesFiles(true), 'tar', 'darwin', true)
with archiveFiles(modulesFiles(true), 'tar', 'darwin', true, true)
}

task buildNoJdkDarwinTar(type: Tar) {
configure(commonTarConfig)
archiveClassifier = 'no-jdk-darwin-x86_64'
with archiveFiles(modulesFiles(false), 'tar', 'darwin', false, false)
}

task buildOssNoJdkDarwinTar(type: Tar) {
configure(commonTarConfig)
archiveClassifier = 'no-jdk-darwin-x86_64'
with archiveFiles(modulesFiles(true), 'tar', 'darwin', true, false)
}

task buildLinuxTar(type: Tar) {
configure(commonTarConfig)
archiveClassifier = 'linux-x86_64'
with archiveFiles(modulesFiles(false), 'tar', 'linux', false)
with archiveFiles(modulesFiles(false), 'tar', 'linux', false, true)
}

task buildOssLinuxTar(type: Tar) {
configure(commonTarConfig)
archiveClassifier = 'linux-x86_64'
with archiveFiles(modulesFiles(true), 'tar', 'linux', true)
with archiveFiles(modulesFiles(true), 'tar', 'linux', true, true)
}

task buildNoJdkLinuxTar(type: Tar) {
configure(commonTarConfig)
archiveClassifier = 'no-jdk-linux-x86_64'
with archiveFiles(modulesFiles(false), 'tar', 'linux', false, false)
}

task buildOssNoJdkLinuxTar(type: Tar) {
configure(commonTarConfig)
archiveClassifier = 'no-jdk-linux-x86_64'
with archiveFiles(modulesFiles(true), 'tar', 'linux', true, false)
}

Closure tarExists = { it -> new File('/bin/tar').exists() || new File('/usr/bin/tar').exists() || new File('/usr/local/bin/tar').exists() }
Expand Down
2 changes: 2 additions & 0 deletions distribution/archives/no-jdk-darwin-tar/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.
2 changes: 2 additions & 0 deletions distribution/archives/no-jdk-linux-tar/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.
2 changes: 2 additions & 0 deletions distribution/archives/no-jdk-windows-zip/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.
2 changes: 2 additions & 0 deletions distribution/archives/oss-no-jdk-darwin-tar/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.
2 changes: 2 additions & 0 deletions distribution/archives/oss-no-jdk-linux-tar/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.
2 changes: 2 additions & 0 deletions distribution/archives/oss-no-jdk-windows-zip/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.
50 changes: 35 additions & 15 deletions distribution/packages/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ buildscript {
void addProcessFilesTask(String type, boolean oss) {
String packagingFiles = "build/packaging/${ oss ? 'oss-' : ''}${type}"

task("process${oss ? 'Oss' : ''}${type.capitalize()}Files", type: Copy) {
String taskName = "process${oss ? 'Oss' : ''}${type.capitalize()}Files"
task(taskName, type: Copy) {
into packagingFiles

with copySpec {
Expand Down Expand Up @@ -98,17 +99,18 @@ addProcessFilesTask('rpm', false)
// Common configuration that is package dependent. This can't go in ospackage
// since we have different templated files that need to be consumed, but the structure
// is the same
Closure commonPackageConfig(String type, boolean oss) {
Closure commonPackageConfig(String type, boolean oss, boolean jdk) {
return {
dependsOn "process${oss ? 'Oss' : ''}${type.capitalize()}Files"
packageName "elasticsearch${oss ? '-oss' : ''}"
arch (type == 'deb' ? 'amd64' : 'X86_64')
// Follow elasticsearch's file naming convention
archiveName "${packageName}-${project.version}-${archString}.${type}"
String jdkString = jdk ? "" : "no-jdk-"
archiveName "${packageName}-${project.version}-${jdkString}${archString}.${type}"

String prefix = "${oss ? 'oss-' : ''}${type}"
String prefix = "${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}"
destinationDir = file("${prefix}/build/distributions")
String packagingFiles = "build/packaging/${prefix}"
String packagingFiles = "build/packaging/${oss ? 'oss-' : ''}${type}"

String scripts = "${packagingFiles}/scripts"
preInstall file("${scripts}/preinst")
Expand All @@ -135,8 +137,10 @@ Closure commonPackageConfig(String type, boolean oss) {
into('modules') {
with modulesFiles(oss)
}
into('jdk') {
with jdkFiles('linux')
if (jdk) {
into('jdk') {
with jdkFiles('linux')
}
}
// we need to specify every intermediate directory in these paths so the package managers know they are explicitly
// intended to manage them; otherwise they may be left behind on uninstallation. duplicate calls of the same
Expand Down Expand Up @@ -289,9 +293,9 @@ ospackage {
with noticeFile
}

Closure commonDebConfig(boolean oss) {
Closure commonDebConfig(boolean oss, boolean jdk) {
return {
configure(commonPackageConfig('deb', oss))
configure(commonPackageConfig('deb', oss, jdk))

// jdeb does not provide a way to set the License control attribute, and ospackage
// silently ignores setting it. Instead, we set the license as "custom field"
Expand All @@ -314,16 +318,24 @@ Closure commonDebConfig(boolean oss) {
}

task buildDeb(type: Deb) {
configure(commonDebConfig(false))
configure(commonDebConfig(false, true))
}

task buildOssDeb(type: Deb) {
configure(commonDebConfig(true))
configure(commonDebConfig(true, true))
}

task buildNoJdkDeb(type: Deb) {
configure(commonDebConfig(false, false))
}

task buildOssNoJdkDeb(type: Deb) {
configure(commonDebConfig(true, false))
}

Closure commonRpmConfig(boolean oss) {
Closure commonRpmConfig(boolean oss, boolean jdk) {
return {
configure(commonPackageConfig('rpm', oss))
configure(commonPackageConfig('rpm', oss, jdk))

if (oss) {
license 'ASL 2.0'
Expand Down Expand Up @@ -351,11 +363,19 @@ Closure commonRpmConfig(boolean oss) {
}

task buildRpm(type: Rpm) {
configure(commonRpmConfig(false))
configure(commonRpmConfig(false, true))
}

task buildOssRpm(type: Rpm) {
configure(commonRpmConfig(true))
configure(commonRpmConfig(true, true))
}

task buildNoJdkRpm(type: Rpm) {
configure(commonRpmConfig(false, false))
}

task buildOssNoJdkRpm(type: Rpm) {
configure(commonRpmConfig(true, false))
}

Closure dpkgExists = { it -> new File('/bin/dpkg-deb').exists() || new File('/usr/bin/dpkg-deb').exists() || new File('/usr/local/bin/dpkg-deb').exists() }
Expand Down
2 changes: 2 additions & 0 deletions distribution/packages/no-jdk-deb/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.
2 changes: 2 additions & 0 deletions distribution/packages/no-jdk-rpm/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions distribution/packages/oss-no-jdk-deb/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.
2 changes: 2 additions & 0 deletions distribution/packages/oss-no-jdk-rpm/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.
2 changes: 1 addition & 1 deletion docs/plugins/repository-azure.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ The Azure repository supports following settings:

When set to `true` metadata files are stored in compressed format. This
setting doesn't affect index files that are already compressed by default.
Defaults to `false`.
Defaults to `true`.

`readonly`::

Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/repository-gcs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ The following settings are supported:

When set to `true` metadata files are stored in compressed format. This
setting doesn't affect index files that are already compressed by default.
Defaults to `false`.
Defaults to `true`.

`application_name`::

Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/repository-hdfs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ The following settings are supported:

`compress`::

Whether to compress the metadata or not. (Disabled by default)
Whether to compress the metadata or not. (Enabled by default)

`chunk_size`::

Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/repository-s3.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ The following settings are supported:

When set to `true` metadata files are stored in compressed format. This
setting doesn't affect index files that are already compressed by default.
Defaults to `false`.
Defaults to `true`.

`server_side_encryption`::

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/cluster/remote-info.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ the configured remote cluster alias.

`skip_unavailable`::
Whether the remote cluster is skipped in case it is searched through
a cross cluster search request but none of its nodes are available.
a {ccs} request but none of its nodes are available.
5 changes: 5 additions & 0 deletions docs/reference/glossary.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
The {ccr} feature enables you to replicate indices in remote clusters to your
local cluster. For more information, see
{stack-ov}/xpack-ccr.html[{ccr-cap}].

[[glossary-ccs]] {ccs} (CCS)::

The {ccs} feature enables any node to act as a federated client across
multiple clusters. See <<modules-cross-cluster-search>>.

[[glossary-document]] document ::

Expand Down
Loading

0 comments on commit 6d0aad5

Please sign in to comment.