Skip to content
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

ARM64 support? #22

Open
dshumakerUT opened this issue Jun 30, 2022 · 7 comments
Open

ARM64 support? #22

dshumakerUT opened this issue Jun 30, 2022 · 7 comments

Comments

@dshumakerUT
Copy link

Has anyone tried to integrate ARM64 support for the solr service?

https://hub.docker.com/r/amd64/solr/

@danshumaker
Copy link

danshumaker commented Jul 12, 2022

#1421

@danshumaker
Copy link

Was able to get arm64v8 working with native (non-docksal) images, albeit I had to modify the search_api_solr module to do so:

mkalkbrenner/search_api_solr#80

@loopy3025
Copy link

loopy3025 commented Feb 3, 2023

Well, the good news is that SOLR_IMAGE='solr:8.11.2' does fire up a server on our M1 machine without complaints.

The bad news is that the docksal "user-owned" index does not get created during fin start.

Are we going to have to create scripts that generate these on our own and add them to, like, a fin init command? Are there examples of this? I am quite out of my depth in this regard, I must admit.

We're also deeply concerned about the differences between SOLR 8 locally and SOLR 7 upstream. We don't have the option for solr 8 upstream currently.

I did try going into solr at solr.mysite.docksal.site and create the user-owned core myself. I get:

Error CREATEing SolrCore 'user-owned': Unable to create core [user-owned] Caused by: Can't find resource 'solrconfig.xml' in classpath or '/var/solr/data/user-owned'

which I guess means that the docksal-preinit script eithter never fires during fin start or the file copy fails for some reason.

@danshumaker
Copy link

I use this bash to create cores with

#!/bin/bash -xv
#
# THE PARAMETERS ARE HARD CODED HERE BUT YOU WILL NEED TO ADJUST THEM PER PROJECT
#
# -c is the name of the core to create. THIS HAS TO MATCH YOUR CORE NAME that is already set in the drupal admin UI.
#    We are assuming you setup solr search before converting it to docksal. If you are creating it anew then you can
#    call the core whatever you want.
#
# -d is the directory to search for the config set templates to use.  This CAN (but does not have to be) checked into the
#    git repository.  Sometimes it IS checked into the repository in order to help the developers get started.  DO NOT use
#    a config set directory from a version of solr that is different than the version for which it was generated.  This
#    important fact is why we put the solr version in the directory name
#
# -n is the name of the server that you may or may not have set in the drupal admin UI.  Whichever comes first (this script or
#    drupal admin setup) doesn't matter, but they do need to match because that machine name is used by the config export
#    process and is store on disk
#

docker exec -it $(docker ps --filter "name=solr" --format '{{ .ID }}') solr create_core -c solr-core-name -d solr-config-set-directory-name -n solr-drupal-server-name

@lmakarov
Copy link
Member

lmakarov commented Feb 6, 2023

Well, the good news is that SOLR_IMAGE='solr:8.11.2' does fire up a server on our M1 machine without complaints.

The bad news is that the docksal "user-owned" index does not get created during fin start.

@loopy3025 solr:8.11.2 is an official stock Solr image without extra logic applied on top (this repo), which made the whole integration with Drupal's Search API Solr module a breeze.

Unfortunately, there is no bandwidth right now between maintainers to work on the updated Docksal Solr images.
Going with stock images + documented or automated configuration steps will likely be the way forward.

Either in a form of Docksal Solr docs or the updated docksal/add-ons/solr addon-on (or both). PRs are always welcome.

I use this bash to create cores with

@danshumaker thanks for sharing this. Do you also have to patch the search_api_module as you mentioned earlier?

@danshumaker
Copy link

The patch had issues but is actually not necessary because the https://hub.docker.com/r/amd64/solr/ repo works.

If the bash script above is .docksal/commands/solr-create-core then these comments in my settings.local.php should work for solr 8.11+ . I have not tried solr 9.

/**
 * Solr Setup:
 *
 *  - Uncomment the lines below starting at config:
 *
 *  - Create a config set via drush if you do not have one already.
 *    `drush solr-gsc server_id file_name.zip X.X`
 *    - where server_id is the outtput of `drush sapi-sl` also set in settings.local.php
 *    - where file_name.zip is the name of the config set zip file you will use. Usually name it solrX-X.zip where X-X is the solr version number.
 *    - where X.X is the solr version number - Get this from the production server if possible.
 *      This command will generate a zip file in the **web** directory that you need to put into the solr container.
 *    - Copy this file to the .docksal/etc/solr/solrX-X directory.
 *    - Adjust the mount definition in the .docksal/docksal-local.yml file to match the new directory that you just created.
 *    - Run `fin project reset` so that the new volume is created that contains your new config set.
 *
 *  - Replace "project_server_name" (in the below text ) with whatever your search server instance is called.
 *     Your server instance name is printed by executing `fin drush sapi-l`
 *
 *  - Adjust the -c, -d, and -n settings in the .docksal/commands/solr-core-create script to match your project.
 *
 *  - Run `fin solr-core-create` to create the new solr core that is referenced below.
 *     This creates a solr core that is specific to docksal and this version of solr. It is created from a
 *     generic configuration set mounted via the .docksal/docksal-local.yml file.
 *
 *  - If using acquia_search module then also set the override_search_core like this:
 *     (the acquia_search module has a README about this too)
 *

 
$config['acquia_search.settings']['override_search_core'] = 'projectCoreName';
$config['search_api.server.searchServerName'] = [
  'backend_config' => [
    'connector' => 'standard',
    'connector_config' => [
      'host' => 'solr',
      'path' => '/',
      'port' => '8983',
      'core' => 'projectCoreName',
    ],
  ],
];
*/

then in .docksal/docksal.yml

  # FOR ARM64 Support put this in a docksal-local.yml file
  # Solr 8.11
  #solr:
  #  image: arm64v8/solr:8
  #  extends:
  #    file: ${HOME}/.docksal/stacks/services.yml
  #    service: solr
  #  volumes:
  #    - ${PROJECT_ROOT}/.docksal/etc/solr/solr811:/opt/solr/server/solr/configsets/solr811

@nsciacca-mg
Copy link

Thank you @danshumaker - using your recipes above I was able to get it working, although I have to re-create the core every time the project loads. Small inconvenience for being able to perfectly match the destination server :) I used the solr:8.11 image as I didn't need the arm one.

@lmakarov lmakarov mentioned this issue Mar 1, 2024
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

No branches or pull requests

5 participants