mirror of
https://github.com/hanzo-ml/kserve.git
synced 2026-10-30 20:53:49 +00:00
Signed-off-by: Andres Llausas <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]>
55 lines
1.7 KiB
YAML
55 lines
1.7 KiB
YAML
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: s3-init
|
|
spec:
|
|
activeDeadlineSeconds: 300
|
|
template:
|
|
spec:
|
|
initContainers:
|
|
- name: copy-model-from-cache
|
|
image: ${OPT_125M_CACHE_IMAGE}
|
|
imagePullPolicy: Never
|
|
command:
|
|
- sh
|
|
- -c
|
|
- mkdir -p /shared/facebook/opt-125m && cp -r /model/. /shared/facebook/opt-125m/
|
|
volumeMounts:
|
|
- name: model-cache
|
|
mountPath: /shared
|
|
containers:
|
|
- name: s3-init
|
|
image: docker.io/amazon/aws-cli:2.33.11@sha256:88ea087837da1b31a3afeeb4538888244a3087a867ddb1909848643fcc4b324e
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- |
|
|
aws s3 mb s3://logger-output || true
|
|
aws s3 mb s3://example-models || true
|
|
curl -L https://storage.googleapis.com/kfserving-examples/models/sklearn/1.0/model/model.joblib -o /tmp/sklearn-model.joblib
|
|
aws s3 cp /tmp/sklearn-model.joblib s3://example-models/sklearn/model.joblib --no-verify-ssl
|
|
aws s3 sync /shared/facebook/opt-125m s3://example-models/facebook/opt-125m/ --no-verify-ssl
|
|
env:
|
|
- name: AWS_ACCESS_KEY_ID
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: mlpipeline-s3-artifact
|
|
key: accesskey
|
|
- name: AWS_SECRET_ACCESS_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: mlpipeline-s3-artifact
|
|
key: secretkey
|
|
- name: AWS_DEFAULT_REGION
|
|
value: "us-east-1"
|
|
- name: AWS_ENDPOINT_URL_S3
|
|
value: "http://s3-service.kserve:8333"
|
|
volumeMounts:
|
|
- name: model-cache
|
|
mountPath: /shared
|
|
volumes:
|
|
- name: model-cache
|
|
emptyDir: {}
|
|
restartPolicy: Never
|
|
backoffLimit: 3
|