Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kubectl-plugin] Add e2e test for kubectl ray job submit #2614

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

chiayi
Copy link
Contributor

@chiayi chiayi commented Dec 5, 2024

Why are these changes needed?

This PR adds test for the ray job submit command.

Related issue number

Part of #2608

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

@chiayi chiayi force-pushed the kubectl-plugin-e2e branch 8 times, most recently from 192dd4d to 732be43 Compare December 5, 2024 23:23
@chiayi chiayi marked this pull request as ready for review December 5, 2024 23:53
@chiayi chiayi mentioned this pull request Dec 5, 2024
14 tasks
@chiayi chiayi force-pushed the kubectl-plugin-e2e branch from 732be43 to b57100a Compare December 6, 2024 01:39
Comment on lines 7 to 25
@ray.remote
class Counter:
def __init__(self):
# Used to verify runtimeEnv
self.name = os.getenv("counter_name")
assert self.name == "test_counter"
self.counter = 0

def inc(self):
self.counter += 1

def get_counter(self):
return "{} got {}".format(self.name, self.counter)

counter = Counter.remote()

for _ in range(5):
ray.get(counter.inc.remote())
print(ray.get(counter.get_counter.remote()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think use task would be simpler than actor. We don't need counter. A simple task that checks environment variables and try to import package in it is enough. Something like

import ray

ray.init()

@ray.remote
def f():
    # import package
    # check package version
    # check env vars

ray.get(f.remote())

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PTAL, I used 2 packages that aren't dependencies and 2 env vars.

@chiayi chiayi force-pushed the kubectl-plugin-e2e branch 4 times, most recently from 2405cbc to 7b11a7c Compare December 6, 2024 19:55
@chiayi chiayi force-pushed the kubectl-plugin-e2e branch from 7b11a7c to a8ae574 Compare December 6, 2024 20:02
Copy link
Member

@MortalHappiness MortalHappiness left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

spec:
# The current value is "InteractiveMode", meaning that it will wait for user to submit job and provide the job submission ID
submissionMode: 'InteractiveMode'
runtimeEnvYAML: |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevin85421 @MortalHappiness what's the expected behavior with runtime env when using InteractiveMode. It should be ignored right?

@andrewsykim andrewsykim merged commit e9f3155 into ray-project:master Dec 9, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants