cluster

package
v1.832.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Overview

Copyright 2023-2025 Hanzo AI Inc. All Rights Reserved. Portions Copyright 2025 The OpenAgent Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023-2025 Hanzo AI Inc. All Rights Reserved. Portions Copyright 2025 The OpenAgent Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023-2025 Hanzo AI Inc. All Rights Reserved. Portions Copyright 2025 The OpenAgent Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023-2025 Hanzo AI Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023-2025 Hanzo AI Inc. All Rights Reserved. Portions Copyright 2025 The OpenAgent Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023-2025 Hanzo AI Inc. All Rights Reserved. Portions Copyright 2025 The OpenAgent Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023-2025 Hanzo AI Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023-2025 Hanzo AI Inc. All Rights Reserved. Portions Copyright 2025 The OpenAgent Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteTrainJob

func DeleteTrainJob(job *object.FinetuneJob, lang string) error

DeleteTrainJob deletes the TrainJob CR (used for cancel). NotFound is not an error — the desired end state (gone) is already met.

func Deploy

func Deploy(application *object.Application, lang string) (bool, error)

func DeploySync

func DeploySync(application *object.Application, lang string) (bool, error)

func Describe

func Describe(apps []*object.Application, lang string)

func FailureReason

func FailureReason(namespace string, lang string) (string, error)

FailureReason returns the failure reason for an application deployment

func FinetuneNamespace

func FinetuneNamespace(owner string) string

FinetuneNamespace is the per-org namespace TrainJobs (and their HF-token Secret) live in, isolating one tenant's runs from another's.

func Manifest

func Manifest(application *object.Application, lang string) (string, error)

Manifest renders an application's deployment manifest from its template and parameters. Callers set it on the record before saving; nothing here touches a cluster. This is the only kustomize caller in the tree.

func Phase

func Phase(owner, name, namespace string, lang string) (string, error)

Phase returns application status as string

func Status

func Status(lang string) (string, error)

func SubmitTrainJob

func SubmitTrainJob(job *object.FinetuneJob, hp object.Hyperparams, token, lang string) error

SubmitTrainJob provisions the namespace + HF-token Secret and applies the TrainJob CR. token may be "" (public repos only). Returns the namespace + CR name it used (already set on job before the call).

func URL

func URL(namespace string, lang string) (string, error)

URL retrieves the access URL for an application

func Undeploy

func Undeploy(owner, name, namespace string, lang string) (bool, error)

func UndeployFinetune

func UndeployFinetune(job *object.FinetuneJob, lang string) error

UndeployFinetune deletes the InferenceService and the model registration.

func UndeploySync

func UndeploySync(owner, name, namespace string, lang string) (bool, error)

UndeploySync undeploys application and waits for it to be completely removed

func View

func View(namespace string, lang string) (*object.ApplicationView, error)

View retrieves application view from cache with fallback

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

type Serving

type Serving struct {
	ModelId   string `json:"modelId"`   // public model id (use in /v1/chat/completions)
	Provider  string `json:"provider"`  // the registered provider name
	Service   string `json:"service"`   // InferenceService name
	Namespace string `json:"namespace"` // its namespace
	Url       string `json:"url"`       // status.url, when already available
}

Serving is what a deploy returns to the controller.

func DeployFinetune

func DeployFinetune(job *object.FinetuneJob, lang string) (*Serving, error)

DeployFinetune serves a completed job's checkpoints and registers the result as a routable model. Requires a succeeded job with an OutputUri. Idempotent: re-deploying updates the InferenceService + model records in place.

type TrainJob

type TrainJob struct {
	Status   string // pending|queued|running|succeeded|failed|cancelled
	Progress int    // 0..100 (best-effort)
	Message  string
	Started  string // RFC3339, when the run entered Running (best-effort)
	Finished string // RFC3339, when it reached a terminal state (best-effort)
	Found    bool   // false when the CR no longer exists in the cluster
}

TrainJob is the live status read back from a TrainJob CR.

func TrainJobStatus

func TrainJobStatus(job *object.FinetuneJob, lang string) (*TrainJob, error)

TrainJobStatus reads the TrainJob CR and maps its conditions to a object.FinetuneJob status. Found=false (no error) when the CR is gone.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL