forked from data-prep-kit/data-prep-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask-lance-commit.yaml
More file actions
51 lines (51 loc) · 1.95 KB
/
task-lance-commit.yaml
File metadata and controls
51 lines (51 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# filename: task-lance-commit.yaml
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: lance-commit
spec:
params:
- name: LANCEDB_STORAGE_TYPE
type: string
- name: LANCEDB_URI
type: string
- name: LANCEDB_DATA_URI
type: string
- name: LANCEDB_TABLE_NAME
type: string
- name: LANCEDB_FRAGMENTS_JSON_FOLDER
type: string
- name: LANCEDB_TABLE_SCHEMA_FOLDER
type: string
workspaces:
- name: jobs
description: A workspace to mount the job YAML.
steps:
- name: run-lance-commit-job
image: quay.io/dataprep1/data-prep-kit/kubectl:latest
env:
- name: LANCEDB_STORAGE_TYPE
value: $(params.LANCEDB_STORAGE_TYPE)
- name: LANCEDB_URI
value: $(params.LANCEDB_URI)
- name: LANCEDB_DATA_URI
value: $(params.LANCEDB_DATA_URI)
- name: LANCEDB_TABLE_NAME
value: $(params.LANCEDB_TABLE_NAME)
- name: LANCEDB_FRAGMENTS_JSON_FOLDER
value: $(params.LANCEDB_FRAGMENTS_JSON_FOLDER)
- name: LANCEDB_TABLE_SCHEMA_FOLDER
value: $(params.LANCEDB_TABLE_SCHEMA_FOLDER)
script: |
#!/bin/sh
JOBFILE=/workspace/jobs/data-prep-kit/transforms/language/text_encoder/lance-commit-rayjob.yaml
##############################################################################
## Most jobs follow the same pattern, so we can templatize this in the future
JOBNAME=`yq '.metadata.name' $JOBFILE`
TMPFILE=$(mktemp)
envsubst < "$JOBFILE" > "$TMPFILE"
cat "$TMPFILE" && kubectl apply -f "$TMPFILE"
echo "Watiing for Kubernetes rayjob/$JOBNAME to finish or timeout after 24h..."
kubectl wait --for=jsonpath='{.status.jobDeploymentStatus}'=Complete rayjob/$JOBNAME --timeout=24h
echo "Kubernetes rayjob/$JOBNAME completed. Check log for completion status..."
##############################################################################