Merge branch 'atlantis' into 'master'

Merge Atlantis

See merge request htwkmooc/codeocean!1
This commit is contained in:
Christoph Walther
2024-09-20 08:07:01 +00:00
5 changed files with 24 additions and 16 deletions

View File

@ -37,6 +37,7 @@ default: &default
runner_management:
# When enabled, CodeOcean delegates the handling and management of (containerized) runners
# to a dedicated runner management. Otherwise, code executions are performed locally using
#<% if ENV['POSEIDON_HOST'] != '' -%>
# Docker and without pre-warming support (one container per execution).
enabled: true
# The strategy to use. Possible values are: poseidon, docker_container_pool
@ -44,7 +45,13 @@ default: &default
# The root URL of the runner management to use (include any API prefix if required)
# If a hostname is specified and the target host is reachable via IPv6, the WebSocket
# connection might not use the IPv6-to-IPv4 fallback but rather fail unexpectedly.
url: http://127.0.0.1:7200/api/v1
url: http://poseidon:7200/api/v1
#url: http://<%= ENV['POSEIDON_HOST'] %>/api/v1
#<% else %>
#enabled: false
#strategy: poseidon
#url: http://poseidon.example.org/
#<% end -%>
# The root certificate authority to trust for TLS connections to the runner management (Poseidon only)
# ca_file: /example/certificates/ca.crt
# The authorization token for connections to the runner management (Poseidon only)

View File

@ -3,7 +3,7 @@ default: &default
pool: 16
username: <%= ENV['POSTGRES_USER'] %>
password: <%= ENV['POSTGRES_PASSWORD'] %>
host: db
host: codeocean-db
development:
<<: *default

View File

@ -1,5 +1,5 @@
services:
db:
codeocean-db:
image: postgres:16
volumes:
- db_data:/var/lib/postgresql/data
@ -8,7 +8,7 @@ services:
POSTGRES_PASSWORD: secure_password
POSTGRES_DB: codeocean_production
app:
codeocean:
build:
context: .
dockerfile: Dockerfile
@ -18,7 +18,7 @@ services:
ports:
- "7123:7000"
depends_on:
- db
- codeocean-db
- prometheus
environment:
POSTGRES_USER: codeocean_user
@ -45,18 +45,9 @@ services:
- ./nginx/certs:/etc/nginx/certs
ports:
- "443:443"
depends_on:
- app
- "80:80"
restart: always
poseidon:
ports:
- "7200:7200"
network_mode: host
volumes:
- ./configuration.yaml:/go/src/app/configuration.yaml
restart: unless-stopped
volumes:
db_data:
config:

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'resolv-replace'
class Runner::Strategy::Poseidon < Runner::Strategy
ERRORS = %w[NOMAD_UNREACHABLE NOMAD_OVERLOAD NOMAD_INTERNAL_SERVER_ERROR UNKNOWN].freeze

View File

@ -6,10 +6,19 @@ server {
ssl_certificate_key /etc/nginx/certs/codeocean.key;
location / {
proxy_pass http://app:7000; # Ersetzen Sie 'frontend' durch den Namen Ihres Frontend-Services und '80' durch den Port, auf dem Ihr Frontend läuft
proxy_pass http://codeocean:7000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://codeocean:7000;
}
}