Repository navigation
[WIP] Enable all Windows runtime env tests - #22186
architkulkarni wants to merge 5 commits into
Conversation
|
Maybe @czgdp1807 and @mattip can help with activating these tests? |
| "Windows." | ||
| ) | ||
| elif isinstance(conda, str): | ||
| if isinstance(conda, str): |
There was a problem hiding this comment.
Has this been changed upstream so that the conda field is now supported?
There was a problem hiding this comment.
Sorry for the lack of context for this PR--I just wanted to enable all the tests to see which ones were broken. I'm currently going through the tests to see what we can learn from the test output.
Nothing has changed upstream for conda and pip, but I wanted to see if or how it would fail on Windows since it hasn't been tested. I'm not an expert but I think the only potential compatibility problem might be in the parts where we call into the command line for conda create, conda activate, pip install and so on, since the windows shell is different from bash which we have on MacOS and Linux.
|
A lot of tests were skipped with |
|
@mattip Have you seen something like this before where a test file "passes" in 3 seconds? E.g. here I'm pretty sure this means the test file was skipped for Windows, but I couldn't find anywhere in the code that was indicating that it should be skipped, so I'm not sure how to un-skip it. |
Let me try executing it locally. |
|
Well, all the cluster tests are globally enable or disabled via the following flag. When you set P.S. An error which I noticed after setting the above flag to ― test_remote_package_uri[ray_client-True-py_modules-s3://runtime-env-test/test_runtime_env.zip] ―
start_cluster = (<ray.cluster_utils.Cluster object at 0x0000014D5E5CC3D0>, 'ray://localhost:10004')
remote_uri = 's3://runtime-env-test/test_runtime_env.zip', option = 'py_modules'
per_task_actor = True
@pytest.mark.parametrize("remote_uri", REMOTE_URIS)
@pytest.mark.parametrize("option", ["failure", "working_dir", "py_modules"])
@pytest.mark.parametrize("per_task_actor", [True, False])
def test_remote_package_uri(start_cluster, remote_uri, option, per_task_actor):
"""Tests the case where we lazily read files or import inside a task/actor.
In this case, the files come from a remote location.
This tests both that this fails *without* the working_dir and that it
passes with it.
"""
cluster, address = start_cluster
if option == "working_dir":
env = {"working_dir": remote_uri}
elif option == "py_modules":
env = {"py_modules": [remote_uri]}
if option == "failure" or per_task_actor:
ray.init(address)
else:
ray.init(address, runtime_env=env)
@ray.remote
def test_import():
import test_module
return test_module.one()
if option != "failure" and per_task_actor:
test_import = test_import.options(runtime_env=env)
if option == "failure":
with pytest.raises(ImportError):
ray.get(test_import.remote())
else:
> assert ray.get(test_import.remote()) == 2
python\ray\tests\test_runtime_env_working_dir_remote_uri.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python\ray\_private\client_mode_hook.py:104: in wrapper
return getattr(ray, func.__name__)(*args, **kwargs)
python\ray\util\client\api.py:43: in get
return self.worker.get(vals, timeout=timeout)
python\ray\util\client\worker.py:384: in get
res = self._get(to_get, op_timeout)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ray.util.client.worker.Worker object at 0x0000014D5E541610>
ref = [ClientObjectRef(16310a0f0a45af5cffffffffffffffffffffffff0100000001000000)], timeout = 2.0
def _get(self, ref: List[ClientObjectRef], timeout: float):
req = ray_client_pb2.GetRequest(ids=[r.id for r in ref], timeout=timeout)
try:
resp = self._call_stub("GetObject", req, metadata=self.metadata)
except grpc.RpcError as e:
raise decode_exception(e)
if not resp.valid:
try:
err = cloudpickle.loads(resp.error)
except (pickle.UnpicklingError, TypeError):
logger.exception("Failed to deserialize {}".format(resp.error))
raise
> raise err
E ray.exceptions.RuntimeEnvSetupError: Failed to setup runtime environment.
E Failed to create runtime env {"pythonRuntimeEnv":{"pyModules":["s3://runtime-env-test/test_runtime_env.zip"]},"uris":{"pyModulesUris":["s3://runtime-env-test/test_runtime_env.zip"]}}.
E Unable to locate credentials
python\ray\util\client\worker.py:412: RuntimeEnvSetupError |
The canonical way to deal with this is |
|
I fixed (and unskipped) some of the tests unskipped here in #22342. |
|
@mattip Thank you so much! I'll review that PR. @czgdp1807 regarding the credential missing issue, let me find out how the S3 credentials are set up on the current Linux machines and see if we can set up something similar in the Windows CI. |
|
@czgdp1807 So it turns out the S3 bucket used by the test is public, and in order to access it you just need to have some AWS credentials set up (any credentials will do). I'm not sure how to set up AWS credentials on the Windows CI, do you happen to know how? If not I can ask for help. |
|
For more context on my recent commits on this PR adding the "post-wheel-build tests": Currently the runtime_env conda feature automatically injects the currently running Ray version into the user-provided conda The problem is when running the test in CI, the build from the PR doesn't match any existing wheel on PyPI or S3. So to work around this, we have the following: ray/python/ray/_private/runtime_env/conda.py Lines 118 to 124 in 53c4c7b In the Linux "post-wheel" tests we build a Ray wheel from the PR and store it locally on the CI machine, and when running the Right now the newly-added post-wheel-build Windows tests are failing with some numpy import issue, still trying to figure that out. |
I don't have any idea about setting up AWS credentials on Windows CI. We can use some help here. |
|
@czgdp1807 Was the credentials error you posted from running the test locally on your Windows machine, or was it from Windows CI? |
It's locally from my Windows machine. Though now I think this error makes sense locally, right? I am not sure if the same thing happens on CI. |
Oh yeah, makes sense! So to run it locally, you just need some AWS credentials set (any AWS credentials will work). |
|
@mattip Thanks for the work on fixing the paths, There are some remaining One issue is that some tests are "passing" in 3s (so not actually running), as mentioned above and it looks like @czgdp1807 has an idea about how to fix this using The other issue is that individual tests within the files are skipped on Windows. How would it be best to track this, should we create github issues and tag with windows and QS? |
|
Once we get the basic conda scripts working, it should be easy to enable the tests. Right now I have a problem on the branch for #22449 that running the following opens a large number of processes all running exactly the same This results in ~4 processes running over and over again |
|
It seems the agent is timing out? I see this in the raylet.out log |
|
Got it: I needed to increase the |
Oh wow, great find! I was pretty confused. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
|
|
Hi again! The issue will be closed because there has been no more activity in the 14 days since the last message. Please feel free to reopen or open a new issue if you'd still like it to be addressed. Again, you can always ask for help on our discussion forum or Ray's public slack channel. Thanks again for opening the issue! |
Why are these changes needed?
This PR is just to trigger a Windows CI run with all the runtime_env tests enabled, to get an idea of what's currently not working on Windows.
Related issue number
Checks
scripts/format.shto lint the changes in this PR.