Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into rhoai-2.16
Browse files Browse the repository at this point in the history
  • Loading branch information
dchourasia committed Nov 6, 2024
2 parents 6eb2138 + 40be6d2 commit 82c2e59
Show file tree
Hide file tree
Showing 16 changed files with 2,801 additions and 229 deletions.
71 changes: 57 additions & 14 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,62 @@
"automergeType": "pr",
"automerge": true,
"enabledManagers": ["dockerfile", "tekton"],
"packageRules": [
{
"matchUpdateTypes": ["*"],
"enabled": false
},
{
"matchUpdateTypes": ["digest"],
"enabled": true
},
{
"matchFileNames": ["*Dockerfile.konflux*", ".tekton/**"],
"enabled": true
}
],
"dockerfile": {
"enabled": true,
"additionalBranchPrefix": "{{baseBranch}}/",
"branchPrefix": "konflux/mintmaker/",
"packageRules": [
{
"matchUpdateTypes": ["*"],
"enabled": false
},
{
"matchUpdateTypes": ["digest"],
"enabled": true
},
{
"matchFileNames": ["*Dockerfile.konflux*"],
"enabled": true
}
]
},
"tekton": {
"fileMatch": [
"\\.yaml$",
"\\.yml$"
],
"includePaths": [
".tekton/**"
],
"packageRules": [
{
"matchPackagePatterns": [
"^quay.io/redhat-appstudio-tekton-catalog/",
"^quay.io/konflux-ci/tekton-catalog/"
],
"enabled": true,
"groupName": "Konflux references",
"branchPrefix": "konflux/references/",
"group": {
"branchTopic": "{{{baseBranch}}}",
"commitMessageTopic": "{{{groupName}}}"
},
"commitMessageTopic": "Konflux references",
"semanticCommits": "enabled",
"prFooter": "To execute skipped test pipelines write comment `/ok-to-test`",
"prBodyColumns": [
"Package",
"Change",
"Notes"
],
"prBodyDefinitions": {
"Notes": "{{#if (or (containsString updateType 'minor') (containsString updateType 'major'))}}:warning:[migration](https://github.com/redhat-appstudio/build-definitions/blob/main/task/{{{replace '^quay.io/(redhat-appstudio-tekton-catalog|konflux-ci/tekton-catalog)/task-' '' packageName}}}/{{{newVersion}}}/MIGRATION.md):warning:{{/if}}"
},
"prBodyTemplate": "{{{header}}}{{{table}}}{{{notes}}}{{{changelogs}}}{{{controls}}}{{{footer}}}",
"recreateWhen": "always",
"rebaseWhen": "behind-base-branch"
}
]
},
"prHourlyLimit": 0
}
2 changes: 1 addition & 1 deletion Dockerfile.lmes-job
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ENV PATH="/opt/app-root/bin:/opt/app-root/src/.local/bin/:/opt/app-root/src/bin:

# Clone the Git repository, check out v0.4.4 and install the Python package
RUN git clone https://github.com/opendatahub-io/lm-evaluation-harness.git && \
cd lm-evaluation-harness && git checkout 543617fef9ba885e87f8db8930fbbff1d4e2ca49 && \
cd lm-evaluation-harness && git checkout release-0.4.5 && \
pip install --no-cache-dir --user -e .[api]

RUN python -c 'from lm_eval.tasks.unitxt import task; import os.path; print("class: !function " + task.__file__.replace("task.py", "task.Unitxt"))' > ./my_tasks/unitxt
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[![Controller Tests](https://github.com/trustyai-explainability/trustyai-service-operator/actions/workflows/controller-tests.yaml/badge.svg)](https://github.com/trustyai-explainability/trustyai-service-operator/actions/workflows/controller-tests.yaml)[![YAML lint](https://github.com/trustyai-explainability/trustyai-service-operator/actions/workflows/lint-yaml.yaml/badge.svg)](https://github.com/trustyai-explainability/trustyai-service-operator/actions/workflows/lint-yaml.yaml)
# TrustyAI Kubernetes Operator
[![Controller Tests](https://github.com/trustyai-explainability/trustyai-service-operator/actions/workflows/controller-tests.yaml/badge.svg)](https://github.com/trustyai-explainability/trustyai-service-operator/actions/workflows/controller-tests.yaml)
[![YAML lint](https://github.com/trustyai-explainability/trustyai-service-operator/actions/workflows/lint-yaml.yaml/badge.svg)](https://github.com/trustyai-explainability/trustyai-service-operator/actions/workflows/lint-yaml.yaml)
[![Go Report Card](https://goreportcard.com/badge/github.com/trustyai-explainability/trustyai-service-operator)](https://goreportcard.com/report/github.com/trustyai-explainability/trustyai-service-operator)


## Overview

Expand Down
83 changes: 82 additions & 1 deletion api/lmes/v1alpha1/lmevaljob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ type LMEvalContainer struct {
// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
// +optional
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
// SecurityContext defines the security options the container should be run with.
// If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
// More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
// +optional
SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"`
}

// The following Getter-ish functions avoid nil pointer panic
Expand All @@ -170,6 +175,26 @@ func (c *LMEvalContainer) GetResources() *corev1.ResourceRequirements {
return c.Resources
}

type PersistentVolumeClaimManaged struct {
Size string `json:"size,omitempty"`
}

type Outputs struct {
// Use an existing PVC to store the outputs
// +optional
PersistentVolumeClaimName *string `json:"pvcName,omitempty"`
// Create an operator managed PVC
// +optional
PersistentVolumeClaimManaged *PersistentVolumeClaimManaged `json:"pvcManaged,omitempty"`
}

func (c *LMEvalContainer) GetSecurityContext() *corev1.SecurityContext {
if c == nil {
return nil
}
return c.SecurityContext
}

type LMEvalPodSpec struct {
// Extra container data for the lm-eval container
// +optional
Expand All @@ -181,6 +206,13 @@ type LMEvalPodSpec struct {
// FIXME: aggregate the sidecar containers into the pod
// +optional
SideCars []corev1.Container `json:"sideCars,omitempty"`
// If specified, the pod's scheduling constraints
// +optional
Affinity *corev1.Affinity `json:"affinity,omitempty"`
// SecurityContext holds pod-level security attributes and common container settings.
// Optional: Defaults to empty. See type description for default values of each field.
// +optional
SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
}

// The following Getter-ish functions avoid nil pointer panic
Expand All @@ -205,6 +237,30 @@ func (p *LMEvalPodSpec) GetSideCards() []corev1.Container {
return p.SideCars
}

// OfflineStorageSpec defines the storage configuration for LMEvalJob's offline mode
type OfflineStorageSpec struct {
PersistentVolumeClaimName string `json:"pvcName"`
}

// OfflineSpec defined the configuration for LMEvalJob's offline mode
type OfflineSpec struct {
StorageSpec OfflineStorageSpec `json:"storage"`
}

func (p *LMEvalPodSpec) GetAffinity() *corev1.Affinity {
if p == nil {
return nil
}
return p.Affinity
}

func (p *LMEvalPodSpec) GetSecurityContext() *corev1.PodSecurityContext {
if p == nil {
return nil
}
return p.SecurityContext
}

// LMEvalJobSpec defines the desired state of LMEvalJob
type LMEvalJobSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
Expand Down Expand Up @@ -234,13 +290,38 @@ type LMEvalJobSpec struct {
LogSamples *bool `json:"logSamples,omitempty"`
// Batch size for the evaluation. This is used by the models that run and are loaded
// locally and not apply for the commercial APIs.
BatchSize *int `json:"batchSize,omitempty"`
BatchSize *string `json:"batchSize,omitempty"`
// Specify extra information for the lm-eval job's pod
// +optional
Pod *LMEvalPodSpec `json:"pod,omitempty"`
// Suspend keeps the job but without pods. This is intended to be used by the Kueue integration
// +optional
Suspend bool `json:"suspend,omitempty"`
// Outputs specifies storage for evaluation results
// +optional
Outputs *Outputs `json:"outputs,omitempty"`
// Offline specifies settings for running LMEvalJobs in a offline mode
Offline *OfflineSpec `json:"offline,omitempty"`
}

// IsOffline returns whether this LMEvalJob is configured to run offline
func (s *LMEvalJobSpec) IsOffline() bool {
return s.Offline != nil
}

// HasCustomOutput returns whether an LMEvalJobSpec defines custom outputs or not
func (s *LMEvalJobSpec) HasCustomOutput() bool {
return s.Outputs != nil
}

// HasManagedPVC returns whether the outputs define a managed PVC
func (o *Outputs) HasManagedPVC() bool {
return o.PersistentVolumeClaimManaged != nil
}

// HasExistingPVC returns whether the outputs define an existing PVC
func (o *Outputs) HasExistingPVC() bool {
return o.PersistentVolumeClaimName != nil
}

// LMEvalJobStatus defines the observed state of LMEvalJob
Expand Down
98 changes: 97 additions & 1 deletion api/lmes/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 82c2e59

Please sign in to comment.