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

Add APPEND_NATIVE_ENTRYPOINT variable to lagoon entrypoints, and use for solr9 #963

Merged
merged 4 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion helpers/TESTING_service_images_dockercompose.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp:/
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://postgres-15:5432 -timeout 1m
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://postgres-16:5432 -timeout 1m
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://mongo-4:27017 -timeout 1m
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://opensearch-2:9200 -timeout 1m
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://rabbitmq:15672 -timeout 1m
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://redis-6:6379 -timeout 1m
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://redis-7:6379 -timeout 1m
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://opensearch-2:9200 -timeout 1m
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://solr-8:8983 -timeout 1m
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://solr-9:8983 -timeout 1m
```

Verification commands
Expand All @@ -62,6 +64,7 @@ docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep redis-6
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep redis-7
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep solr-8
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep solr-9
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep nginx
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep varnish-6
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep varnish-7
Expand Down Expand Up @@ -117,6 +120,19 @@ docker-compose exec -T solr-8 sh -c "cat /var/solr/data/mycore/conf/solrconfig.x
docker-compose exec -T commons sh -c "curl -kL http://internal-services-test:3000/solr?service=solr-8" | grep "SERVICE_HOST=solr-8"
docker-compose exec -T commons sh -c "curl -kL http://internal-services-test:3000/solr?service=solr-8" | grep "LAGOON_TEST_VAR=all-images"

# solr-9 should have a "mycore" Solr core
docker-compose exec -T commons sh -c "curl solr-9:8983/solr/admin/cores?action=STATUS\&core=mycore"

# solr-9 should be able to reload "mycore" Solr core
docker-compose exec -T commons sh -c "curl solr-9:8983/solr/admin/cores?action=RELOAD\&core=mycore"

# solr-9 should have solr 9 solrconfig in "mycore" core
docker-compose exec -T solr-9 sh -c "cat /var/solr/data/mycore/conf/solrconfig.xml" | grep luceneMatchVersion | grep 9.

# solr-9 should be able to read/write data
docker-compose exec -T commons sh -c "curl -kL http://internal-services-test:3000/solr?service=solr-9" | grep "SERVICE_HOST=solr-9"
docker-compose exec -T commons sh -c "curl -kL http://internal-services-test:3000/solr?service=solr-9" | grep "LAGOON_TEST_VAR=all-images"

# mariadb-10-4 should be version 10.4 client
docker-compose exec -T mariadb-10-4 sh -c "mysql -V" | grep "10.4"

Expand Down
6 changes: 6 additions & 0 deletions helpers/services-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ services:
- "8983"
user: solr

solr-9:
image: uselagoon/solr-9:latest
ports:
- "8983"
user: solr

varnish-6:
image: uselagoon/varnish-6:latest
labels:
Expand Down
9 changes: 8 additions & 1 deletion images/commons/lagoon/entrypoints.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ if [ -d /lagoon/entrypoints ]; then
unset i
fi

exec "$@"
# If the image provides a native endpoint that can, or should, be run after the lagoon endpoints are set, it's path can be
tobybellwood marked this conversation as resolved.
Show resolved Hide resolved
# set in the APPEND_NATIVE_ENTRYPOINT variable.
if [ -n "$APPEND_NATIVE_ENTRYPOINT" ] && [ -f $APPEND_NATIVE_ENTRYPOINT ]; then
echo "running defined endpoint"
. $APPEND_NATIVE_ENTRYPOINT
fi

exec "$@"
1 change: 0 additions & 1 deletion images/solr-drupal/9.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ LABEL org.opencontainers.image.source="https://github.com/uselagoon/lagoon-image

COPY --from=jumpstart /search_api_solr/jump-start/solr9/config-set /solr-conf/conf
ENV SOLR_INSTALL_DIR=/opt/solr
RUN mkdir -p /var/solr/data

CMD ["solr-precreate", "drupal", "/solr-conf"]
156 changes: 0 additions & 156 deletions images/solr/20-solr-datadir.sh

This file was deleted.

8 changes: 3 additions & 5 deletions images/solr/9.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,12 @@ USER solr

ENV SOLR_OPTS="-Dlog4j2.formatMsgNoLookups=true"

COPY 10-solr-port.sh /lagoon/entrypoints/
# currently, there is no smart upgrade path from 7 to 8 - no autoremediation etc
# and whilst sites may work, upgrading from 7 to 8, they won't work downgrading...
# COPY 20-solr-datadir.sh /lagoon/entrypoints/

# Define Volume so locally we get persistent cores
VOLUME /var/solr

# Define provided solr-docker entrypoint to append
ENV APPEND_NATIVE_ENTRYPOINT=/opt/solr/docker/scripts/docker-entrypoint.sh

ENTRYPOINT ["/sbin/tini", "--", "/lagoon/entrypoints.sh"]

CMD ["solr-precreate", "mycore"]