Skip to content

Commit

Permalink
Merge branch 'master' into cache-update
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/org/prebid/server/settings/CachingApplicationSettings.java
  • Loading branch information
SerhiiNahornyi committed May 27, 2024
2 parents a137099 + 9084807 commit 74320c1
Show file tree
Hide file tree
Showing 672 changed files with 13,128 additions and 9,301 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# From https://github.com/microsoft/vscode-dev-containers/blob/master/containers/go/.devcontainer/Dockerfile
ARG VARIANT="17-jdk-bookworm"
ARG VARIANT="21-jdk-bookworm"
FROM mcr.microsoft.com/vscode/devcontainers/java:${VARIANT}
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dockerfile": "Dockerfile",
"args": {
// Update the VARIANT arg to pick a version of Java
"VARIANT": "17-jdk-bookworm",
"VARIANT": "21-jdk-bookworm",
}
},
"containerEnv": {
Expand Down
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ ij_java_for_statement_wrap = off
ij_java_generate_final_locals = false
ij_java_generate_final_parameters = false
ij_java_if_brace_force = never
ij_java_imports_layout = *,|,javax.**,java.**,|,$*
ij_java_imports_layout = *,|,javax.**,jakarta.**,java.**,|,$*
ij_java_indent_case_from_switch = true
ij_java_insert_inner_class_imports = false
ij_java_insert_override_annotation = true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-image-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
packages: write
strategy:
matrix:
java: [ 17 ]
java: [ 21 ]
dockerfile-path: [Dockerfile, extra/Dockerfile]
include:
- dockerfile-path: Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
java: [ 17 ]
java: [ 21 ]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-java-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
java: [ 17 ]
java: [ 21 ]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-module-functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
java: [ 17 ]
java: [ 21 ]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-asset-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 17 ]
java: [ 21 ]
steps:
- uses: actions/checkout@v4
- name: Set up JDK
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM amazoncorretto:17
FROM amazoncorretto:21

WORKDIR /app/prebid-server

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-modules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM amazoncorretto:17
FROM amazoncorretto:21

WORKDIR /app/prebid-server

Expand Down
2 changes: 1 addition & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</module>
<module name="ImportOrder">
<property name="option" value="bottom"/>
<property name="groups" value="*,/^java/"/>
<property name="groups" value="*,/^java|^jakarta/"/>
<property name="ordered" value="false"/>
<property name="separated" value="true"/>
<property name="caseSensitive" value="true"/>
Expand Down
41 changes: 19 additions & 22 deletions docs/config-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ This parameter exists to allow to change the location of the directory Vert.x wi
- `server.jks-password` - password for the keystore (if ssl is enabled).

## HTTP Server
- `http.max-headers-size` - set the maximum length of all headers, deprecated(use server.max-headers-size instead).
- `http.ssl` - enable SSL/TLS support, deprecated(use server.ssl instead).
- `http.jks-path` - path to the java keystore (if ssl is enabled), deprecated(use server.jks-path instead).
- `http.jks-password` - password for the keystore (if ssl is enabled), deprecated(use server.jks-password instead).
- `server.max-headers-size` - set the maximum length of all headers, deprecated(use server.max-headers-size instead).
- `server.ssl` - enable SSL/TLS support, deprecated(use server.ssl instead).
- `server.jks-path` - path to the java keystore (if ssl is enabled), deprecated(use server.jks-path instead).
- `server.jks-password` - password for the keystore (if ssl is enabled), deprecated(use server.jks-password instead).
- `server.http.server-instances` - how many http server instances should be created.
This parameter affects how many CPU cores will be utilized by the application. Rough assumption - one http server instance will keep 1 CPU core busy.
- `server.http.enabled` - if set to `true` enables http server
Expand Down Expand Up @@ -75,9 +75,8 @@ Removes and downloads file again if depending service cant process probably corr
- `default-request.file.path` - path to a JSON file containing the default request

## Auction (OpenRTB)
- `auction.blacklisted-accounts` - comma separated list of blacklisted account IDs.
- `auction.blacklisted-apps` - comma separated list of blacklisted applications IDs, requests from which should not be processed.
- `auction.max-timeout-ms` - maximum operation timeout for OpenRTB Auction requests. Deprecated.
- `auction.blocklisted-accounts` - comma separated list of blocklisted account IDs.
- `auction.blocklisted-apps` - comma separated list of blocklisted applications IDs, requests from which should not be processed.
- `auction.biddertmax.min` - minimum operation timeout for OpenRTB Auction requests.
- `auction.biddertmax.max` - maximum operation timeout for OpenRTB Auction requests.
- `auction.biddertmax.percent` - adjustment factor for `request.tmax` for bidders.
Expand All @@ -104,7 +103,7 @@ Removes and downloads file again if depending service cant process probably corr

## Video
- `auction.video.stored-required` - flag forces to merge with stored request
- `auction.blacklisted-accounts` - comma separated list of blacklisted account IDs.
- `auction.blocklisted-accounts` - comma separated list of blocklisted account IDs.
- `video.stored-requests-timeout-ms` - timeout for stored requests fetching.
- `auction.ad-server-currency` - default currency for video auction, if its value was not specified in request. Important note: PBS uses ISO-4217 codes for the representation of currencies.
- `auction.video.escape-log-cache-regex` - regex to remove from cache debug log xml.
Expand Down Expand Up @@ -204,11 +203,6 @@ Also, each bidder could have its own bidder-specific options.
- `admin-endpoints.tracelog.on-application-port` - when equals to `false` endpoint will be bound to `admin.port`.
- `admin-endpoints.tracelog.protected` - when equals to `true` endpoint will be protected by basic authentication configured in `admin-endpoints.credentials`

- `admin-endpoints.e2eadmin.enabled` - if equals to `true` the endpoint will be available.
- `admin-endpoints.e2eadmin.path` - the server context path where the endpoint will be accessible.
- `admin-endpoints.e2eadmin.on-application-port` - when equals to `false` endpoint will be bound to `admin.port`.
- `admin-endpoints.e2eadmin.protected` - when equals to `true` endpoint will be protected by basic authentication configured in `admin-endpoints.credentials`

- `admin-endpoints.collected-metrics.enabled` - if equals to `true` the endpoint will be available.
- `admin-endpoints.collected-metrics.path` - the server context path where the endpoint will be accessible.
- `admin-endpoints.collected-metrics.on-application-port` - when equals to `false` endpoint will be bound to `admin.port`.
Expand Down Expand Up @@ -294,8 +288,10 @@ For database data source available next options:
- `settings.database.user` - database user.
- `settings.database.password` - database password.
- `settings.database.pool-size` - set the initial/min/max pool size of database connections.
- `settings.database.idle-connection-timeout` - Set the idle timeout, time unit is seconds. Zero means don't timeout. This determines if a connection will timeout and be closed and get back to the pool if no data is received nor sent within the timeout.
- `settings.database.enable-prepared-statement-caching` - Enable caching of the prepared statements so that they can be reused. Defaults to `false`. Please be vary of the DB server limitations as cache instances is per-database-connection.
- `settings.database.max-prepared-statement-cache-size` - Set the maximum size of the prepared statement cache. Defaults to `256`. Has any effect only when `settings.database.enable-prepared-statement-caching` is set to `true`. Please note that the cache size is multiplied by `settings.database.pool-size`.
- `settings.database.account-query` - the SQL query to fetch account.
- `settings.database.provider-class` - type of connection pool to be used: `hikari` or `c3p0`.
- `settings.database.stored-requests-query` - the SQL query to fetch stored requests.
- `settings.database.amp-stored-requests-query` - the SQL query to fetch AMP stored requests.
- `settings.database.stored-responses-query` - the SQL query to fetch stored responses.
Expand Down Expand Up @@ -338,6 +334,7 @@ See [application settings](application-settings.md) for full reference of availa
For caching available next options:
- `settings.in-memory-cache.ttl-seconds` - how long (in seconds) data will be available in LRU cache.
- `settings.in-memory-cache.cache-size` - the size of LRU cache.
- `settings.in-memory-cache.jitter-seconds` - jitter (in seconds) for `settings.in-memory-cache.ttl-seconds` parameter.
- `settings.in-memory-cache.notification-endpoints-enabled` - if equals to `true` two additional endpoints will be
available: [/storedrequests/openrtb2](endpoints/storedrequests/openrtb2.md) and [/storedrequests/amp](endpoints/storedrequests/amp.md).
- `settings.in-memory-cache.account-invalidation-enabled` - if equals to `true` additional admin protected endpoints will be
Expand All @@ -346,14 +343,14 @@ available: `/cache/invalidate?account={accountId}` which remove account from the
- `settings.in-memory-cache.http-update.amp-endpoint` - the url to fetch AMP stored request updates.
- `settings.in-memory-cache.http-update.refresh-rate` - refresh period in ms for stored request updates.
- `settings.in-memory-cache.http-update.timeout` - timeout for obtaining stored request updates.
- `settings.in-memory-cache.jdbc-update.init-query` - initial query for fetching all stored requests at the startup.
- `settings.in-memory-cache.jdbc-update.update-query` - a query for periodical update of stored requests, that should
contain 'WHERE last_updated > ?' to fetch only the records that were updated since previous check.
- `settings.in-memory-cache.jdbc-update.amp-init-query` - initial query for fetching all AMP stored requests at the startup.
- `settings.in-memory-cache.jdbc-update.amp-update-query` - a query for periodical update of AMP stored requests, that should
contain 'WHERE last_updated > ?' to fetch only the records that were updated since previous check.
- `settings.in-memory-cache.jdbc-update.refresh-rate` - refresh period in ms for stored request updates.
- `settings.in-memory-cache.jdbc-update.timeout` - timeout for obtaining stored request updates.
- `settings.in-memory-cache.database-update.init-query` - initial query for fetching all stored requests at the startup.
- `settings.in-memory-cache.database-update.update-query` - a query for periodical update of stored requests, that should
contain 'WHERE last_updated > ?' for MySQL and 'WHERE last_updated > $1' for Postgresql to fetch only the records that were updated since previous check.
- `settings.in-memory-cache.database-update.amp-init-query` - initial query for fetching all AMP stored requests at the startup.
- `settings.in-memory-cache.database-update.amp-update-query` - a query for periodical update of AMP stored requests, that should
contain 'WHERE last_updated > ?' for MySQL and 'WHERE last_updated > $1' for Postgresql to fetch only the records that were updated since previous check.
- `settings.in-memory-cache.database-update.refresh-rate` - refresh period in ms for stored request updates.
- `settings.in-memory-cache.database-update.timeout` - timeout for obtaining stored request updates.

For targeting available next options:
- `settings.targeting.truncate-attr-chars` - set the max length for names of targeting keywords (0 means no truncation).
Expand Down
11 changes: 10 additions & 1 deletion docs/developers/functional-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,16 @@ Container for mocking different calls from PBS: prebid cache, bidders, currency

Container for Mysql database.

- Use `org/prebid/server/functional/db_schema.sql` script for scheme.
- Use `org/prebid/server/functional/db_mysql_schema.sql` script for scheme.
- DataBase: `prebid`
- Username: `prebid`
- Password: `prebid`

#### PostgreSQLContainer

Container for PostgreSQL database.

- Use `org/prebid/server/functional/db_psql_schema.sql` script for scheme.
- DataBase: `prebid`
- Username: `prebid`
- Password: `prebid`
Expand Down
4 changes: 2 additions & 2 deletions docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Other available metrics not mentioned here can found at

where:
- `[IP]` should be equal to IP address of bound network interface on cluster node for Prebid Server (for example: `0.0.0.0`)
- `[PORT]` should be equal to `http.port` configuration property
- `[PORT]` should be equal to `server.http.port` configuration property

### HTTP client metrics
- `vertx.http.clients.connections.{min,max,mean,p95,p99}` - how long connections live
Expand Down Expand Up @@ -44,7 +44,7 @@ where `[DATASOURCE]` is a data source name, `DEFAULT_DS` by defaul.
- `imps_video` - number of video impressions
- `imps_native` - number of native impressions
- `imps_audio` - number of audio impressions
- `requests.(ok|badinput|err|networkerr|blacklisted_account|blacklisted_app).(openrtb2-web|openrtb-app|amp|legacy)` - number of requests broken down by status and type
- `requests.(ok|badinput|err|networkerr|blocklisted_account|blocklisted_app).(openrtb2-web|openrtb-app|amp|legacy)` - number of requests broken down by status and type
- `bidder-cardinality.<cardinality>.requests` - number of requests targeting `<cardinality>` of bidders
- `connection_accept_errors` - number of errors occurred while establishing HTTP connection
- `db_query_time` - timer tracking how long did it take for database client to obtain the result for a query
Expand Down
11 changes: 1 addition & 10 deletions extra/bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.prebid</groupId>
<artifactId>prebid-server-aggregator</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
<relativePath>../../extra/pom.xml</relativePath>
</parent>

Expand All @@ -14,15 +14,6 @@
<name>prebid-server-bundle</name>
<description>Creates bundle (fat jar) with PBS-Core and other submodules listed as dependency</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<spring.boot.version>2.5.6</spring.boot.version>
</properties>

<dependencies>
<dependency>
<groupId>org.prebid</groupId>
Expand Down
3 changes: 1 addition & 2 deletions extra/modules/confiant-ad-quality/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.prebid.server.hooks.modules</groupId>
<artifactId>all-modules</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>confiant-ad-quality</artifactId>
Expand All @@ -17,7 +17,6 @@
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-redis-client</artifactId>
<version>3.9.10</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import io.vertx.core.Handler;
import io.vertx.core.Promise;
import io.vertx.core.Vertx;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;
import org.prebid.server.log.Logger;
import org.prebid.server.log.LoggerFactory;
import io.vertx.redis.client.Redis;
import io.vertx.redis.client.RedisAPI;
import io.vertx.redis.client.RedisConnection;
Expand Down Expand Up @@ -45,7 +45,7 @@ public RedisClient(
public void start(Promise<Void> startFuture) {
createRedisClient(onCreate -> {
if (onCreate.succeeded()) {
logger.info("Confiant Redis {0} connection is established", type);
logger.info("Confiant Redis {} connection is established", type);
startFuture.tryComplete();
}
}, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;
import org.prebid.server.log.Logger;
import org.prebid.server.log.LoggerFactory;
import org.prebid.server.hooks.modules.com.confiant.adquality.model.BidScanResult;
import org.prebid.server.hooks.modules.com.confiant.adquality.model.RedisError;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private BidRequest getBidRequest(AuctionInvocationContext auctionInvocationConte
final boolean disallowTransmitGeo = !auctionContext.getActivityInfrastructure()
.isAllowed(Activity.TRANSMIT_GEO, activityInvocationPayload);

final User maskedUser = userFpdActivityMask.maskUser(bidRequest.getUser(), true, true, disallowTransmitGeo);
final User maskedUser = userFpdActivityMask.maskUser(bidRequest.getUser(), true, true);
final Device maskedDevice = userFpdActivityMask.maskDevice(bidRequest.getDevice(), true, disallowTransmitGeo);

return bidRequest.toBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,7 @@ public void callShouldSubmitBidsWithoutMaskedGeoInfoWhenTransmitGeoIsAllowed() {
final Boolean transmitGeoIsAllowed = true;
final BidsScanResult bidsScanResult = redisParser.parseBidsScanResult(
"[[[{\"tag_key\": \"tag\", \"issues\":[{\"spec_name\":\"malicious_domain\",\"value\":\"ads.deceivenetworks.net\",\"first_adinstance\":\"e91e8da982bb8b7f80100426\"}]}]]]");
final User user = userFpdActivityMask.maskUser(
getUser(), true, true, !transmitGeoIsAllowed);
final User user = userFpdActivityMask.maskUser(getUser(), true, true);
final Device device = userFpdActivityMask.maskDevice(
getDevice(), true, !transmitGeoIsAllowed);

Expand Down Expand Up @@ -306,8 +305,7 @@ public void callShouldSubmitBidsWithMaskedGeoInfoWhenTransmitGeoIsNotAllowed() {
final Boolean transmitGeoIsAllowed = false;
final BidsScanResult bidsScanResult = redisParser.parseBidsScanResult(
"[[[{\"tag_key\": \"tag\", \"issues\":[{\"spec_name\":\"malicious_domain\",\"value\":\"ads.deceivenetworks.net\",\"first_adinstance\":\"e91e8da982bb8b7f80100426\"}]}]]]");
final User user = userFpdActivityMask.maskUser(
getUser(), true, true, !transmitGeoIsAllowed);
final User user = userFpdActivityMask.maskUser(getUser(), true, true);
final Device device = userFpdActivityMask.maskDevice(
getDevice(), true, !transmitGeoIsAllowed);

Expand Down
2 changes: 1 addition & 1 deletion extra/modules/ortb2-blocking/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.prebid.server.hooks.modules</groupId>
<artifactId>all-modules</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>ortb2-blocking</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion extra/modules/pb-richmedia-filter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.prebid.server.hooks.modules</groupId>
<artifactId>all-modules</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>pb-richmedia-filter</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Value;

import javax.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotBlank;

@Value(staticConstructor = "of")
public class PbRichMediaFilterProperties {
Expand Down
Loading

0 comments on commit 74320c1

Please sign in to comment.