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

Deploy to production #374

Merged
merged 9 commits into from
Nov 27, 2024
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.version>3.16.3</quarkus.version>
<quarkus.version>3.17.0</quarkus.version>
<revision>999-SNAPSHOT</revision>
<skipITs>true</skipITs>
<surefire-plugin.version>3.5.2</surefire-plugin.version>
Expand Down Expand Up @@ -65,7 +65,7 @@
<dependency>
<groupId>io.quarkiverse.jgit</groupId>
<artifactId>quarkus-jgit</artifactId>
<version>3.3.2</version>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.githubapi</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/docker/elasticsearch-custom.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM elastic/elasticsearch:8.16.0
FROM elastic/elasticsearch:8.16.1

RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch analysis-kuromoji
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch analysis-smartcn
Expand Down
2 changes: 1 addition & 1 deletion src/main/helm/values.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ app:
envs:
QUARKUS_PROFILE: 'staging'
# Avoid overloading the rather resource-constrained Search backend instance
INDEXING_QUEUE_COUNT: '4'
INDEXING_QUEUE_COUNT: '6'
INDEXING_BULK_SIZE: '10'
resources:
limits:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

import org.hibernate.search.backend.elasticsearch.ElasticsearchBackend;
import org.hibernate.search.mapper.pojo.standalone.mapping.SearchMapping;
import org.hibernate.search.util.common.impl.Throwables;

import org.elasticsearch.client.Request;
import org.elasticsearch.client.RestClient;
Expand Down Expand Up @@ -253,7 +254,7 @@ private void indexAll(FailureCollector failureCollector) {
} catch (TimeoutException e) {
future.cancel(true);
} catch (ExecutionException e) {
e.getCause();
throw Throwables.toRuntimeException(e.getCause());
}
}

Expand Down
15 changes: 7 additions & 8 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ quarkusio.localized.ja.git-uri=https://github.com/quarkusio/ja.quarkus.io.git
########################
fetching.parallelism=8
fetching.timeout=10m
indexing.timeout=5m
indexing.timeout=10m
# Index at 00:00 UTC every day
# The time was selected to minimize impact on users:
# In winter this would be: Paris 01:00, New Delhi: 05:30, New York: 19:00, Beijing: 08:00, Los Angeles: 16:00
Expand Down Expand Up @@ -72,9 +72,9 @@ quarkus.hibernate-search-standalone.elasticsearch.version=${maven.distribution.s
quarkus.elasticsearch.devservices.image-name=${maven.name.search.backend}:${maven.version.search.backend}
quarkus.elasticsearch.devservices.java-opts=${PROD_ES_JAVA_OPTS}
# Limit parallelism of indexing, because the search backend can only handle so many documents in its buffers.
# This leads to at most 8*20=160 documents being indexed in parallel, which should be plenty
# This leads to at most 12*20=240 documents being indexed in parallel, which should be plenty
# given how large our documents can be.
INDEXING_QUEUE_COUNT=8
INDEXING_QUEUE_COUNT=12
INDEXING_BULK_SIZE=20
quarkus.hibernate-search-standalone.elasticsearch.indexing.queue-count=${INDEXING_QUEUE_COUNT}
quarkus.hibernate-search-standalone.elasticsearch.indexing.max-bulk-size=${INDEXING_BULK_SIZE}
Expand Down Expand Up @@ -213,12 +213,11 @@ quarkus.openshift.env.vars.QUARKUS_PROFILE=prod
quarkus.openshift.env.vars.INDEXING_QUEUE_COUNT=${INDEXING_QUEUE_COUNT}
quarkus.openshift.env.vars.INDEXING_BULK_SIZE=${INDEXING_BULK_SIZE}
# Initial indexing may take a while, especially the quarkus.io Git cloning
# Tests indicate it can take ~240s in prod,
# Tests indicate the whole process can take ~5M in prod,
# so we'll use 3 times as much as the limit, to allow for 3 attempts.
# 15S * 48 = 720S = 240S * 3
quarkus.openshift.startup-probe.initial-delay=30S
quarkus.openshift.startup-probe.period=15S
quarkus.openshift.startup-probe.failure-threshold=48
quarkus.openshift.startup-probe.initial-delay=2M
quarkus.openshift.startup-probe.period=1M
quarkus.openshift.startup-probe.failure-threshold=15
# Declare the management port on the service
quarkus.openshift.ports."management".container-port=9000
quarkus.openshift.ports."management".host-port=90
Expand Down