Skip to content

Commit

Permalink
test: update python-language-text-encoder to newer pyarrow
Browse files Browse the repository at this point in the history
and specify python3.12

Signed-off-by: Nick Mitchell <nickm@us.ibm.com>
  • Loading branch information
starpit committed Dec 1, 2024
1 parent 5f9df15 commit 321fb2f
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 4 deletions.
14 changes: 14 additions & 0 deletions pkg/fe/builder/overlay/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"
"path/filepath"
"regexp"
"runtime"
"slices"
"strings"

Expand Down Expand Up @@ -193,6 +194,19 @@ func (b filesystemBuilder) addMetadata(spec *hlir.Spec, sourcePath string) (appV
} else {
spec.Needs = append(spec.Needs, hlir.Needs{Name: "python", Version: "latest", Requirements: req})
}
case "requirements_linux_ci.txt":
if os.Getenv("CI") != "" && runtime.GOOS == "linux" {
if req, rerr := b.readString(path); rerr != nil {
err = rerr
return
} else {
if needsIdx := slices.IndexFunc(spec.Needs, func(needs hlir.Needs) bool { return needs.Name == "python" }); needsIdx >= 0 {
// splice out prior requirements.txt Needs
spec.Needs = append(spec.Needs[:needsIdx], spec.Needs[needsIdx+1:]...)
}
spec.Needs = append(spec.Needs, hlir.Needs{Name: "python", Version: "latest", Requirements: req})
}
}
case "memory", "memory.txt":
if mem, rerr := b.readString(path); rerr != nil {
err = rerr
Expand Down
1 change: 1 addition & 0 deletions tests/tests/python-language-text-encoder/pail/command
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python3.12 main.py
1 change: 1 addition & 0 deletions tests/tests/python-language-text-encoder/pail/image
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker.io/python:3.12
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
sentence-transformers==3.0.1

# we can probably update to 18+, but we will have to re-generate expected output as pyarrow 18 seems to have resulted in a binary format change
pyarrow<18
pyarrow

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sentence-transformers==3.0.1

pyarrow

# TODO this is only for CI, github actions runs out of disk space installing nvidia pips
--extra-index-url https://download.pytorch.org/whl/cpu
torch==2.5.1+cpu
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/tests/python-language-text-encoder/post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ do

ext=${b##*.}
bb=${b%%.*}
actual="$(dirname $i)"/"$bb".output.$ext
actual=$bb.parquet
expected="$DATA"/expected/$bb.parquet.gz

while true
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/python-language-text-encoder/settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ NUM_DESIRED_OUTPUTS=0
# the default is --yaml. we don't want that
source_from=" "

up_args='"$TEST_PATH"/pail/test-data/input/test1.parquet'
up_args='--gunzip "$TEST_PATH"/pail/test-data/input/test1.parquet.gz'

0 comments on commit 321fb2f

Please sign in to comment.