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 Solr 8 images #97

Merged
merged 20 commits into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 8 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ node ('lagoon-images') {
}
)

stage ('publish experimental image tags to testlagoon') {
if (env.SAFEBRANCH_NAME == 'main' || env.CHANGE_ID && pullRequest.labels.contains("experimental")) {
sh script: "make -O${SYNC_MAKE_OUTPUT} -j8 publish-testlagoon-experimental-baseimages BRANCH_NAME=${SAFEBRANCH_NAME}", label: "Publishing experimental images to testlagoon"
} else {
sh script: 'echo "not a PR or main branch push"', label: "Skipping experimantal image publishing"
}
}

if (env.TAG_NAME && env.SKIP_IMAGE_PUBLISH != 'true') {
parallel (
'build and push images to uselagoon dockerhub': {
Expand Down
58 changes: 43 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ SHELL := /bin/bash
#######

# Parameter for all `docker build` commands, can be overwritten by passing `DOCKER_BUILD_PARAMS=` via the `-e` option
DOCKER_BUILD_PARAMS := --quiet
DOCKER_BUILD_PARAMS :=

# On CI systems like jenkins we need a way to run multiple testings at the same time. We expect the
# CI systems to define an Environment variable CI_BUILD_TAG which uniquely identifies each build.
Expand Down Expand Up @@ -226,7 +226,14 @@ default-versioned-images := mariadb-10.4 \
varnish-5-persistent \
varnish-5-persistent-drupal

build-versioned-images = $(foreach image,$(versioned-images) $(default-versioned-images),build/$(image))
#######
####### Experimental Images
#######

experimental-images := solr-8 \
solr-8-drupal \

build-versioned-images = $(foreach image,$(versioned-images) $(default-versioned-images) $(experimental-images),build/$(image))

# Define the make recipe for all multi images
$(build-versioned-images):
Expand All @@ -248,8 +255,9 @@ $(build-versioned-images):

base-images-with-versions += $(versioned-images)
base-images-with-versions += $(default-versioned-images)
base-images-with-versions += $(experimental-images)
s3-images += $(versioned-images)
s3-images += $(default-versioned-images)
s3-images += $(experimental-images)

build/php-7.3-fpm build/php-7.4-fpm build/php-8.0-fpm: build/commons
build/php-7.3-cli: build/php-7.3-fpm
Expand All @@ -276,8 +284,9 @@ build/varnish-5-drupal build/varnish-5-persistent: build/varnish-5
build/varnish-5-persistent-drupal: build/varnish-5-drupal
build/varnish-6-drupal build/varnish-6-persistent: build/varnish-6
build/varnish-6-persistent-drupal: build/varnish-6-drupal
build/solr-7: build/commons
build/solr-7 build/solr-8: build/commons
build/solr-7-drupal: build/solr-7
build/solr-8-drupal: build/solr-8
build/mariadb-10.4 build/mariadb-10.5: build/commons
build/mariadb-10.4-drupal: build/mariadb-10.4
build/mariadb-10.5-drupal: build/mariadb-10.5
Expand Down Expand Up @@ -327,59 +336,78 @@ publish-testlagoon-baseimages = $(foreach image,$(base-images),[publish-testlago
publish-testlagoon-baseimages-with-versions = $(foreach image,$(base-images-with-versions),[publish-testlagoon-baseimages-with-versions]-$(image))
# Special handler for the previously unversioned images that now have versions
publish-testlagoon-baseimages-without-versions = $(foreach image,$(default-versioned-images),[publish-testlagoon-baseimages-without-versions]-$(image))
publish-testlagoon-experimental-baseimages = $(foreach image,$(experimental-images),[publish-testlagoon-experimental-baseimages]-$(image))

# tag and push all images
.PHONY: publish-testlagoon-baseimages
publish-testlagoon-baseimages: $(publish-testlagoon-baseimages) $(publish-testlagoon-baseimages-with-versions) $(publish-testlagoon-baseimages-without-versions)
publish-testlagoon-baseimages: $(publish-testlagoon-baseimages) $(publish-testlagoon-baseimages-with-versions) $(publish-testlagoon-baseimages-without-versions) $(publish-testlagoon-experimental-baseimages)

# tag and push of each image
.PHONY: $(publish-testlagoon-baseimages)
$(publish-testlagoon-baseimages):
# Calling docker_publish for image, but remove the prefix '[publish-testlagoon-baseimages]-' first
# Calling docker_publish for image, but remove the prefix '[publish-testlagoon-baseimages]-' first
$(eval image = $(subst [publish-testlagoon-baseimages]-,,$@))
$(eval variant = $(word 1,$(subst -, ,$(image))))
$(eval version = $(word 2,$(subst -, ,$(image))))
$(eval type = $(word 3,$(subst -, ,$(image))))
$(eval subtype = $(word 4,$(subst -, ,$(image))))
# Construct the folder and legacy tag to use - note that if treats undefined vars as 'false' to avoid extra '-/'
$(eval folder = $(shell echo $(variant)$(if $(type),-$(type))$(if $(subtype),-$(subtype))))

# Publish images with version tag
# We publish these images with the branch_name/PR no/tag
$(call docker_publish_testlagoon,$(image),$(image):$(BRANCH_NAME),$(folder))

# tag and push of base image with version
.PHONY: $(publish-testlagoon-baseimages-with-versions)
$(publish-testlagoon-baseimages-with-versions):
# Calling docker_publish for image, but remove the prefix '[publish-testlagoon-baseimages-with-versions]-' first
# Calling docker_publish for image, but remove the prefix '[publish-testlagoon-baseimages-with-versions]-' first
$(eval image = $(subst [publish-testlagoon-baseimages-with-versions]-,,$@))
# The underline is a placeholder for a colon, replace that
# The underline is a placeholder for a colon, replace that
$(eval image = $(subst __,:,$(image)))
$(eval variant = $(word 1,$(subst -, ,$(image))))
$(eval version = $(word 2,$(subst -, ,$(image))))
$(eval type = $(word 3,$(subst -, ,$(image))))
$(eval subtype = $(word 4,$(subst -, ,$(image))))
# Construct the folder and legacy tag to use - note that if treats undefined vars as 'false' to avoid extra '-/'
$(eval folder = $(shell echo $(variant)$(if $(type),-$(type))$(if $(subtype),-$(subtype))))
# We add the Lagoon Version just as a dash
# We publish these images with the branch_name/PR no/tag
$(call docker_publish_testlagoon,$(image),$(image):$(BRANCH_NAME),$(folder))

# tag and push of unversioned base images
.PHONY: $(publish-testlagoon-baseimages-without-versions)
$(publish-testlagoon-baseimages-without-versions):
# Calling docker_publish for image, but remove the prefix '[publish-testlagoon-baseimages-with-versions]-' first
# Calling docker_publish for image, but remove the prefix '[publish-testlagoon-baseimages-with-versions]-' first
$(eval image = $(subst [publish-testlagoon-baseimages-without-versions]-,,$@))
$(eval variant = $(word 1,$(subst -, ,$(image))))
$(eval version = $(word 2,$(subst -, ,$(image))))
$(eval type = $(word 3,$(subst -, ,$(image))))
$(eval subtype = $(word 4,$(subst -, ,$(image))))
# Construct a "legacy" tag of the form `testlagoon/variant-type-subtype` e.g. `testlagoon/postgres-ckan`
# Construct a "legacy" tag of the form `testlagoon/variant-type-subtype` e.g. `testlagoon/postgres-ckan`
$(eval legacytag = $(shell echo $(variant)$(if $(type),-$(type))$(if $(subtype),-$(subtype))))
# Construct the folder and legacy tag to use - note that if treats undefined vars as 'false' to avoid extra '-/'
$(eval folder = $(shell echo $(variant)$(if $(type),-$(type))$(if $(subtype),-$(subtype))))
# These images already use a tag to differentiate between different versions of the service itself (like node:9 and node:10)
# We push a version without the `-latest` suffix
# These images already use a tag to differentiate between different versions of the service itself (like node:14 and node:16)
# We push a version without the `-latest` suffix
$(call docker_publish_testlagoon,$(image),$(legacytag):$(BRANCH_NAME),$(folder))

# tag and push of experimental base images
.PHONY: publish-testlagoon-experimental-baseimages
publish-testlagoon-experimental-baseimages: $(publish-testlagoon-experimental-baseimages)

.PHONY: $(publish-testlagoon-experimental-baseimages)
$(publish-testlagoon-experimental-baseimages):
# Calling docker_publish for image, but remove the prefix '[publish-testlagoon-baseimages-with-versions]-' first
$(eval image = $(subst [publish-testlagoon-experimental-baseimages]-,,$@))
# The underline is a placeholder for a colon, replace that
$(eval image = $(subst __,:,$(image)))
$(eval variant = $(word 1,$(subst -, ,$(image))))
$(eval version = $(word 2,$(subst -, ,$(image))))
$(eval type = $(word 3,$(subst -, ,$(image))))
$(eval subtype = $(word 4,$(subst -, ,$(image))))
# Construct the folder and legacy tag to use - note that if treats undefined vars as 'false' to avoid extra '-/'
$(eval folder = $(shell echo $(variant)$(if $(type),-$(type))$(if $(subtype),-$(subtype))))
# We also publish experimental images with an `:experimental` moving tag
$(call docker_publish_testlagoon,$(image),$(image):experimental,$(folder))

#######
####### All tagged releases are pushed to uselagoon repository with new semantic tags
#######
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<p align="center">
<img src="https://raw.githubusercontent.com/amazeeio/lagoon/main/docs/images/lagoon-logo.png" alt="The Lagoon logo is a blue hexagon split in two pieces with an L-shaped cut" width="40%">
<img src="https://raw.githubusercontent.com/uselagoon/lagoon/main/docs/images/lagoon-logo.png" alt="The Lagoon logo is a blue hexagon split in two pieces with an L-shaped cut" width="40%">
</p>

# Lagoon Base Images

This repository contains [Dockerfiles](https://docs.docker.com/engine/reference/builder/) related to [Lagoon](https://github.com/amazeeio/lagoon/).
This repository contains [Dockerfiles](https://docs.docker.com/engine/reference/builder/) related to [Lagoon](https://github.com/uselagoon/lagoon/).

This repository was created with `git filter-repo` from the main Lagoon repository, in order to preserve commit history.

Expand All @@ -14,6 +14,14 @@ These dockerfiles are used to create the base images for consumption in [Docker

The images used to build Lagoon itself are stored in the Lagoon repository, and are built separately.

## Experimental images

From time to time, the Lagoon team may release images that are not suitable for use in production, but are ready for testing.

These images will be available from the `testlagoon` organization on dockerhub, and be tagged with an `:experimental` tag instead of :latest

The release notes will outline the status of experimental images

## Contribute

Branch/fork and add/edit a Dockerfile in the `images/` directory.
Expand Down
6 changes: 6 additions & 0 deletions images/solr-drupal/8.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ARG IMAGE_REPO
FROM ${IMAGE_REPO:-lagoon}/solr-8

COPY drupal-4.1.1-solr-8.x-0 /solr-conf

CMD ["solr-precreate", "drupal", "/solr-conf"]
27 changes: 27 additions & 0 deletions images/solr-drupal/8.x/elevate.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>

<!--
This file allows you to boost certain search items to the top of search
results. You can find out an item's ID by searching directly on the Solr
server. Search API generally constructs item IDs (esp. for entities) as:
$document->id = "$site_hash-$index_id-$datasource:$entity_id:$language_id";

If you want this file to be automatically re-loaded when a Solr commit takes
place (e.g., if you have an automatic script active which updates elevate.xml
according to newly-indexed data), place it into Solr's data/ directory.
Otherwise, place it with the other configuration files into the conf/
directory.

See http://wiki.apache.org/solr/QueryElevationComponent for more information.
-->

<elevate>
<!-- Example for ranking the node #789 first in searches for "example query": -->
<!--
<query text="example query">
<doc id="ab12cd34-site_index-entity:789:en" />
</query>
-->
<!-- Multiple <query> elements can be specified, contained in one <elevate>. -->
<!-- <query text="...">...</query> -->
</elevate>
Loading