Closed alex-treebeard closed 4 months ago
I think the issue is that the devcontainer doesn't have the XDG environment variables set (not that it should!) and the Python platformsdirs
library doesn't provide defaults (I'd assumed it would). I think we just need to provide these at startup if they don't exist. We'd use the default values as outlined here https://platformdirs.readthedocs.io/en/latest/api.html#unix-linux
Can you check a couple of things:
1) What does platformdirs.user_runtime_path("inspect_ai")
return in the dev container?
2) Is that directory writeable?
3) What is the $HOME in the devcontainer?
Note that a lot of software relies on these vars, so I might also argue that devcontainers that don't export them aren't well set up for development. That said, we should provide defaults that work if they are absent.
Thanks for the help
1
Python 3.11.4 (main, Jun 7 2023, 18:32:58) [GCC 10.2.1 20210110] Type 'copyright', 'credits' or 'license' for more information IPython 8.25.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import platformdirs
In [2]: platformdirs.user_runtime_path("inspect_ai") Out[2]: PosixPath('/run/user/1000/inspect_ai')
> 2.
Not to the vscode user I'm running as
> 3.
`/home/vscode`
I've worked around this by running (and added it to my Dockerfile
```sh
sudo mkdir -p /run/user/1000
sudo chown vscode:vscode /run/user/1000
sudo chmod 700 /run/user/1000
Just to add an alternative workaround to this: export XDG_RUNTIME_DIR=/tmp
.
I have patched this locally with a variable
"INSPECT_RUNTIME_PATH": "${workspaceFolder}/runtime"
I believe you can repro this by running any eval within a devcontainer