Skip to content

Commit bdf1b86

Browse files
authored
Merge branch 'longitude' into feat/use-variable-repo
2 parents 69ab336 + bfe5efd commit bdf1b86

File tree

13 files changed

+426
-11
lines changed

13 files changed

+426
-11
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: AWS CDK Deployment
2+
3+
on:
4+
push:
5+
branches: longitude
6+
7+
permissions:
8+
contents: read
9+
10+
concurrency:
11+
group: ci-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
deploy:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Check out code
20+
uses: actions/checkout@v4
21+
22+
- name: Configure AWS credentials
23+
uses: aws-actions/configure-aws-credentials@v4
24+
with:
25+
aws-region: ${{ secrets.AWS_REGION }}
26+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
27+
aws-secret-access-key: ${{ secrets.AWS_ACCESS_SECRET }}
28+
aws-session-token: ${{ secrets.AWS_ACCESS_TOKEN }}
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: "3.13"
34+
35+
- name: Set up Node
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: "20"
39+
40+
- name: Install and configure Poetry
41+
uses: snok/install-poetry@v1
42+
with:
43+
virtualenvs-create: true
44+
virtualenvs-in-project: true
45+
installer-parallel: true
46+
47+
- name: Install Dependencies
48+
working-directory: ./source
49+
run: |
50+
npm install -g aws-cdk
51+
poetry install
52+
53+
- name: Run tests
54+
working-directory: ./deployment
55+
run: bash ./run-unit-tests.sh --in-venv 1
56+
57+
- name: Build
58+
working-directory: ./source
59+
run: |
60+
. $VENV
61+
cd infrastructure
62+
cdk synth
63+
64+
- name: Deploy
65+
working-directory: ./source
66+
67+
run: |
68+
. $VENV
69+
cd infrastructure
70+
cdk deploy --require-approval never

.github/workflows/infra-pr.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: AWS CDK PR
2+
3+
on:
4+
pull_request:
5+
branches: [longitude]
6+
7+
permissions:
8+
contents: read
9+
10+
concurrency:
11+
group: ci-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
pr-test:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Check out code
20+
uses: actions/checkout@v4
21+
22+
- name: Configure AWS credentials
23+
uses: aws-actions/configure-aws-credentials@v4
24+
with:
25+
aws-region: ${{ secrets.AWS_REGION }}
26+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
27+
aws-secret-access-key: ${{ secrets.AWS_ACCESS_SECRET }}
28+
aws-session-token: ${{ secrets.AWS_ACCESS_TOKEN }}
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: "3.13"
34+
35+
- name: Set up Node
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: "20"
39+
40+
- name: Install and configure Poetry
41+
uses: snok/install-poetry@v1
42+
with:
43+
virtualenvs-create: true
44+
virtualenvs-in-project: true
45+
installer-parallel: true
46+
47+
- name: Install Dependencies
48+
working-directory: ./source
49+
run: |
50+
npm install -g aws-cdk
51+
poetry install
52+
53+
- name: Run tests
54+
working-directory: ./deployment
55+
run: bash ./run-unit-tests.sh --in-venv 1
56+
57+
- name: Build
58+
working-directory: ./source
59+
run: |
60+
. $VENV
61+
cd infrastructure
62+
cdk synth
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
# -----------------------------------------------------------------------------
7+
# PURPOSE:
8+
# This entrypoint script is used to start the Prebid Server container.
9+
#
10+
# An environment variable named ECS_CONTAINER_METADATA_URI_V4
11+
# is injected by ECS into each container. The variable contains a URI that
12+
# is used to retrieve container status and data.
13+
#
14+
# See:
15+
# https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-metadata-endpoint-v4.html
16+
#
17+
# The entrypoint defined below retrieves the data and parses the
18+
# container's unique ID from it and uses the ID to ensure
19+
# log data is written to a unique directory under /mnt/efs/.
20+
# The container ID is also included with logs sent directly
21+
# to CloudWatch.
22+
#
23+
# If the environment variable ECS_CONTAINER_METADATA_URI_V4 is not set,
24+
# the string "default-container-id" is returned instead so that the
25+
# container can be run locally.
26+
#
27+
# Metrics are sent to /mnt/efs/metrics folder also using the container ID
28+
# in the path. Files have the name prebid-metrics.log.
29+
#
30+
# The default Java executable entry point specified in this script can be
31+
# customized or replaced with a different command or executable.
32+
# ------------------------------------------------------------------------------
33+
34+
echo "entrypoint.sh starting"
35+
36+
PREBID_CONFIGS_DIR="/prebid-configs"
37+
38+
echo "prebid_configs_dir set"
39+
40+
/usr/bin/java \
41+
-DcontainerId=$(if [ -z "$ECS_CONTAINER_METADATA_URI_V4" ]; then echo "default-container-id"; else curl -s "${ECS_CONTAINER_METADATA_URI_V4}/task" | jq -r '.Containers[0].DockerId' 2>/dev/null | cut -d'-' -f1 || echo "default-container-id"; fi) \
42+
-Dlogging.config=${PREBID_CONFIGS_DIR}/prebid-logging.xml \
43+
-XX:+UseParallelGC \
44+
-jar target/prebid-server.jar \
45+
--spring.config.additional-location=${PREBID_CONFIGS_DIR}/prebid-config.yaml
46+
47+
echo "actual shell script run"
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
# Sets the response for a status check; used for simple health checks.
2+
status-response: "ok"
3+
4+
externalUrl: https://s2s.lngtd.com/
5+
6+
analytics:
7+
log:
8+
enabled: true
9+
10+
adapters:
11+
12+
medianet:
13+
enabled: true
14+
15+
appnexus:
16+
enabled: true
17+
endpoint: https://ib.adnxs.com/openrtb2 # essential to most bidders, need to verify that the endpoint is correct
18+
19+
triplelift:
20+
enabled: true
21+
endpoint: https://tlx.3lift.com/s2s/auction?supplier_id=68
22+
23+
kargo:
24+
enabled: true
25+
26+
conversant:
27+
enabled: true
28+
29+
sharethrough:
30+
enabled: true
31+
32+
generic:
33+
aliases:
34+
nativo:
35+
endpoint: https://exchange.postrelease.com/esi.json?ntv_epid=7
36+
enabled: true
37+
38+
openx:
39+
enabled: true
40+
41+
ix:
42+
enabled: true
43+
endpoint: http://longitude-ads-us-east.lb.indexww.com/pbs?p=192251
44+
45+
epsilon:
46+
enabled: true
47+
48+
rubicon:
49+
enabled: true
50+
endpoint: http://exapi-us-east.rubiconproject.com/a/api/exchange.json?tk_sdc=us-east
51+
usersync:
52+
redirect:
53+
url: https://pixel.rubiconproject.com/exchange/sync.php?p=pbs-longitude&gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&gpp={{gpp}}&gpp_sid={{gpp_sid}
54+
XAPI:
55+
Username: pb_longitude_ads
56+
Password: LK0Y31N2B5
57+
58+
pubmatic:
59+
enabled: true
60+
61+
gumgum:
62+
enabled: true
63+
64+
debug: true # enables logging for debugging requests
65+
66+
price-floors:
67+
# May need this to enforce price flooring on Prebid Server. Does it require an explicit minimum?
68+
enforce-floors: true # Enable floor enforcement globally on the server
69+
enforce-deal-floors: true # Ensure deal bids also respect floors (optional)
70+
# enhance-bid-floors: true # Indicates that there is server-side dynamic flooring in custom logic, which is all handled server-side.
71+
# bid-floor-fallback: 0.63 # Fallback floor if no floor is set in client payload
72+
# floor-minimum: 0.63 # The minimum floor Prebid Server should enforce
73+
74+
metrics:
75+
# Metrics collection configuration.
76+
77+
# Enables logging of metrics to the logging backend specified (e.g., for debugging purposes).
78+
logback:
79+
enabled: true
80+
# Name of the metrics logger, can be customized based on logging system setup.
81+
name: METRICS
82+
# Frequency of logging the metrics in seconds.
83+
interval: 30
84+
85+
cache:
86+
# Cache configuration to store responses for faster retrieval.
87+
88+
# Specifies the caching protocol (typically http or https).
89+
scheme: http
90+
# The host where the cache is stored (use localhost for local setup).
91+
host: localhost # We need a dedicated caching server accessible to all sites
92+
# Path on the server where cache data can be accessed.
93+
path: /cache
94+
# Query parameter used by the cache to retrieve specific cached data.
95+
query: uuid=
96+
97+
settings:
98+
# Settings configuration for Prebid Server behavior.
99+
100+
# Enforces the validation of account IDs. Setting this to false allows requests with non-validated accounts.
101+
enforce-valid-account: false
102+
# Generates a unique ID for bid requests if one is not provided.
103+
generate-storedrequest-bidrequest-id: true
104+
105+
# Configures settings for stored configurations (often useful in testing or non-production setups).
106+
filesystem:
107+
# Path to the primary settings file.
108+
settings-filename: sample/configs/sample-app-settings.yaml
109+
# Directory for stored requests (input from publishers).
110+
stored-requests-dir: sample
111+
# Directory for stored impressions.
112+
stored-imps-dir: sample
113+
# Directory for stored responses.
114+
stored-responses-dir: sample
115+
# Directory for categories used in bid filtering.
116+
categories-dir:
117+
118+
accounts:
119+
# Placeholder account configuration
120+
- id: "bookrags" # Replace with your actual account ID
121+
name: "Bookrags"
122+
# Additional optional fields can be added as needed
123+
# currency: "USD"
124+
# defaultTtl: 3600 # TTL in seconds for bid responses, if required
125+
126+
gdpr:
127+
# GDPR settings for handling user consent and privacy.
128+
129+
# Default GDPR consent value if none is provided (1 = consent, 0 = no consent).
130+
default-value: 0
131+
132+
# Vendor lists for GDPR compliance, organized by TCF versions (2 and 3 in this case).
133+
vendorlist:
134+
v2:
135+
# Directory to store the cached vendor list for TCF version 2.
136+
cache-dir: /var/tmp/vendor2
137+
v3:
138+
# Directory to store the cached vendor list for TCF version 3.
139+
cache-dir: /var/tmp/vendor3
140+
141+
admin-endpoints:
142+
# Administrative endpoints for controlling Prebid Server.
143+
logging-httpinteraction:
144+
enabled: true
145+
path: /logging/httpinteraction
146+
on-application-port: true
147+
protected: false
148+
149+
150+
# Allows changing log levels dynamically.
151+
logging-changelevel:
152+
enabled: true
153+
# Path to access the logging level change endpoint.
154+
path: /logging/changelevel
155+
# Whether this endpoint is accessible on the main application port.
156+
on-application-port: true
157+
# Sets the endpoint as unprotected; consider adding protection in production.
158+
protected: false
159+
160+
# Logging Configuration for Verbose Debugging
161+
logging:
162+
sampling-rate: 0.01
163+
level:
164+
root: ERROR # Set the default log level for all packages
165+
change-level:
166+
max-duration-ms: 3600000 # 1h
167+
output:
168+
stdout: true # Output logs to console
169+
file: /var/log/prebid-server.log # Output logs to file

0 commit comments

Comments
 (0)