Skip to content

Commit 81dcb63

Browse files
ganisbackJamespulltheflower
authored
Merge image namespace to 1.9.2 (#418)
* fix: use opencsghq namespace * Remove unused type parameter for deploy uages * support score model inference for dataflow * support ernie and hunyuan model with cuda 11.8 * Fix test --------- Co-authored-by: James <[email protected]> Co-authored-by: zhzhang <[email protected]>
1 parent e5e4dea commit 81dcb63

25 files changed

+132
-61
lines changed

api/handler/monitor.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,18 +218,13 @@ func getRequestParameters(ctx *gin.Context) (*types.MonitorReq, error) {
218218
if len(instance) < 1 {
219219
return nil, fmt.Errorf("bad request format for instance")
220220
}
221-
deployType := ctx.Param("type")
222-
if len(deployType) < 1 {
223-
return nil, fmt.Errorf("bad request format for type")
224-
}
225221
lastDuration, timeRange := common.GetValidTimeDuration(ctx)
226222
req := &types.MonitorReq{
227223
CurrentUser: currentUser,
228224
Namespace: namespace,
229225
Name: name,
230226
RepoType: repoType,
231227
DeployID: deployID,
232-
DeployType: deployType,
233228
Instance: instance,
234229
LastDuration: lastDuration,
235230
TimeRange: timeRange,

api/handler/monitor_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ func TestMonitorHandler_CPUUsage(t *testing.T) {
5454
Instance: "test-instance",
5555
LastDuration: "30m",
5656
TimeRange: "1m",
57-
DeployType: "inference",
5857
}
5958

6059
tester.mocks.component.EXPECT().CPUUsage(tester.Ctx(), req).Return(&types.MonitorCPUResp{}, nil)
@@ -78,7 +77,6 @@ func TestMonitorHandler_MemoryUsage(t *testing.T) {
7877
Instance: "test-instance",
7978
LastDuration: "30m",
8079
TimeRange: "1m",
81-
DeployType: "inference",
8280
}
8381

8482
tester.mocks.component.EXPECT().MemoryUsage(tester.Ctx(), req).Return(&types.MonitorMemoryResp{}, nil)
@@ -102,7 +100,6 @@ func TestMonitorHandler_RequestCount(t *testing.T) {
102100
Instance: "test-instance",
103101
LastDuration: "30m",
104102
TimeRange: "1m",
105-
DeployType: "inference",
106103
}
107104

108105
tester.mocks.component.EXPECT().RequestCount(tester.Ctx(), req).Return(&types.MonitorRequestCountResp{}, nil)
@@ -125,7 +122,6 @@ func TestMonitorHandler_RequestLatency(t *testing.T) {
125122
Instance: "test-instance",
126123
LastDuration: "30m",
127124
TimeRange: "1m",
128-
DeployType: "inference",
129125
}
130126

131127
tester.mocks.component.EXPECT().RequestLatency(tester.Ctx(), req).Return(&types.MonitorRequestLatencyResp{}, nil)

builder/deploy/scheduler/deploy_runner.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -348,18 +348,19 @@ func (t *DeployRunner) makeDeployEnv(
348348

349349
if deploy.SpaceID > 0 {
350350
// sdk port for space
351-
if t.repo.Sdk == types.GRADIO.Name {
351+
switch t.repo.Sdk {
352+
case types.GRADIO.Name:
352353
envMap["port"] = strconv.Itoa(types.GRADIO.Port)
353-
} else if t.repo.Sdk == types.STREAMLIT.Name {
354+
case types.STREAMLIT.Name:
354355
envMap["port"] = strconv.Itoa(types.STREAMLIT.Port)
355-
} else if t.repo.Sdk == types.NGINX.Name {
356+
case types.NGINX.Name:
356357
envMap["port"] = strconv.Itoa(types.NGINX.Port)
357-
} else if t.repo.Sdk == types.DOCKER.Name {
358+
case types.DOCKER.Name:
358359
envMap["port"] = strconv.Itoa(deploy.ContainerPort)
359360
envMap["HF_ENDPOINT"] = t.deployCfg.ModelDownloadEndpoint
360-
} else if t.repo.Sdk == types.MCPSERVER.Name {
361+
case types.MCPSERVER.Name:
361362
envMap["port"] = strconv.Itoa(types.MCPSERVER.Port)
362-
} else {
363+
default:
363364
envMap["port"] = strconv.Itoa(types.DefaultContainerPort)
364365
}
365366
}
@@ -378,6 +379,8 @@ func (t *DeployRunner) makeDeployEnv(
378379
envMap["HF_TOKEN"] = token.Token
379380
envMap["USE_CSGHUB_MODEL"] = "1"
380381
envMap["USE_CSGHUB_DATASET"] = "1"
382+
envMap["JUPYTER_ENABLE_LAB"] = "yes"
383+
envMap["TERM"] = "xterm-256color"
381384
}
382385

383386
if t.deployCfg.PublicRootDomain == "" {

builder/store/database/cluster.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,16 @@ type ClusterInfo struct {
4747
func (r *clusterInfoStoreImpl) Add(ctx context.Context, clusterConfig string, region string) (*ClusterInfo, error) {
4848
cluster, err := r.ByClusterConfig(ctx, clusterConfig)
4949
if errors.Is(err, sql.ErrNoRows) {
50-
newCluster := &ClusterInfo{
50+
cluster = ClusterInfo{
5151
ClusterID: uuid.New().String(),
5252
ClusterConfig: clusterConfig,
5353
Region: region,
5454
Enable: true,
5555
}
56-
_, err = r.db.Operator.Core.NewInsert().Model(newCluster).Exec(ctx)
56+
_, err = r.db.Operator.Core.NewInsert().Model(&cluster).Exec(ctx)
5757
if err != nil {
5858
return nil, err
5959
}
60-
return newCluster, nil
6160
}
6261
return &cluster, err
6362
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SET statement_timeout = 0;
2+
3+
--bun:split
4+
5+
SELECT 1
6+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SET statement_timeout = 0;
2+
3+
--bun:split
4+
5+
-- migrate all image to opencsghq namespace since csghub 2.0
6+
DELETE FROM runtime_frameworks WHERE frame_image NOT LIKE '%/%';
7+
8+
--bun:split
9+
10+
DELETE FROM runtime_architectures WHERE runtime_framework_id NOT IN (SELECT id FROM runtime_frameworks);

common/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ type Config struct {
143143
Model struct {
144144
DeployTimeoutInMin int `env:"STARHUB_SERVER_MODEL_DEPLOY_TIMEOUT_IN_MINUTES" default:"60"`
145145
DownloadEndpoint string `env:"STARHUB_SERVER_MODEL_DOWNLOAD_ENDPOINT" default:"https://hub.opencsg.com"`
146-
DockerRegBase string `env:"STARHUB_SERVER_MODEL_DOCKER_REG_BASE" default:"opencsg-registry.cn-beijing.cr.aliyuncs.com/public/"`
146+
DockerRegBase string `env:"STARHUB_SERVER_MODEL_DOCKER_REG_BASE" default:"opencsg-registry.cn-beijing.cr.aliyuncs.com"`
147147
NimDockerSecretName string `env:"STARHUB_SERVER_MODEL_NIM_DOCKER_SECRET_NAME" default:"ngc-secret"`
148148
NimNGCSecretName string `env:"STARHUB_SERVER_MODEL_NIM_NGC_SECRET_NAME" default:"nvidia-nim-secrets"`
149149
MinContextForEstimation int `env:"STARHUB_SERVER_MODEL_MIN_CONTEXT_FOR_ESTIMATION" default:"8192"`

configs/evaluation/evalscope.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"engine_images": [
66
{
77
"compute_type": "cpu",
8-
"image": "evalscope:0.15.1-cpu",
8+
"image": "opencsghq/evalscope:0.15.1-cpu",
99
"engine_version": "0.15.1"
1010
},
1111
{
1212
"compute_type": "gpu",
13-
"image": "evalscope:0.15.1-cu120",
13+
"image": "opencsghq/evalscope:0.15.1-cu120",
1414
"driver_version": "12.1",
1515
"engine_version": "0.15.1"
1616
}

configs/evaluation/lm-evaluation-harness.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"engine_images": [
77
{
88
"compute_type": "gpu",
9-
"image": "lm-evaluation-harness:0.4.9",
9+
"image": "opencsghq/lm-evaluation-harness:0.4.9",
1010
"driver_version": "12.1",
1111
"engine_version": "0.4.9"
1212
}

configs/evaluation/opencompass.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"engine_images": [
77
{
88
"compute_type": "gpu",
9-
"image": "opencompass:0.4.2",
9+
"image": "opencsghq/opencompass:0.4.2",
1010
"driver_version": "12.1",
1111
"engine_version": "0.4.2"
1212
}

0 commit comments

Comments
 (0)