From d85f861c44fa60643501cfe308e97cb63744161a Mon Sep 17 00:00:00 2001 From: Jackie Han <41348518+jackiehanyang@users.noreply.github.com> Date: Tue, 5 Apr 2022 09:24:09 -0700 Subject: [PATCH] Remove checked-in ml-commons dependency (#529) Signed-off-by: jackieyanghan --- doctest/build.gradle | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/doctest/build.gradle b/doctest/build.gradle index f310806147..3ee1b714f4 100644 --- a/doctest/build.gradle +++ b/doctest/build.gradle @@ -48,6 +48,9 @@ doctest.finalizedBy stopOpenSearch build.dependsOn doctest clean.dependsOn(cleanBootstrap) +String mlCommonsRemoteFile = 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/1.3.1/latest/linux/x64/builds/opensearch/plugins/opensearch-ml-1.3.1.0.zip' +String mlCommonsPlugin = "ml-commons" + testClusters { docTestCluster { plugin(provider(new Callable(){ @@ -56,7 +59,15 @@ testClusters { return new RegularFile() { @Override File getAsFile() { - return fileTree("resources/ml-commons").getSingleFile() + File dir = new File('./doctest/' + mlCommonsPlugin) + if (!dir.exists()) { + dir.mkdirs() + } + File f = new File(mlCommonsPlugin, dir) + if (!f.exists()) { + new URL(mlCommonsRemoteFile).withInputStream{ ins -> f.withOutputStream{ it << ins }} + } + return fileTree(mlCommonsPlugin).getSingleFile() } } }