Documentation
¶
Index ¶
- Constants
- func CheckPodRevision(pod *corev1.Pod, revision string) bool
- func ContainerRestarted(pod *corev1.Pod) bool
- func CreateHeadlessService(ctx context.Context, k8sClient kubernetes.Interface, ...) error
- func DeepHashObject(hasher hash.Hash, objectToWrite interface{})
- func ExpectedPodNum(mi *workloadv1alpha1.ModelServing) int
- func GenerateEntryPod(role workloadv1alpha1.Role, mi *workloadv1alpha1.ModelServing, ...) *corev1.Pod
- func GenerateRoleID(roleName string, idx int) string
- func GenerateServingGroupName(miName string, idx int) string
- func GenerateWorkerPod(role workloadv1alpha1.Role, mi *workloadv1alpha1.ModelServing, ...) *corev1.Pod
- func GetModelServingAndGroupByLabel(podLabels map[string]string) (string, string, bool)
- func GetNamespaceName(obj metav1.Object) types.NamespacedName
- func GetParentNameAndOrdinal(groupName string) (string, int)
- func GroupNameIndexFunc(obj interface{}) ([]string, error)
- func IsPodFailed(pod *corev1.Pod) bool
- func IsPodRunningAndReady(pod *corev1.Pod) bool
- func IsPodTerminating(pod *corev1.Pod) bool
- func ParseModelServingFromRequest(r *http.Request) (*admissionv1.AdmissionReview, *workloadv1alpha1.ModelServing, error)
- func PodRevision(pod *corev1.Pod) string
- func PodRoleID(pod *corev1.Pod) string
- func PodRoleName(pod *corev1.Pod) string
- func RemoveRoleReplicasForRevision(mi *workloadv1alpha1.ModelServing) *workloadv1alpha1.ModelServing
- func Revision(obj interface{}) string
- func RoleIDIndexFunc(obj interface{}) ([]string, error)
- func SendAdmissionResponse(w http.ResponseWriter, admissionReview *admissionv1.AdmissionReview) error
- func SetCondition(mi *workloadv1alpha1.ModelServing, ...) bool
Constants ¶
const ( Entry = "true" // condition status of ModelServingStatus AllGroupsIsReady = "All Serving groups are ready" SomeGroupsAreProgressing = "Some groups is progressing" SomeGroupsAreUpdated = "Updated Groups are" )
Variables ¶
This section is empty.
Functions ¶
func CheckPodRevision ¶
CheckPodRevision determine if the pod's revision is compliant or not.
func ContainerRestarted ¶
ContainerRestarted return true when there is any container in the pod that gets restarted
func CreateHeadlessService ¶
func CreateHeadlessService(ctx context.Context, k8sClient kubernetes.Interface, mi *workloadv1alpha1.ModelServing, serviceSelector map[string]string, groupName, roleLabel string, roleIndex int) error
func DeepHashObject ¶
DeepHashObject writes specified object to hash using the spew library which follows pointers and prints actual values of the nested objects ensuring the hash does not change when a pointer changes.
func ExpectedPodNum ¶
func ExpectedPodNum(mi *workloadv1alpha1.ModelServing) int
func GenerateEntryPod ¶
func GenerateEntryPod(role workloadv1alpha1.Role, mi *workloadv1alpha1.ModelServing, groupName string, roleIndex int, revision string) *corev1.Pod
func GenerateRoleID ¶
func GenerateWorkerPod ¶
func GenerateWorkerPod(role workloadv1alpha1.Role, mi *workloadv1alpha1.ModelServing, entryPod *corev1.Pod, groupName string, roleIndex, podIndex int, revision string) *corev1.Pod
func GetNamespaceName ¶
func GetNamespaceName(obj metav1.Object) types.NamespacedName
func GetParentNameAndOrdinal ¶
GetParentNameAndOrdinal gets the name of ServingGroup's parent modelServing and ServingGroup's ordinal as extracted from its Name. For example, the Servinggroup name is vllm-sample-0, this function can be used to obtain the modelServing name corresponding to the ServingGroup, which is vllm-sample and the serial number is 0.
func GroupNameIndexFunc ¶
func IsPodFailed ¶
IsPodFailed returns true if pod has a Phase of PodFailed.
func IsPodRunningAndReady ¶
IsPodRunningAndReady returns true if pod is in the PodRunning Phase, if it has a condition of PodReady.
func IsPodTerminating ¶
IsPodTerminating returns true if pod's DeletionTimestamp has been set
func ParseModelServingFromRequest ¶
func ParseModelServingFromRequest(r *http.Request) (*admissionv1.AdmissionReview, *workloadv1alpha1.ModelServing, error)
ParseAdmissionRequest parses the HTTP request and extracts the AdmissionReview and ModelServing.
func PodRevision ¶
PodRevision returns the revision label of the pod.
func PodRoleName ¶
PodRoleName returns the role name of the pod.
func RemoveRoleReplicasForRevision ¶
func RemoveRoleReplicasForRevision(mi *workloadv1alpha1.ModelServing) *workloadv1alpha1.ModelServing
RemoveRoleReplicasForRevision remove role.replicas when calculating modelServing revision hash
func Revision ¶
func Revision(obj interface{}) string
Revision calculates the revision of an object using FNV hashing.
func RoleIDIndexFunc ¶
func SendAdmissionResponse ¶
func SendAdmissionResponse(w http.ResponseWriter, admissionReview *admissionv1.AdmissionReview) error
SendAdmissionResponse sends the AdmissionReview response back to the client
func SetCondition ¶
func SetCondition(mi *workloadv1alpha1.ModelServing, progressingGroups, updatedGroups, currentGroups []int) bool
Types ¶
This section is empty.