Skip to content

Commit

Permalink
update resource (#710)
Browse files Browse the repository at this point in the history
* update resource

* support donwload model with internal domain

* update
  • Loading branch information
ganisback authored Oct 12, 2024
1 parent 5e5ed32 commit 0b5a91b
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
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

0 comments on commit 0b5a91b

Please sign in to comment.