Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docker compose #917

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions compose/local/docker-compose-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ services:
volumes:
- ${TNO_PROJ_DIR:-.}/predict_occultation:/app
- ${TNO_PROJ_DIR:-.}/data/predict_occultations:/app/outputs/predict_occultations
environment:
- PARSL_ENV=local
- PREDICT_OUTPUTS=/app/outputs/predict_occultations
env_file:
- .env

# Servidor Web NGINX
nginx:
Expand All @@ -83,7 +82,15 @@ services:
command: /start_worker.sh
depends_on:
- backend

restart: unless-stopped
deploy:
resources:
limits:
cpus: "2.0"
memory: 200M
reservations:
cpus: "0.5"
memory: 20M
# Copia do serviço backend, mas executando outro comando
celery_beat: &celery_beat
<<: *backend
Expand Down
13 changes: 9 additions & 4 deletions compose/local/env-template
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ DJANGO_UWSGI_WORKER_THREADS=2
# DATABASE used in Django and Predict Occultation container
# -------------------------------------
# Usando Localhost
# DB_ADMIN_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DB}
# DB_CATALOG_URI=postgresql://untrustedprod:untrusted@localhost:3307/prod_gavo
DB_ADMIN_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DB}
DB_CATALOG_URI=postgresql://untrustedprod:untrusted@localhost:3307/prod_gavo
# Usando host.docker.internal
DB_ADMIN_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@host.docker.internal:5432/${POSTGRES_DB}
DB_CATALOG_URI=postgresql://untrustedprod:untrusted@host.docker.internal:3307/prod_gavo
# DB_ADMIN_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@host.docker.internal:5432/${POSTGRES_DB}
# DB_CATALOG_URI=postgresql://untrustedprod:untrusted@host.docker.internal:3307/prod_gavo

# Predict Occultation Pipeline
# -------------------------------------
PARSL_ENV=local
PREDICT_OUTPUTS=/app/outputs/predict_occultations
17 changes: 11 additions & 6 deletions compose/production/docker-compose-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,24 @@ services:
volumes:
- ${TNO_PROJ_DIR:-.}:${TNO_PROJ_DIR:-.}
- ${TNO_SSHKEY}:/home/app.tno/.ssh/id_rsa
environment:
- PARSL_ENV=linea
- REMOTE_PIPELINE_ROOT=${TNO_PROJ_DIR:-.}
- PREDICT_OUTPUTS=${TNO_PROJ_DIR:-.}/data/predict_occultations
- DB_ADMIN_URI=${DB_ADMIN_URI}
- DB_CATALOG_URI=${DB_CATALOG_URI}
env_file:
- .env

# Celery Workers (Tarefas do backend em background)
celery_worker:
<<: *backend
command: /start_worker.sh
depends_on:
- backend
restart: unless-stopped
deploy:
resources:
limits:
cpus: "10.0"
memory: 16G
reservations:
cpus: "15"
memory: 1G

# Celery Beat (Tarefas agendadas do backend)
celery_beat:
Expand Down
8 changes: 8 additions & 0 deletions compose/production/env-template
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,11 @@ DJANGO_UWSGI_WORKER_THREADS=2
# -------------------------------------
DB_ADMIN_URI=postgresql://<DB_USER>:<DB_USER>@desdb4.linea.gov.br:5432/<DB_NAME>
DB_CATALOG_URI=postgresql://<DB_USER>:<DB_USER>@desdb4.linea.gov.br:5432/prod_gavo

# Predict Occultation Pipeline
# -------------------------------------
PARSL_ENV=linea
REMOTE_PIPELINE_ROOT=${TNO_PROJ_DIR:-.}
PREDICT_OUTPUTS=${TNO_PROJ_DIR:-.}/data/predict_occultations
DB_ADMIN_URI=${DB_ADMIN_URI}
DB_CATALOG_URI=${DB_CATALOG_URI}
17 changes: 11 additions & 6 deletions compose/testing/docker-compose-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,24 @@ services:
volumes:
- ${TNO_PROJ_DIR:-.}:${TNO_PROJ_DIR:-.}
- ${TNO_SSHKEY}:/home/app.tno/.ssh/id_rsa
environment:
- PARSL_ENV=linea
- REMOTE_PIPELINE_ROOT=${TNO_PROJ_DIR:-.}
- PREDICT_OUTPUTS=${TNO_PROJ_DIR:-.}/data/predict_occultations
- DB_ADMIN_URI=${DB_ADMIN_URI}
- DB_CATALOG_URI=${DB_CATALOG_URI}
env_file:
- .env

# Celery Workers (Tarefas do backend em background)
celery_worker:
<<: *backend
command: /start_worker.sh
depends_on:
- backend
restart: unless-stopped
deploy:
resources:
limits:
cpus: "2.0"
memory: 200M
reservations:
cpus: "0.5"
memory: 20M

# Celery Beat (Tarefas agendadas do backend)
celery_beat:
Expand Down
8 changes: 8 additions & 0 deletions compose/testing/env-template
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,11 @@ DJANGO_UWSGI_WORKER_THREADS=2
# -------------------------------------
DB_ADMIN_URI=postgresql://<DB_USER>:<DB_USER>@desdb4.linea.gov.br:5432/<DB_NAME>
DB_CATALOG_URI=postgresql://<DB_USER>:<DB_USER>@desdb4.linea.gov.br:5432/prod_gavo

# Predict Occultation Pipeline
# -------------------------------------
PARSL_ENV=linea
REMOTE_PIPELINE_ROOT=${TNO_PROJ_DIR:-.}
PREDICT_OUTPUTS=${TNO_PROJ_DIR:-.}/data/predict_occultations
DB_ADMIN_URI=${DB_ADMIN_URI}
DB_CATALOG_URI=${DB_CATALOG_URI}
Loading