Skip to content

Conversation

@joeyAghion
Copy link
Contributor

It appears that Elasticsearch is no longer maintaining homebrew formulas for their service at all. They recommend their container images instead.

Most acutely, this means the previously available formula for Elasticsearch 7 fails with undefined method plist_options errors (elastic/homebrew-tap#146). @dskecse has modernized the formula, but that also fails on java-related errors. The new formula here is based on that, with just the addition of an ES_JAVA_HOME environment variable.

This works, but Elasticsearch crashes when exercised by Gravity's tests with the error:

ElasticsearchException[Failure running machine learning native code. This could be due to running on an unsupported OS or distribution, missing OS libraries, or a problem with the temp directory. To bypass this problem by running Elasticsearch without machine learning functionality set [xpack.ml.enabled: false].]

Apparently (elastic/elasticsearch#48490), the way homebrew moves files during installation invalidates the file signatures of ML executables. I'm currently working around this by manually disabling ML features in /opt/homebrew/etc/elasticsearch.yml:

xpack.ml.enabled: false

This^ configuration change should be handled by the formula, so this isn't mergeable yet.

@joeyAghion joeyAghion requested a review from anandaroop February 5, 2024 22:20
service do
run opt_bin/"elasticsearch"
working_dir var
environment_variables ES_JAVA_HOME: `/usr/libexec/java_home -v 17`.strip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So Elasticsearch already knows what to do with ES_JAVA_HOME (as opposed to the previous JAVA_HOME?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Yes, I take it)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JAVA_HOME also works, but generated deprecation warnings recommending ES_JAVA_HOME instead. Neither worked using the old, indirect '/usr/libexec/java_home -v 17' form. Instead I had to actually run the command during installation.

@joeyAghion
Copy link
Contributor Author

Updated to automatically insert the xpack.ml.enabled: false configuration. This might be mergeable if we don't actually require those ML features. I'll move on to the docker env and real v6 vs. v7 errors next.

@anandaroop
Copy link
Member

might be mergeable if we don't actually require those ML features

It looks like a the ML features relate mostly to the analytics-focused use of ES — but also to the NLP tasks we might like to experiment with.

However we are nowhere close to actually doing that, so I don't think that needs to block this interim step.

@joeyAghion
Copy link
Contributor Author

For now, this formula can be tested by uninstalling elasticsearch 6, pulling down this repo and branch, and installing from source:

brew install --build-from-source ./Formula/[email protected]

@joeyAghion joeyAghion self-assigned this Mar 11, 2024
@joeyAghion joeyAghion merged commit 5aa107a into main Mar 11, 2024
@joeyAghion joeyAghion deleted the joeyAghion/es7 branch March 11, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants