Skip to content

Commit e9795ff

Browse files
Merge pull request #101 from kerthcet/feat/support-llamacpp
Prepare for v0.0.4
2 parents 5efc2b1 + e93689c commit e9795ff

File tree

6 files changed

+10
-6
lines changed

6 files changed

+10
-6
lines changed

docs/installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LWS_VERSION=v0.3.0
1414
kubectl apply --server-side -f https://github.com/kubernetes-sigs/lws/releases/download/$LWS_VERSION/manifests.yaml
1515
1616
# llmaz runs in llmaz-system
17-
LLMAZ_VERSION=v0.0.3
17+
LLMAZ_VERSION=v0.0.4
1818
kubectl apply --server-side -f https://github.com/inftyai/llmaz/releases/download/$LLMAZ_VERSION/manifests.yaml
1919
```
2020

@@ -24,7 +24,7 @@ kubectl apply --server-side -f https://github.com/inftyai/llmaz/releases/downloa
2424
LWS_VERSION=v0.3.0
2525
kubectl delete -f https://github.com/kubernetes-sigs/lws/releases/download/$LWS_VERSION/manifests.yaml
2626
27-
LLMAZ_VERSION=v0.0.3
27+
LLMAZ_VERSION=v0.0.4
2828
kubectl delete -f https://github.com/inftyai/llmaz/releases/download/$LLMAZ_VERSION/manifests.yaml
2929
```
3030

pkg/controller_helper/model_source/modelhub.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (p *ModelHubProvider) InjectModelLoader(template *corev1.PodTemplateSpec) {
129129
Name: MODEL_VOLUME_NAME,
130130
VolumeSource: corev1.VolumeSource{
131131
HostPath: &corev1.HostPathVolumeSource{
132-
Path: HOST_MODEL_PATH,
132+
Path: HOST_CLUSTER_MODEL_PATH,
133133
Type: &hostType,
134134
},
135135
},

pkg/controller_helper/model_source/modelsource.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ import (
2626
const (
2727
// model path
2828
CONTAINER_MODEL_PATH = "/workspace/models/"
29-
HOST_MODEL_PATH = "/cache/models/"
29+
HOST_MODEL_BASE_PATH = "/mnt/models/"
30+
// TODO: we may need /mnt/models/namespace1/ path in the future for isolations.
31+
HOST_CLUSTER_MODEL_PATH = HOST_MODEL_BASE_PATH + "cluster/"
3032

3133
// container & volume configs
3234
DEFAULT_BACKEND_PORT = 8080

pkg/controller_helper/model_source/uri.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (p *URIProvider) InjectModelLoader(template *corev1.PodTemplateSpec) {
127127
Name: MODEL_VOLUME_NAME,
128128
VolumeSource: corev1.VolumeSource{
129129
HostPath: &corev1.HostPathVolumeSource{
130-
Path: HOST_MODEL_PATH,
130+
Path: HOST_CLUSTER_MODEL_PATH,
131131
Type: &hostType,
132132
},
133133
},

pkg/webhook/openmodel_webhook.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ func (w *OpenModelWebhook) ValidateDelete(ctx context.Context, obj runtime.Objec
8585
return nil, nil
8686
}
8787

88+
// TODO: once namespaced models enabled, we should validate that only such volume path
89+
// /mnt/models/<model-namespace>/ is allowed.
8890
func (w *OpenModelWebhook) generateValidate(obj runtime.Object) field.ErrorList {
8991
model := obj.(*coreapi.OpenModel)
9092
dataSourcePath := field.NewPath("spec", "dataSource")

test/util/validation/validate_service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func ValidateModelLoader(model *coreapi.OpenModel, workload *lws.LeaderWorkerSet
133133

134134
for _, v := range service.Spec.WorkloadTemplate.LeaderWorkerTemplate.WorkerTemplate.Spec.Volumes {
135135
if v.Name == modelSource.MODEL_VOLUME_NAME {
136-
if v.HostPath == nil || v.HostPath.Path != modelSource.HOST_MODEL_PATH || *v.HostPath.Type != corev1.HostPathDirectoryOrCreate {
136+
if v.HostPath == nil || v.HostPath.Path != modelSource.HOST_CLUSTER_MODEL_PATH || *v.HostPath.Type != corev1.HostPathDirectoryOrCreate {
137137
return errors.New("when using modelHub modelSource, the hostPath shouldn't be nil")
138138
}
139139
}

0 commit comments

Comments
 (0)