Skip to content

Commit

Permalink
#15: Install Drupal configset for Solr8 via custom Solr8 image. (#165)
Browse files Browse the repository at this point in the history
* #15: Install Drupal configset for Solr8 via custom Solr8 image.

* #15: Update solrTag logic for solr8.

* #15: Update CHANGELOG and feed the linter.

* #15: Update solr8 tests to reflect 8.8.2 Pantheon version.

* release v0.10.0
  • Loading branch information
reynoldsalec authored Mar 20, 2023
1 parent b5f2579 commit da6b552
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-pantheon-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
- image: pantheon-index
tag: 3.6-3
context: recipes/pantheon/3.6-solr
- image: pantheon-index
tag: 8.8-4
context: recipes/pantheon/8.8-solr
- image: pantheon-appserver
tag: 8.2-4
context: recipes/pantheon/8.2-fpm
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## v0.10.0 - [TBD](https://github.com/lando/pantheon/releases/tag/v0.10.0)
## v0.10.0 - [March 20, 2023](https://github.com/lando/pantheon/releases/tag/v0.10.0)

* Added support for `php` `8.2` [#159](https://github.com/lando/pantheon/issues/159)
* Added correct configset for `solr8` [#15](https://github.com/lando/pantheon/issues/15)

## v0.9.0 - [March 1, 2023](https://github.com/lando/pantheon/releases/tag/v0.9.0)

Expand Down
4 changes: 2 additions & 2 deletions examples/drupal9/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ lando ssh -s database -c "mysql -V" | grep 10.6.

# Should use the solr version in pantheon.yml
cd drupal9
lando ssh -c "curl http://index:8983/solr/admin/info/system" | grep "\"solr-spec-version\":\"8.11.2\""
lando ssh -c "curl http://index:8983/solr/admin/info/system" | grep "\"solr-spec-version\":\"8.8.2\""

# Jetty redirects should work for Pantheon Search
cd drupal9
lando ssh -c "curl http://index:8983/lando/v1/lando/admin/system" | grep "\"solr-spec-version\":\"8.11.2\""
lando ssh -c "curl http://index:8983/lando/v1/lando/admin/system" | grep "\"solr-spec-version\":\"8.8.2\""

# Should use a varnish http_resp_hdr_len setting of 25k
cd drupal9
Expand Down
13 changes: 8 additions & 5 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const getPantheonSettings = options => ({
'pantheon_environment': 'lando',
'pantheon_tier': 'lando',
'pantheon_index_host': PANTHEON_INDEX_HOST,
'pantheon_index_port': options.solrTag === '8' ? '443' : '449',
'pantheon_index_port': options.solrTag.substring(0, 1) === '8' ? '8983' : '449',
'pantheon_index_scheme': PANTHEON_INDEX_SCHEME,
'redis_client_host': PANTHEON_CACHE_HOST,
'redis_client_port': PANTHEON_CACHE_PORT,
Expand Down Expand Up @@ -229,7 +229,7 @@ exports.getPantheonEnvironment = options => ({
PATH: PATH.join(':'),
PANTHEON_ENVIRONMENT: 'lando',
PANTHEON_INDEX_HOST: PANTHEON_INDEX_HOST,
PANTHEON_INDEX_PORT: options.solrTag === '8' ? '8983' : '449',
PANTHEON_INDEX_PORT: options.solrTag.substring(0, 1) === '8' ? '8983' : '449',
PANTHEON_INDEX_SCHEME: PANTHEON_INDEX_SCHEME,
PANTHEON_INDEX_PATH: '/',
PANTHEON_INDEX_CORE: '/lando',
Expand All @@ -252,15 +252,18 @@ exports.getPantheonEnvironment = options => ({
* Helper to build index service
*/
exports.getPantheonIndex = options => {
if (options.solrTag === '8') {
const searchVersion = _.toString(_.get(options, 'search.version', '3'));
if (searchVersion === '8') {
return {
services: {
index: {
type: 'solr:8.11.2',
type: 'solr:8.8.2',
portforward: true,
core: 'lando',
overrides: {
image: `devwithlando/pantheon-index:${options.solrTag}`,
volumes: [
`${options.confDest}/jetty.xml:/opt/solr-8.11.2/server/etc/jetty.xml`,
`${options.confDest}/jetty.xml:/opt/solr-8.8.2/server/etc/jetty.xml`,
],
},
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@lando/pantheon",
"description": "A Lando plugin that provides a tight integration with Pantheon.",
"version": "0.9.0",
"version": "0.10.0",
"author": "Mike Pirog @pirog",
"license": "GPL-3.0",
"repository": "lando/pantheon",
Expand Down
12 changes: 12 additions & 0 deletions recipes/pantheon/8.8-solr/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# docker build -t devwithlando/pantheon-index:8.8-4 .

FROM solr:8.8.2

# replace default configset with correct solr8 drupal config
ENV SOLR_DOWNLOAD="https://ftp.drupal.org/files/projects/search_api_solr-4.x-dev.tar.gz"
ENV SOLR_DEFAULT_CONFIGSET_DIR=/opt/solr/server/solr/configsets/_default/conf
RUN wget -qO- $SOLR_DOWNLOAD | tar xvz -C /tmp

USER root
RUN mv /tmp/search_api_solr/jump-start/solr8/config-set/* $SOLR_DEFAULT_CONFIGSET_DIR

2 changes: 1 addition & 1 deletion recipes/pantheon/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ module.exports = {
// Set the search version
const searchVersion = _.toString(_.get(options, 'search.version', '3'));
// Set solrtag if search is set to solr8.
if (searchVersion === '8') options.solrTag = searchVersion;
if (searchVersion === '8') options.solrTag = '8.8-4';
options.database = `${dbService}:${dbVersion}`;
// Set correct things based on framework
options.defaultFiles.vhosts = `${options.framework}.conf.tpl`;
Expand Down

0 comments on commit da6b552

Please sign in to comment.