Skip to content

[Backport 1.x] Update DistributionDownloader to support fetching arm64 bundles. (#929) #934

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

Merged
merged 1 commit into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -234,7 +234,16 @@ private String dependencyNotation(OpenSearchDistribution distribution) {
extension = distribution.getPlatform() == Platform.WINDOWS ? "zip" : "tar.gz";

if (distroVersion.onOrAfter("1.0.0")) {
classifier = ":" + distribution.getPlatform() + "-x64";
switch (distribution.getArchitecture()) {
case ARM64:
classifier = ":" + distribution.getPlatform() + "-arm64";
break;
case X64:
classifier = ":" + distribution.getPlatform() + "-x64";
break;
default:
throw new IllegalArgumentException("Unsupported architecture: " + distribution.getArchitecture());
}
} else if (distroVersion.onOrAfter("7.0.0")) {
classifier = ":" + distribution.getPlatform() + "-x86_64";
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,25 @@ public void testLocalCurrentVersionIntegTestZip() {
public void testLocalCurrentVersionArchives() {
for (Platform platform : Platform.values()) {
for (boolean bundledJdk : new boolean[] { true, false }) {
// create a new project in each iteration, so that we know we are resolving the only additional project being created
Project project = createProject(BWC_MINOR, true);
String projectName = projectName(platform.toString(), bundledJdk);
projectName += (platform == Platform.WINDOWS ? "-zip" : "-tar");
Project archiveProject = ProjectBuilder.builder().withParent(archivesProject).withName(projectName).build();
archiveProject.getConfigurations().create("default");
archiveProject.getArtifacts().add("default", new File("doesnotmatter"));
createDistro(project, "distro", VersionProperties.getOpenSearch(), Type.ARCHIVE, platform, bundledJdk);
checkPlugin(project);
for (Architecture architecture : Architecture.values()) {
// create a new project in each iteration, so that we know we are resolving the only additional project being created
Project project = createProject(BWC_MINOR, true);
String projectName = projectName(platform.toString(), bundledJdk);
projectName += (platform == Platform.WINDOWS ? "-zip" : "-tar");
Project archiveProject = ProjectBuilder.builder().withParent(archivesProject).withName(projectName).build();
archiveProject.getConfigurations().create("default");
archiveProject.getArtifacts().add("default", new File("doesnotmatter"));
final OpenSearchDistribution distro = createDistro(
project,
"distro",
VersionProperties.getOpenSearch(),
Type.ARCHIVE,
platform,
bundledJdk
);
distro.setArchitecture(architecture);
checkPlugin(project);
}
}
}
}
Expand Down