Skip to content

Commit bdbbc32

Browse files
committed
fix: (again) for ray workdir with no runtime-env
Updates tests/kind/profiles/non-gpu2 to use a new ray-basic input that has no runtime-env.yaml nor requirements.txt
1 parent 794ac00 commit bdbbc32

File tree

4 files changed

+45
-13
lines changed

4 files changed

+45
-13
lines changed

Diff for: package-lock.json

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: plugins/plugin-codeflare/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@types/split2": "^3.2.1"
3131
},
3232
"dependencies": {
33-
"@guidebooks/store": "^6.0.10",
33+
"@guidebooks/store": "^6.0.11",
3434
"@logdna/tail-file": "^3.0.1",
3535
"@patternfly/react-charts": "^6.94.18",
3636
"@patternfly/react-core": "^4.276.6",

Diff for: tests/kind/inputs/ray-basic/main.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import ray
2+
import random
3+
import time
4+
import math
5+
from fractions import Fraction
6+
7+
# Let's start Ray
8+
ray.init(address='auto')
9+
10+
@ray.remote
11+
def pi4_sample(sample_count):
12+
"""pi4_sample runs sample_count experiments, and returns the
13+
fraction of time it was inside the circle.
14+
"""
15+
in_count = 0
16+
for i in range(sample_count):
17+
x = random.random()
18+
y = random.random()
19+
if x*x + y*y <= 1:
20+
in_count += 1
21+
return Fraction(in_count, sample_count)
22+
23+
24+
SAMPLE_COUNT = 1000 * 1000
25+
start = time.time()
26+
future = pi4_sample.remote(sample_count = SAMPLE_COUNT)
27+
pi4 = ray.get(future)
28+
end = time.time()
29+
dur = end - start
30+
print(f'Running {SAMPLE_COUNT} tests took {dur} seconds')
31+
32+

Diff for: tests/kind/profiles/non-gpu2/keep-it-simple

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "keep-it-simple",
33
"creationTime": 1660657756574,
44
"lastModifiedTime": 1660658307175,
5-
"lastUsedTime": 1660742079201,
5+
"lastUsedTime": 1678746664684,
66
"choices": {
77
"madwizard/apriori/use-gpu": "don't use gpus",
88
"madwizard/apriori/arch": "x64",
@@ -11,7 +11,7 @@
1111
"madwizard/apriori/in-terminal": "HTML",
1212
"ml/codeflare": "Submit a new Run",
1313
"ml/codeflare/run": "Bring Your Own Ray Code",
14-
"ml/codeflare/training/byoc/form": "{\"Path to source\":\"$PWD/tests/kind/inputs/qiskit\",\"Base image\":\"rayproject/ray:2.1.0\",\"Command line prefix\":\"python3 main.py\"}",
14+
"ml/codeflare/training/byoc/form": "{\"Path to source\":\"$PWD/tests/kind/inputs/ray-basic\",\"Base image\":\"rayproject/ray:2.1.0\",\"Command line prefix\":\"python3 main.py\"}",
1515
"kubernetes/choose/secret/image-pull": "No secret needed, since my image is public",
1616
"s3/choose/bucket/maybe": "My data is not stored in S3",
1717
"ml/ray/start/resources": "{\"Number of CPUs\":\"500m\",\"Number of GPUs\":\"0\",\"Minimum Workers\":\"1\",\"Maximum Workers\":\"1\",\"Worker Memory\":\"500Mi\",\"Head Memory\":\"3Gi\",\"Ephemeral Storage\":\"5Gi\"}",
@@ -22,4 +22,4 @@
2222
"ml/ray/cluster/choose/kubernetes": "codeflare-test-ray-cluster",
2323
"ml/ray/cluster/kubernetes/choose-pod-scheduler": "Keep It Simple"
2424
}
25-
}
25+
}

0 commit comments

Comments
 (0)