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

update resource #710

Merged
merged 3 commits into from
Oct 12, 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
1 change: 1 addition & 0 deletions deploy/all_in_one/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion deploy/all_in_one/init-scripts/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
40 changes: 31 additions & 9 deletions deploy/all_in_one/rproxy_nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading