-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(anubis-judge0): add nginx lb between anubis and judge0 replicas
- Loading branch information
WarriorsSami
committed
Mar 2, 2024
1 parent
096f6b7
commit 13fbc85
Showing
6 changed files
with
119 additions
and
56 deletions.
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Eval Nginx Load Balancer - Build Docker image and publish to GitHub Packages | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
paths: | ||
- "anubis-eval/eval-lb/**" | ||
- ".github/workflows/eval-lb.yaml" | ||
|
||
pull_request: | ||
branches: | ||
- develop | ||
|
||
paths: | ||
- "anubis-eval/eval-lb/**" | ||
- ".github/workflows/eval-lb.yaml" | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: asgard-eval-lb | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 | ||
with: | ||
context: anubis-eval/eval-lb | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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 |
---|---|---|
|
@@ -6,15 +6,16 @@ ROCKET_DATABASES={anubis-submissions={url="postgres://postgres:2002@anubis-psql- | |
CONFIG_JWT_SECRET_KEY=z7F+ut_aphaxeja0&ba*p9spew!4fe0rAFRO5HestitIKOv5nistlz3b=+edu1aP | ||
CONFIG_DAPR_HTTP_PORT=3503 | ||
CONFIG_DAPR_EVAL_METADATA_ENDPOINT=http://dapr-app-id:[email protected]:3503/api/enki/problem/{problem_id}/eval-metadata | ||
CONFIG_DAPR_JUDGE_ENDPOINT=http://dapr-app-id:[email protected]:3503/submissions/batch | ||
CONFIG_DAPR_GET_SUBMISSION_BATCH_ENDPOINT=http://dapr-app-id:[email protected]:3503/submissions/batch?tokens={tokens} | ||
CONFIG_DAPR_JUDGE_SUBMISSION_BATCH_ENDPOINT=http://judge0-lb:4000/submissions/batch | ||
CONFIG_DAPR_JUDGE_SUBMISSION_ENDPOINT=http://judge0-lb:4000/submissions | ||
CONFIG_DAPR_GET_SUBMISSION_BATCH_ENDPOINT=http://judge0-lb:4000/submissions/batch?tokens={tokens} | ||
CONFIG_DAPR_GET_SUBMISSION_ENDPOINT=http://judge0-lb:4000/submissions/{token} | ||
CONFIG_DAPR_STATE_STORE_POST_ENDPOINT=http://127.0.0.1:3503/v1.0/state/statestore | ||
CONFIG_DAPR_STATE_STORE_GET_ENDPOINT=http://127.0.0.1:3503/v1.0/state/statestore/{key} | ||
CONFIG_EVAL_CRON_SCHEDULE='1/5 * * * * *' | ||
CONFIG_DEFAULT_NO_SUBMISSIONS_PER_PAGE=10 | ||
CONFIG_DEFAULT_CACHE_TTL_SECONDS=120 | ||
CONFIG_EVAL_BATCH_SIZE=4 | ||
CONFIG_ALLOWED_ORIGINS="http://localhost:10000;https://pantheonix.live;https://pantheonix-midgard.web.app;https://pantheonix-midgard.firebaseapp.com" | ||
CONFIG_ALLOWED_ORIGINS="https://localhost:10000;http://localhost:10000;https://pantheonix.live;https://pantheonix-midgard.web.app;https://pantheonix-midgard.firebaseapp.com" | ||
|
||
#DATABASE_URL=postgres://postgres:2002@localhost:5435/anubis-submissions | ||
DATABASE_URL=postgres://postgres:2002@anubis-psql-db:5432/anubis-submissions | ||
|
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,4 @@ | ||
FROM nginx:1.24-alpine | ||
|
||
COPY ./nginx.conf /etc/nginx/nginx.conf | ||
|
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,13 @@ | ||
user nginx; | ||
events { | ||
worker_connections 1000; | ||
} | ||
http { | ||
client_max_body_size 20M; | ||
server { | ||
listen 4000; | ||
location / { | ||
proxy_pass http://server:2358; | ||
} | ||
} | ||
} |
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
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