Hi @mugurelionut,
All good questions.
I just went through your submission, and it looks like you are using an older version of the starter kit ?
https://gitlab.aicrowd.com/mugurelionut/flatland-challenge-starter-kit ?
And coming to your question of why does the remote_client
need access to the test files locally, that was indeed a non intuitive design decision that we had to take, because we want to lets participants have access to a whole RailEnv
object to do whatever they want with it, but we did not want participants to arbitrarily change the state of the environment (for instance, a participant could simply loop over all the agents, and set their position to the target position, and the env would be done in a single step ), which would affect our ability to reliably measure the score for all the participants.
So what we instead do now, is run two copies of the same environment, one inside the container running the user-submitted code, and one inside a separate trusted container. When you do an env_step
on the remote_client
, we apply that step on both the local instance of the environment, and the βremoteβ instance of the environment in the trusted container.
We compute things like the total rewards, when an env is done, etc from the env instance in the trusted container (remote), and we compute observation from the env instance in the container running user code (which also allows us to safely let users design their own observations).
Now, to make this happen, we can ofcourse expose the RailEnv
(and all its interfaces) in the remote container as an RPC, adding enough safe guardings to ensure it cant be abused. But that will cause a lot of data flowing back and forth between the containers over the network on all interactions. For instance, the env state objects for larger grids (100x100 or more) can be in hundreds of megabytes, and that would hugely affect the performance during the evaluation.
He we just securely mount a copy of all the test envs in both the containers, and when you do a env_create
call, the remote service sends you the βkeyβ of the test-env that its loading at its end, and the remote_client
also locally instantiates a copy of the same env, which you of course can access by : remote_client.env
(ref) .
In your case, the only reason you could be gettting this error, is either if you have not downloaded the tests, or placed them incorrectly, or passing a wrong value to the AICROWD_TESTS_FOLDER
env var.
The AICROWD_TESTS_FOLDER
env variable should point to the root of the directory which has the individual test sets. If say, my directory containing the tests is called as test-env
, then its structure should look like :
βββ test-envs
βββ Test_0
β βββ Level_0.pkl
β βββ Level_1.pkl
βββ Test_1
β βββ Level_0.pkl
β βββ Level_1.pkl
βββ Test_2
β βββ Level_0.pkl
β βββ Level_1.pkl
βββ Test_3
β βββ Level_0.pkl
β βββ Level_1.pkl
βββ Test_4
β βββ Level_0.pkl
β βββ Level_1.pkl
βββ Test_5
β βββ Level_0.pkl
β βββ Level_1.pkl
βββ Test_6
β βββ Level_0.pkl
β βββ Level_1.pkl
βββ Test_7
β βββ Level_0.pkl
β βββ Level_1.pkl
βββ Test_8
β βββ Level_0.pkl
β βββ Level_1.pkl
βββ Test_9
βββ Level_0.pkl
βββ Level_1.pkl
And in your case, lets say, you set the AICROWD_TESTS_FOLDER
as /your/path/to/tests/folder
,
then can you ensure that you can get this following snippet of code to run :
import os
TESTS_FOLDER = os.getenv("AICROWD_TESTS_FOLDER", "/tmp")
test_path = os.path.join(TESTS_FOLDER, "Test_0/Level_0.pkl")
if not os.path.exists(test_path):
raise Exception("Could not access test file at the right location :( ")
else:
raise "File structure all correct !! Env variables set correctly !! Finally :D !"
Do note that on the evaluator, this env variable will be automatically set, so please do not try to overrride that env variable in your run.sh
file.
Cheers,
Mohanty