-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for clickhouse proxy inside of reverse-proxy config
- Loading branch information
Showing
4 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
FROM nginx:1.27.1 | ||
ENV TARGET_URL="https://backend-hel.ooni.org" | ||
ENV CLICKHOUSE_STREAM_TARGET="clickhouse1.prod.ooni.io:9000" | ||
|
||
COPY default.conf.template /etc/nginx/templates/ | ||
COPY templates/backend-proxy.conf.template /etc/nginx/templates/ | ||
COPY templates/clickhouse-proxy.conf.stream-template /etc/nginx/templates/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: 0.2 | ||
env: | ||
variables: | ||
OONI_CODE_PATH: ooniapi/services/reverseproxy | ||
DOCKERHUB_SECRET_ID: oonidevops/dockerhub/access_token | ||
|
||
phases: | ||
install: | ||
runtime-versions: | ||
python: 3.11 | ||
|
||
pre_build: | ||
commands: | ||
- echo "Logging in to dockerhub" | ||
- DOCKER_SECRET=$(aws secretsmanager get-secret-value --secret-id $DOCKERHUB_SECRET_ID --query SecretString --output text) | ||
- echo $DOCKER_SECRET | docker login --username ooni --password-stdin | ||
|
||
build: | ||
commands: | ||
- export GIT_FULL_SHA=${CODEBUILD_RESOLVED_SOURCE_VERSION} | ||
- cd $OONI_CODE_PATH | ||
- make docker-build | ||
- make docker-smoketest | ||
- make docker-push | ||
- make imagedefinitions.json | ||
- cat imagedefinitions.json | tee ${CODEBUILD_SRC_DIR}/imagedefinitions.json | ||
|
||
artifacts: | ||
files: imagedefinitions.json |
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
ooniapi/services/reverseproxy/templates/clickhouse-proxy.conf.stream-template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
upstream clickhouse_backend { | ||
server ${CLICKHOUSE_STREAM_TARGET}; | ||
} | ||
|
||
server { | ||
listen 9000; | ||
proxy_pass clickhouse_backend; | ||
} |