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