TritonDataCenter / pkgsrc

NetBSD/pkgsrc fork for our binary package repositories
https://pkgsrc.smartos.org/
132 stars 51 forks source link

Elasticsearch 7.12 #300

Closed smokris closed 2 years ago

smokris commented 3 years ago

Hi @jperkin. The current Elasticsearch version is 7.12.0, but the SmartOS base64 package is version 6.8.8. Would it be practical to update that package?

jperkin commented 3 years ago

Yeh I need to take a look at this at some point.

smokris commented 3 years ago

I've been tinkering with it over the past few days, and I was able to get it to build with this patch: elasticsearch-7.12.0-sunos.txt

$ pkgin in openjdk15-15.0.0rc24
$ curl -OL https://github.com/elastic/elasticsearch/archive/refs/tags/v7.12.0.tar.gz
$ tar zxf v7.12.0.tar.gz
$ cd elasticsearch-7.12.0
$ patch -p1 < ../elasticsearch-7.12.0-sunos.txt
$ JAVA_HOME=/opt/local/java/openjdk15 RUNTIME_JAVA_HOME=/opt/local ./gradlew localDistro
$ ln -s /opt/local build/distribution/local/elasticsearch-7.12.0-SNAPSHOT/jdk

$ build/distribution/local/elasticsearch-7.12.0-SNAPSHOT/bin/elasticsearch --version
warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release
Version: 7.12.0-SNAPSHOT, Build: default/tar/unknown/2021-04-15T23:00:38.667690Z, JVM: 15-internal

(I haven't figured out the pkgsrc package build system though.)

When I launch it in server mode, it complains about not finding JNA (libjnidispatch.so)… but the server finishes launching, and I can create an index and add documents to it, so it seems to basically work at least.

Edit: The JNA issue can be fixed by following the steps here: https://github.com/joyent/pkgsrc/issues/93#issue-310525391

smokris commented 3 years ago

Correction: in order to talk to other Elasticsearch nodes, it needs to be built from inside the Git source tree. Updated steps:

$ pkgin in git openjdk15-15.0.0rc24
$ curl -OL https://github.com/joyent/pkgsrc/files/6328379/elasticsearch-7.12.0-sunos.txt
$ git clone https://github.com/elastic/elasticsearch
$ cd elasticsearch
$ git checkout 78722783c38caa25a70982b5b042074cde5d3b3a  # tagged v7.12.0
$ patch -p1 < ../elasticsearch-7.12.0-sunos.txt
$ JAVA_HOME=/opt/local/java/openjdk15 RUNTIME_JAVA_HOME=/opt/local ./gradlew localDistro
$ ln -s /opt/local build/distribution/local/elasticsearch-7.12.0-SNAPSHOT/jdk

$ build/distribution/local/elasticsearch-7.12.0-SNAPSHOT/bin/elasticsearch --version
warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release
Version: 7.12.0-SNAPSHOT, Build: default/tar/78722783c38caa25a70982b5b042074cde5d3b3a/2021-04-18T01:50:41.726304Z, JVM: 15-internal

(Now the version string includes the Git commit hash instead of "unknown", enabling this Elasticsearch build to confirm compatibility with other 7.12.0 nodes.)

smokris commented 2 years ago

Withdrawing this request; see https://github.com/joyent/pkgsrc/pull/308#issuecomment-986041113.