diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e96a855427..38f71b6a12 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -79,10 +79,10 @@ jobs: - run: docker cp builder:/src/core/build/ core/build/ || true if: always() - - run: docker cp mapfish-print_tests_1:/src/examples/build/ examples/build/ || true + - run: docker cp mapfish-print-tests-1:/src/examples/build/ examples/build/ || true if: always() - - run: docker-compose logs || true + - run: docker compose logs || true if: failure() - run: make acceptance-tests-down diff --git a/Makefile b/Makefile index 83e10b76eb..495e156171 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ build: .PHONY: acceptance-tests-up acceptance-tests-up: - docker-compose down --remove-orphan + docker compose down mkdir /tmp/geoserver-data || true docker run --rm --volume=/tmp/geoserver-data:/mnt/geoserver_datadir camptocamp/geoserver \ @@ -23,17 +23,17 @@ acceptance-tests-up: cp -r examples/geoserver-data/* /tmp/geoserver-data/ cp -r core/src/test/resources/map-data/* /tmp/geoserver-data/www/ - docker-compose up -d + docker compose up -d .PHONY: acceptance-tests-run acceptance-tests-run: - docker-compose exec -T tests gradle :examples:integrationTest + docker compose exec -T tests gradle :examples:integrationTest ci/check-fonts ci/validate-container .PHONY: acceptance-tests-down acceptance-tests-down: - docker-compose down || true + docker compose down || true docker run --rm --volume=/tmp/geoserver-data:/mnt/geoserver_datadir camptocamp/geoserver \ bash -c 'rm -rf /mnt/geoserver_datadir/*' rmdir /tmp/geoserver-data diff --git a/ci/config.yaml b/ci/config.yaml index 99fb502c2c..e120540903 100644 --- a/ci/config.yaml +++ b/ci/config.yaml @@ -4,6 +4,7 @@ checks: required_workflows: False versions: false codespell: false + print_versions: false publish: pypi: diff --git a/core/Dockerfile b/core/Dockerfile index f164eceac0..166214cafa 100644 --- a/core/Dockerfile +++ b/core/Dockerfile @@ -1,7 +1,7 @@ FROM mapfish_print_builder AS builder -FROM tomcat:9.0.65 AS runner +FROM tomcat:9.0.93-jdk11-temurin-jammy AS runner LABEL maintainer="Camptocamp " RUN perl -0777 -i -pe 's/(]*>)//s' ${CATALINA_HOME}/conf/server.xml && \ diff --git a/core/build.gradle b/core/build.gradle index 701aa87665..c0a74e1872 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -150,8 +150,7 @@ dependencies { "io.dropwizard.metrics:metrics-servlets:$metricsVersion", "io.dropwizard.metrics:metrics-jvm:$metricsVersion", "io.dropwizard.metrics:metrics-jmx:$metricsVersion", - "io.dropwizard.metrics:metrics-logback:$metricsVersion", - 'com.readytalk:metrics3-statsd:4.2.0' + "io.dropwizard.metrics:metrics-logback:$metricsVersion" ) geotools( "org.geotools:gt-epsg-hsql:$geotoolsVersion", diff --git a/core/src/main/java/org/mapfish/print/metrics/StatsDReporterInit.java b/core/src/main/java/org/mapfish/print/metrics/StatsDReporterInit.java deleted file mode 100644 index bfad4c2adc..0000000000 --- a/core/src/main/java/org/mapfish/print/metrics/StatsDReporterInit.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.mapfish.print.metrics; - -import com.codahale.metrics.MetricRegistry; -import com.readytalk.metrics.StatsDReporter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; - -import java.net.InetAddress; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.UnknownHostException; -import java.util.concurrent.TimeUnit; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; - -/** - * Will start a StatsD reporter if configured. Using those environment variables or Java system properties: - - * STATSD_ADDRESS: the address:port of the statsd daemon (if not set, the feature is disabled) - - * STATSD_PREFIX: the prefix to set (defaults to mapfish-print). Can use %h to insert the hostname. - - * STATSD_PERIOD: the reporting period in seconds (defaults to 10) - */ -public class StatsDReporterInit { - private static final String ADDRESS = "STATSD_ADDRESS"; - private static final String PREFIX = "STATSD_PREFIX"; - private static final String PERIOD = "STATSD_PERIOD"; - private static final Logger LOGGER = LoggerFactory.getLogger(StatsDReporterInit.class); - - @Autowired - private MetricRegistry metricRegistry; - - private StatsDReporter reporter = null; - - private static String getHostname() { - String hostname = System.getenv("HOSTNAME"); // should work on Unix - if (hostname == null) { - hostname = System.getenv("COMPUTERNAME"); // should work on Windows - } - if (hostname == null) { - try { - // last resort - hostname = InetAddress.getLocalHost().getHostName(); - } catch (UnknownHostException e) { - hostname = "unknown"; // fallback - } - } - return hostname.toLowerCase(); - } - - private String getConfig(final String name, final String def) { - final String result = System.getenv(name); - if (result == null) { - return System.getProperty(name, def); - } - return result; - } - - /** - * Start the StatsD reporter, if configured. - * - * @throws URISyntaxException - */ - @PostConstruct - public final void init() throws URISyntaxException { - final String address = getConfig(ADDRESS, null); - if (address != null) { - final URI uri = new URI("udp://" + address); - final String prefix = getConfig(PREFIX, "mapfish-print").replace("%h", getHostname()); - final int period = Integer.parseInt(getConfig(PERIOD, "10")); - LOGGER.info("Starting a StatsD reporter targeting {} with prefix {} and period {}s", - uri, prefix, period); - this.reporter = StatsDReporter.forRegistry(this.metricRegistry) - .prefixedWith(prefix) - .build(uri.getHost(), uri.getPort()); - this.reporter.start(period, TimeUnit.SECONDS); - } - } - - /** - * Stop the StatsD reporter, if configured. - */ - @PreDestroy - public final void shutdown() { - if (this.reporter != null) { - LOGGER.info("Stopping the StatsD reporter"); - this.reporter.stop(); - } - } -} diff --git a/core/src/main/resources/mapfish-spring-application-context.xml b/core/src/main/resources/mapfish-spring-application-context.xml index ba63f64e54..7b69183cb7 100644 --- a/core/src/main/resources/mapfish-spring-application-context.xml +++ b/core/src/main/resources/mapfish-spring-application-context.xml @@ -66,7 +66,6 @@ - diff --git a/examples/src/test/resources/examples/datasource_many_dynamictables_legend/expected_output/requestData.png b/examples/src/test/resources/examples/datasource_many_dynamictables_legend/expected_output/requestData.png index c741789220..ff2fded9aa 100644 Binary files a/examples/src/test/resources/examples/datasource_many_dynamictables_legend/expected_output/requestData.png and b/examples/src/test/resources/examples/datasource_many_dynamictables_legend/expected_output/requestData.png differ