Skip to content

Commit

Permalink
Merge pull request #26 from nlnwa/feat/solrwayback-5
Browse files Browse the repository at this point in the history
Upgrade Solrwayback to version 5.x
  • Loading branch information
maeb authored Apr 18, 2024
2 parents 67f48b7 + 4d9e596 commit 1da15cd
Show file tree
Hide file tree
Showing 17 changed files with 176 additions and 375 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

21 changes: 21 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
commit-message:
prefix: "build"
include: "scope"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
commit-message:
prefix: "build"
include: "scope"
18 changes: 5 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Test release

on:
push:
on: push

env:
REGISTRY: ghcr.io
Expand All @@ -15,20 +14,19 @@ jobs:
packages: write
strategy:
matrix:
image-type: [solr, solrwayback, warc-indexer]
image: [solrwayback, warc-indexer]
steps:
- name: Code checkout
uses: actions/checkout@v3
with:
lfs: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Extract metadata (tags, labels, version) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.image-type }}
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.image }}
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
Expand All @@ -40,10 +38,4 @@ jobs:
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: Dockerfile.${{ matrix.image-type }}
build-args: |
SOLRWAYBACK_VERSION=4.4.2
SOLR_VERSION=7.7.3
SOLRWAYBACK_TOMCAT_VERSION=8.5.60
TOMCAT_TAG=8.5-jdk8-temurin-jammy
ECLIPSE_TEMURIN_TAG=8-jre
file: Dockerfile.${{ matrix.image }}
15 changes: 4 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,19 @@ jobs:
packages: write
strategy:
matrix:
image-type: [solr, solrwayback, warc-indexer]
image: [solrwayback, warc-indexer]
steps:
- name: Code checkout
uses: actions/checkout@v3
with:
lfs: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Extract metadata (tags, labels, version) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.image-type }}
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.image }}
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
Expand All @@ -52,10 +51,4 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: Dockerfile.${{ matrix.image-type }}
build-args: |
SOLRWAYBACK_VERSION=4.4.2
SOLR_VERSION=7.7.3
SOLRWAYBACK_TOMCAT_VERSION=8.5.60
TOMCAT_TAG=8.5-jdk8-temurin-jammy
ECLIPSE_TEMURIN_TAG=8-jre
file: Dockerfile.${{ matrix.image }}
42 changes: 0 additions & 42 deletions .github/workflows/test.yml

This file was deleted.

32 changes: 0 additions & 32 deletions Dockerfile.solr

This file was deleted.

55 changes: 28 additions & 27 deletions Dockerfile.solrwayback
Original file line number Diff line number Diff line change
@@ -1,51 +1,52 @@
# This dockerfile configures a vanilla tomcat container
# with solrwayback installed and configured with properties
# from solrwayback bundle.
# This dockerfile builds a tomcat container including the webapps
# from the solrwayback bundle.
#
# See https://hub.docker.com/_/tomcat for details on how
# to configure tomcat.
# See https://hub.docker.com/_/tomcat for details on how to configure tomcat.

ARG SOLRWAYBACK_VERSION=4.4.2
ARG SOLRWAYBACK_TOMCAT_VERSION=8.5.60
ARG TOMCAT_TAG=8.5-jdk8-temurin-jammy
ARG SOLRWAYBACK_VERSION=5.1.0
ARG SOLRWAYBACK_TOMCAT_VERSION=9
ARG TOMCAT_TAG=9-jre17-temurin-jammy

FROM ubuntu:22.04 as solrwayback-bundle

ARG SOLRWAYBACK_VERSION
ARG SOLRWAYBACK_TOMCAT_VERSION
ARG SOLRWAYBACK_VERSION

RUN apt-get update \
&& apt-get install --quiet --assume-yes wget unzip python3
RUN apt-get update && apt-get install -y \
unzip \
wget

WORKDIR /build
COPY fetch_solrwayback_bundle.py .

RUN python3 fetch_solrwayback_bundle.py \
--solrwayback-version ${SOLRWAYBACK_VERSION} \
--destination /app
RUN unzip /app/solrwayback_package_${SOLRWAYBACK_VERSION}/apache-tomcat-${SOLRWAYBACK_TOMCAT_VERSION}/webapps/solrwayback.war \
-d /app/solrwayback/
RUN wget -q https://github.com/netarchivesuite/solrwayback/releases/download/${SOLRWAYBACK_VERSION}/solrwayback_package_${SOLRWAYBACK_VERSION}.zip
RUN unzip solrwayback_package_${SOLRWAYBACK_VERSION}.zip \
&& mkdir /webapps \
&& unzip -d /webapps/solrwayback solrwayback_package_${SOLRWAYBACK_VERSION}_MASTER/tomcat-${SOLRWAYBACK_TOMCAT_VERSION}/webapps/solrwayback.war \
&& cp solrwayback_package_${SOLRWAYBACK_VERSION}_MASTER/tomcat-${SOLRWAYBACK_TOMCAT_VERSION}/webapps/ROOT.war /webapps/ROOT.war

FROM tomcat:${TOMCAT_TAG}

ARG SOLRWAYBACK_TOMCAT_VERSION
ARG SOLRWAYBACK_VERSION
FROM tomcat:${TOMCAT_TAG}

# TODO: install solrwayback dependencies such as ffmpeg, imagemagick, tesseract-ocr, chromium-browser, etc.
# This is not necessary for solrwayback to work.
# It is only necessary if you want to use the page preview feature.
# It increases the size of the image by about 200MB.
RUN apt-get update && apt-get install -y \
chromium-browser \
chromium-codecs-ffmpeg \
&& rm -rf /var/lib/apt/lists/*

# CATALINA_HOME is the folder where catalina is installed.
# The main component of tomcat is called catalina.
# CATALINA_HOME is set by the tomcat image.

# Copy the extracted solrwayback.war file and ROOT.war to the webapps folder of tomcat.
# Copy the extracted solrwayback.war file
# We use the extracted solrwayback.war to be able to customize the web
# application (favicon, etc.) at runtime (using overlays).
COPY --from=solrwayback-bundle \
/app/solrwayback/ \
/webapps/solrwayback \
${CATALINA_HOME}/webapps/solrwayback

# Copy ROOT.war to the webapps folder of tomcat.
COPY --from=solrwayback-bundle \
/app/solrwayback_package_${SOLRWAYBACK_VERSION}/apache-tomcat-${SOLRWAYBACK_TOMCAT_VERSION}/webapps/ROOT.war \
/webapps/ROOT.war \
${CATALINA_HOME}/webapps/ROOT.war

# Set URL icon for the web application
COPY favicon.ico ${CATALINA_HOME}/webapps/solrwayback/
25 changes: 13 additions & 12 deletions Dockerfile.warc-indexer
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# This Dockerfile creates a vanilla java container
# with warc-indexer from solrwayback bundle.
# This Dockerfile creates a vanilla java container with warc-indexer from the solrwayback bundle.

ARG SOLRWAYBACK_VERSION=4.4.2
ARG ECLIPSE_TEMURIN_TAG=8-jre
ARG SOLRWAYBACK_VERSION=5.1.0
ARG ECLIPSE_TEMURIN_TAG=17-jre

FROM ubuntu:22.04 as solrwayback-bundle

ARG SOLRWAYBACK_VERSION

RUN apt-get update \
&& apt-get install --quiet --assume-yes wget python3
RUN apt-get update && apt-get install -y \
unzip \
wget

WORKDIR /build
COPY fetch_solrwayback_bundle.py .

RUN python3 fetch_solrwayback_bundle.py \
--solrwayback-version ${SOLRWAYBACK_VERSION} \
--destination /app
RUN wget -q https://github.com/netarchivesuite/solrwayback/releases/download/${SOLRWAYBACK_VERSION}/solrwayback_package_${SOLRWAYBACK_VERSION}.zip
RUN mkdir /app \
&& unzip solrwayback_package_${SOLRWAYBACK_VERSION}.zip \
&& mv solrwayback_package_${SOLRWAYBACK_VERSION}_MASTER/* /app


FROM eclipse-temurin:${ECLIPSE_TEMURIN_TAG}

ARG SOLRWAYBACK_VERSION
COPY --from=solrwayback-bundle /app/indexing /opt/warc-indexer

COPY --from=solrwayback-bundle /app/solrwayback_package_${SOLRWAYBACK_VERSION}/indexing /opt/warc-indexer
ENTRYPOINT ["/opt/warc-indexer/warc-indexer.sh"]
Loading

0 comments on commit 1da15cd

Please sign in to comment.