diff --git a/deploy/all_in_one/docker-compose.yml b/deploy/all_in_one/docker-compose.yml index 8c9c88589..9082f58f5 100644 --- a/deploy/all_in_one/docker-compose.yml +++ b/deploy/all_in_one/docker-compose.yml @@ -169,6 +169,7 @@ services: image: opencsg-registry.cn-beijing.cr.aliyuncs.com/opencsg_public/csghub_server:latest depends_on: - postgres + - csghub_server entrypoint: - /starhub-bin/starhub - deploy diff --git a/deploy/all_in_one/init-scripts/init.sql b/deploy/all_in_one/init-scripts/init.sql index 727bf2cb4..3ec28cdc7 100644 --- a/deploy/all_in_one/init-scripts/init.sql +++ b/deploy/all_in_one/init-scripts/init.sql @@ -45,7 +45,15 @@ ON CONFLICT (name) INSERT INTO space_resources (name, resources, cluster_id) VALUES - ('NVIDIA A10G · 2 · 4 vCPU · 16 GB', '{"gpu": { "type": "A10", "num": "2", "resource_name": "nvidia.com/gpu", "labels": { "aliyun.accelerator/nvidia_name": "NVIDIA-A10" } }, "cpu": { "type": "Intel", "num": "4" }, "memory": "16Gi" }', (SELECT cluster_id FROM cluster_infos LIMIT 1)) + ('NVIDIA A10G · 12 vCPU · 32 GB', '{"gpu": { "type": "A10", "num": "1", "resource_name": "nvidia.com/gpu", "labels": { "aliyun.accelerator/nvidia_name": "NVIDIA-A10" } }, "cpu": { "type": "Intel", "num": "12" }, "memory": "48Gi" }', (SELECT cluster_id FROM cluster_infos LIMIT 1)) +ON CONFLICT (name) + DO UPDATE SET + resources = EXCLUDED.resources, + cluster_id = EXCLUDED.cluster_id; + +INSERT INTO space_resources (name, resources, cluster_id) +VALUES + ('NVIDIA A10G · 2 · 12 vCPU · 48 GB', '{"gpu": { "type": "A10", "num": "2", "resource_name": "nvidia.com/gpu", "labels": { "aliyun.accelerator/nvidia_name": "NVIDIA-A10" } }, "cpu": { "type": "Intel", "num": "12" }, "memory": "48Gi" }', (SELECT cluster_id FROM cluster_infos LIMIT 1)) ON CONFLICT (name) DO UPDATE SET resources = EXCLUDED.resources, diff --git a/deploy/all_in_one/rproxy_nginx/nginx.conf b/deploy/all_in_one/rproxy_nginx/nginx.conf index b3f14dbee..49733fcd1 100644 --- a/deploy/all_in_one/rproxy_nginx/nginx.conf +++ b/deploy/all_in_one/rproxy_nginx/nginx.conf @@ -84,15 +84,37 @@ http { listen 80; server_name *.space.app.internal; location / { - proxy_http_version 1.1; - proxy_pass http://_CSGHUB_KNATIVE_GATEWAY_HOST:_CSGHUB_KNATIVE_GATEWAY_PORT; - proxy_set_header Host $host; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $connection_upgrade; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $http_host; - proxy_set_header X-Forwarded-Proto $scheme; + proxy_http_version 1.1; + proxy_pass http://_CSGHUB_KNATIVE_GATEWAY_HOST:_CSGHUB_KNATIVE_GATEWAY_PORT; + proxy_set_header Host $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $http_host; + proxy_set_header X-Forwarded-Proto $scheme; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + } + + # default case for knative + server { + listen 80; + server_name *.space.example.com; + location / { + proxy_http_version 1.1; + proxy_pass http://_CSGHUB_KNATIVE_GATEWAY_HOST:_CSGHUB_KNATIVE_GATEWAY_PORT; + proxy_set_header Host $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $http_host; + proxy_set_header X-Forwarded-Proto $scheme; } error_page 500 502 503 504 /50x.html;