From a0d0b8a24dccbf4b97e3493559c991a6aa856879 Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Thu, 17 Oct 2024 18:28:14 +0100 Subject: [PATCH] Update to Elasticsearch 8.15 Repository-{s3,gcs} are now included in ES, so don't need to be installed. --- .github/workflows/build.yml | 44 ++++++++++++++----------------------- Dockerfile | 8 +++---- Makefile | 8 +++---- k8s-entrypoint.sh | 6 ++--- 4 files changed, 27 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 29a84f8..5363d64 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,35 +1,25 @@ -name: package - -on: - push: {} - schedule: - - cron: "0 3 * * *" - workflow_dispatch: +name: 'package' +on: + push: + branches: ['main'] permissions: - packages: write + packages: 'write' jobs: docker: - runs-on: ubuntu-latest + runs-on: 'ubuntu-latest' steps: - - uses: actions/checkout@v2 - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - with: - install: true - - name: Login to DockerHub - uses: docker/login-action@v1 + - uses: 'actions/checkout@v4' + + - uses: 'docker/login-action@v3' with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v2 + registry: 'ghcr.io' + username: '${{ github.repository_owner }}' + password: '${{ secrets.GITHUB_TOKEN }}' + + - uses: 'docker/build-push-action@v6' with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: ghcr.io/alephdata/aleph-elasticsearch:${{ github.sha }} + context: '.' + push: true + tags: 'ghcr.io/occrp/alfred-elasticsearch:${{ github.sha }}' diff --git a/Dockerfile b/Dockerfile index 69ddc2d..ddfe554 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,7 @@ -FROM elasticsearch:7.16.3 -LABEL org.opencontainers.image.source = "https://github.com/alephdata/aleph-elasticsearch" +FROM elasticsearch:8.15.2 +LABEL org.opencontainers.image.source="https://github.com/alephdata/aleph-elasticsearch" -RUN bin/elasticsearch-plugin install --batch repository-s3 \ - && bin/elasticsearch-plugin install --batch repository-gcs \ - && bin/elasticsearch-plugin install --batch analysis-icu +RUN bin/elasticsearch-plugin install --batch analysis-icu COPY k8s-entrypoint.sh /k8s-entrypoint.sh COPY --chown=elasticsearch synonames.txt /usr/share/elasticsearch/config/ diff --git a/Makefile b/Makefile index 2a9ad6c..e083428 100644 --- a/Makefile +++ b/Makefile @@ -3,13 +3,13 @@ TAG=latest all: push build: - docker build -t alephdata/aleph-elasticsearch:$(TAG) . + docker buildx build -t occrp/alfred-elasticsearch:$(TAG) . run: build - docker run -ti alephdata/aleph-elasticsearch:$(TAG) bash + docker run -ti occrp/alfred-elasticsearch:$(TAG) bash exec: build - docker run -ti -v $(PWD)/secrets:/secrets alephdata/aleph-elasticsearch:$(TAG) + docker run -ti -v $(PWD)/secrets:/secrets occrp/alfred-elasticsearch:$(TAG) push: build - docker push alephdata/aleph-elasticsearch:$(TAG) + docker push occrp/alfred-elasticsearch:$(TAG) diff --git a/k8s-entrypoint.sh b/k8s-entrypoint.sh index dfaf2d8..2a46ca5 100755 --- a/k8s-entrypoint.sh +++ b/k8s-entrypoint.sh @@ -11,9 +11,9 @@ echo "create keystore" shopt -s nullglob for SECRETFILE in /secrets/*; do - KEYNAME=$(basename $SECRETFILE); - echo "$KEYNAME from $SECRETFILE"; - /usr/share/elasticsearch/bin/elasticsearch-keystore add-file $KEYNAME $SECRETFILE; + KEYNAME=$(basename "$SECRETFILE") + echo "$KEYNAME from $SECRETFILE" + /usr/share/elasticsearch/bin/elasticsearch-keystore add-file "$KEYNAME" "$SECRETFILE" done # Call original entrypoint script