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 2 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
2 changes: 2 additions & 0 deletions deploy/all_in_one/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
## csghub service's domain name, can be ip or domain name
SERVER_DOMAIN=
SERVER_PORT=80
## model download use internal domain address, if empty, will use public SERVER_DOMAIN instead
SERVER_INTERNAL_DOMAIN=


## Casdoor Configuration
Expand Down
2 changes: 1 addition & 1 deletion deploy/all_in_one/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ services:
STARHUB_SERVER_API_TOKEN: ${HUB_SERVER_API_TOKEN}
STARHUB_SERVER_S3_ACCESS_KEY_ID: admin
STARHUB_SERVER_S3_ACCESS_KEY_SECRET: Password_123
STARHUB_SERVER_S3_ENDPOINT: ${SERVER_DOMAIN}:9000 # used to generate download links for lfs files
STARHUB_SERVER_S3_ENDPOINT: ${SERVER_INTERNAL_DOMAIN:-${SERVER_DOMAIN}}:9000 # used to generate download links for lfs files
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用这个内部域名生成的下载链接,给到portal后,用户可以下载下来吗?用户客户端得解析出来这个内部域名

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“csghub_server”服务中的STARHUB_SERVER_S3_ENDPOINT环境变量会用于组装lfs下载地址,返回给portal,让用户下载,必须得是个公共可访问的url,只能用SERVER_DOMAIN吧? 新增加的SERVER_INTERNAL_DOMAIN是个内部域名(或者内网ip),用在“mirror-lfs-sync”服务的STARHUB_SERVER_S3_ENDPOINT环境变量比较合适,用于多源同步时候往当前csghub的s3写入信息,内部域名效率高。 @pulltheflower @ganisback

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this solution, still use public domain to download model

STARHUB_SERVER_S3_BUCKET: opencsg-server-lfs
STARHUB_SERVER_S3_REGION: cn-beijing
STARHUB_SERVER_SPACE_BUILDER_ENDPOINT: http://space_builder:8080
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