sebastian-ehrling / ddev-opensearch

Opensearch add-on for DDEV
Apache License 2.0
3 stars 3 forks source link

Install analysis-icu and analysis-phonetic #4

Open antoniocarboni opened 10 months ago

antoniocarboni commented 10 months ago

Hi How can I install plugins on this container? On elasticsearch I ran the installation commands via the "command" option but with this container it doesn't work. It returns an error but the ddev logs contain only the complete installation:


Failed to restart project: container(s) failed to become healthy before their configured timeout or in 120 seconds. This might be a problem with the healthcheck and not a functional problem. (container 'opensearch' exited, please use 'ddev logs -s opensearch' to find out why it failed) 

ddev logs -s opensearch

-> Installing analysis-icu
-> Downloading analysis-icu from opensearch
[=================================================] 100%?? 
-> Installed analysis-icu with folder name analysis-icu
-> Installing analysis-phonetic
-> Downloading analysis-phonetic from opensearch
[=================================================] 100%?? 
mfickers commented 4 months ago

This approach will install the plugins when building the image instead of during container startup:

  1. Overwrite the .ddev/docker-compose.opensearch.yaml Replace the image with a custom build:

    services:
    opensearch:
    build:
      context: <project_path>/.ddev/opensearch
      dockerfile: Dockerfile
  2. Add a custom Dockerfile under this path: .ddev/opensearch/Dockerfile

    
    FROM opensearchproject/opensearch:2.12.0

RUN /usr/share/opensearch/bin/opensearch-plugin install analysis-icu && \ /usr/share/opensearch/bin/opensearch-plugin install analysis-phonetic \

rfay commented 4 months ago

It might be good to post comments on the officially supported ddev-opensearch. This is a fork I guess, not sure why issues are running here.

mfickers commented 4 months ago

@rfay Searching the DDEV docs for "opensearch" will return no result and this repo/fork is the first result when Google searching for "ddev opensearch".

Is it possible to update the example shown here? https://ddev.readthedocs.io/en/latest/users/extend/additional-services/ That should help people find the correct repo.

I can create a PR if that helps.

rfay commented 4 months ago

Please do a PR, thanks!

ddev get --list will show the available officially supported add-ons.