Skip to content
6 changes: 3 additions & 3 deletions Dockerfile.lmes-job
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ RUN mkdir -p /opt/app-root/src/my_catalogs/cards && chmod -R g+rwx /opt/app-root
RUN mkdir -p /opt/app-root/src/.cache
ENV PATH="/opt/app-root/bin:/opt/app-root/src/.local/bin/:/opt/app-root/src/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

RUN curl -L https://github.com/opendatahub-io/lm-evaluation-harness/archive/refs/heads/incubation.zip -o repo.zip && \
RUN curl -L https://github.com/tarilabs/lm-evaluation-harness/archive/refs/heads/tarilabs-20250917.zip -o repo.zip && \
unzip repo.zip && \
cp -r lm-evaluation-harness-incubation/* . && \
rm -rf lm-evaluation-harness-incubation repo.zip && \
cp -r lm-evaluation-harness-tarilabs-20250917/* . && \
rm -rf lm-evaluation-harness-tarilabs-20250917 repo.zip && \
pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir -e .

Expand Down
58 changes: 58 additions & 0 deletions api/lmes/v1alpha1/lmevaljob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,9 @@ type Outputs struct {
// Create an operator managed PVC
// +optional
PersistentVolumeClaimManaged *PersistentVolumeClaimManaged `json:"pvcManaged,omitempty"`
// Upload results to OCI registry
// +optional
OCISpec *OCISpec `json:"oci,omitempty"`
}

func (c *LMEvalContainer) GetSecurityContext() *corev1.SecurityContext {
Expand Down Expand Up @@ -463,6 +466,40 @@ type OfflineS3Spec struct {
CABundle *corev1.SecretKeySelector `json:"caBundle,omitempty"`
}

type OCISpec struct {
// Registry URL (e.g., quay.io, registry.redhat.com)
Registry corev1.SecretKeySelector `json:"registry"`
// Repository path (e.g., myorg/evaluation-results)
Repository corev1.SecretKeySelector `json:"repository"`
// Optional tag for the artifact (defaults to job name if not specified)
// +optional
// +kubebuilder:validation:Pattern=`^[a-zA-Z0-9._-]*$`
Tag string `json:"tag,omitempty"`
// Path within the results to package as artifact
// +kubebuilder:validation:Pattern=`^[a-zA-Z0-9._/-]*$`
Path string `json:"path"`
// Subject for the OCI artifact
// +optional
// +kubebuilder:validation:Pattern=`^[a-zA-Z0-9._:/@-]*$`
// +kubebuilder:validation:MaxLength=255
Subject string `json:"subject,omitempty"`
// Username for registry authentication
// +optional
UsernameRef *corev1.SecretKeySelector `json:"username,omitempty"`
// Password for registry authentication
// +optional
PasswordRef *corev1.SecretKeySelector `json:"password,omitempty"`
// Token for registry authentication (alternative to username/password)
// +optional
TokenRef *corev1.SecretKeySelector `json:"token,omitempty"`
// Whether to verify SSL certificates
// +optional
VerifySSL *bool `json:"verifySSL,omitempty"`
// CA bundle for custom certificates
// +optional
CABundle *corev1.SecretKeySelector `json:"caBundle,omitempty"`
}

// OfflineStorageSpec defines the storage configuration for LMEvalJob's offline mode
type OfflineStorageSpec struct {
PersistentVolumeClaimName *string `json:"pvcName,omitempty"`
Expand Down Expand Up @@ -585,10 +622,26 @@ func (s *LMEvalJobSpec) HasOfflineS3() bool {
return s.Offline != nil && s.Offline.StorageSpec.S3Spec != nil
}

func (s *LMEvalJobSpec) HasOCIOutput() bool {
return s.Outputs != nil && s.Outputs.OCISpec != nil
}

func (s *OfflineS3Spec) HasCertificates() bool {
return s.CABundle != nil
}

func (s *OCISpec) HasCertificates() bool {
return s.CABundle != nil
}

func (s *OCISpec) HasUsernamePassword() bool {
return s.UsernameRef != nil && s.PasswordRef != nil
}

func (s *OCISpec) HasToken() bool {
return s.TokenRef != nil
}

// HasCustomOutput returns whether an LMEvalJobSpec defines custom outputs or not
func (s *LMEvalJobSpec) HasCustomOutput() bool {
return s.Outputs != nil
Expand All @@ -604,6 +657,11 @@ func (o *Outputs) HasExistingPVC() bool {
return o.PersistentVolumeClaimName != nil
}

// HasOCI returns whether the outputs define OCI upload
func (o *Outputs) HasOCI() bool {
return o != nil && o.OCISpec != nil
}

// LMEvalJobStatus defines the observed state of LMEvalJob
type LMEvalJobStatus struct {
// Important: Run "make" to regenerate code after modifying this file
Expand Down
47 changes: 47 additions & 0 deletions api/lmes/v1alpha1/zz_generated.deepcopy.go

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

2 changes: 2 additions & 0 deletions cmd/lmes_driver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ var (
detectDevice = flag.Bool("detect-device", false, "detect available device(s), CUDA or CPU")
commPort = flag.Int("listen-port", driver.DefaultPort, "driver serves APIs on the port")
downloadAssetsS3 = flag.Bool("download-assets-s3", false, "Download assets from S3")
uploadToOCI = flag.Bool("upload-to-oci", false, "Upload results to OCI registry")
customTaskGitURL = flag.String("custom-task-git-url", "", "Git repository URL for custom tasks")
customTaskGitBranch = flag.String("custom-task-git-branch", "", "Git repository branch for custom tasks")
customTaskGitCommit = flag.String("custom-task-git-commit", "", "Git commit for custom tasks")
Expand Down Expand Up @@ -129,6 +130,7 @@ func main() {
Args: args,
CommPort: *commPort,
DownloadAssetsS3: *downloadAssetsS3,
UploadToOCI: *uploadToOCI,
CustomTaskGitURL: *customTaskGitURL,
CustomTaskGitBranch: *customTaskGitBranch,
CustomTaskGitCommit: *customTaskGitCommit,
Expand Down
2 changes: 1 addition & 1 deletion config/base/params.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ trustyaiOperatorImage=quay.io/trustyai/trustyai-service-operator:latest
oauthProxyImage=quay.io/openshift/origin-oauth-proxy:4.14.0
kServeServerless=enabled
lmes-driver-image=quay.io/trustyai/ta-lmes-driver:latest
lmes-pod-image=quay.io/trustyai/ta-lmes-job:latest
lmes-pod-image=quay.io/mmortari/lm-evaluation-harness/job:latest
lmes-pod-checking-interval=10s
lmes-image-pull-policy=Always
lmes-max-batch-size=24
Expand Down
145 changes: 145 additions & 0 deletions config/crd/bases/trustyai.opendatahub.io_lmevaljobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,151 @@ spec:
outputs:
description: Outputs specifies storage for evaluation results
properties:
oci:
description: Upload results to OCI registry
properties:
caBundle:
description: CA bundle for custom certificates
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
optional:
description: Specify whether the Secret or its key must
be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
password:
description: Password for registry authentication
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
optional:
description: Specify whether the Secret or its key must
be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
path:
description: Path within the results to package as artifact
pattern: ^[a-zA-Z0-9._/-]*$
type: string
registry:
description: Registry URL (e.g., quay.io, registry.redhat.com)
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
optional:
description: Specify whether the Secret or its key must
be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
repository:
description: Repository path (e.g., myorg/evaluation-results)
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
optional:
description: Specify whether the Secret or its key must
be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
subject:
description: Subject for the OCI artifact
pattern: ^[a-zA-Z0-9._:/@-]*$
type: string
tag:
description: Optional tag for the artifact (defaults to job
name if not specified)
pattern: ^[a-zA-Z0-9._-]*$
type: string
token:
description: Token for registry authentication (alternative
to username/password)
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
optional:
description: Specify whether the Secret or its key must
be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
username:
description: Username for registry authentication
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
optional:
description: Specify whether the Secret or its key must
be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
verifySSL:
description: Whether to verify SSL certificates
type: boolean
required:
- path
- registry
- repository
type: object
pvcManaged:
description: Create an operator managed PVC
properties:
Expand Down
2 changes: 1 addition & 1 deletion config/overlays/odh/params.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ trustyaiOperatorImage=quay.io/opendatahub/trustyai-service-operator:latest
oauthProxyImage=quay.io/openshift/origin-oauth-proxy:4.14.0
kServeServerless=enabled
lmes-driver-image=quay.io/opendatahub/ta-lmes-driver:latest
lmes-pod-image=quay.io/opendatahub/ta-lmes-job:latest
lmes-pod-image=quay.io/mmortari/lm-evaluation-harness/job:latest
lmes-pod-checking-interval=10s
lmes-image-pull-policy=Always
lmes-max-batch-size=24
Expand Down
2 changes: 1 addition & 1 deletion controllers/dsc/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (r *DSCConfigReader) ReadDSCConfig(ctx context.Context, log *logr.Logger) (
if errors.IsNotFound(err) {
log.V(1).Info("DSC ConfigMap not found, using default configuration",
"configmap", configMapKey)
return &DSCConfig{}, nil
return nil, nil
}
return nil, fmt.Errorf("error reading DSC ConfigMap %s: %w", configMapKey, err)
}
Expand Down
Loading
Loading