dtdannen / dcss-ai-wrapper

An API for Dungeon Crawl Stone Soup for Artificial Intelligence research.
MIT License
41 stars 13 forks source link

Docker Quickstart and Local Installation Troubleshooting #30

Open beeWAtoN opened 2 years ago

beeWAtoN commented 2 years ago

Issue 1: by Christopher Oey "Regarding Quickstart, it all runs fine up until “Now open a new terminal to run the the webserver via Docker” At this point, I installed docker, but trying to run “docker pull dtdannen34/dcss-ai-wrapper:webtilesserver” fails, giving the message “Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?” This persists trying to pull it while in different locations, and also trying to pull just “dcss-ai-wrapper:webtileserver”. I’m not too familiar with using Docker, but is the pre-built docker supposed to be running already?

To dodge this issue, I tried to use the installation guide to install it myself. It does say that it hasn’t been tested in awhile, so I tried to test the instructions. Step 2 says “Grab a copy of the 23.1 version of crawl, by cloning the repo and then resetting to the 23.1 version:” This occurs by grabbing the current git of DCSS and resetting it to the 23.1 version (which I think corresponds to 0.23?). Part of the problem seems to be in the fact its loading 0.23 and not the 0.26 where everything else is currently based on according to our previous discussion. That being said, that doesn’t seem to be the reason the error below is created.

Inputting: “git reset –hard d6e21ad81dcba7f7f8c15336e0e985f070ce85fb” gives an error: “ fatal: ambiguous argument '–hard': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]' “ This error persists with --hard instead of -hard.

Running this without -hard lets it run, but the following steps of “git submodule update –init” and changing flags does not work at all, basically halting installation progress here. "


Solution 1: by Dustin to install DCSS onto local device " [https://github.com/dtdannen/dcss-ai-wrapper/blob/dev/webserver_docker/Dockerfile]

You would only need lines 12-35 and lines 45-52. RUN and CMD in docker basically just mean to execute the line like you would normally in a shell and WORKDIR is like a docker version of ‘cd’. Oh and you can put the crawl installation anywhere, not necessarily in /dcss/… I just put it at the top level of the file system for docker. I’d probably install it myself under ~/Projects/crawl/ or something like that.

"

Followup Issues 2: by Chris regarding Solution 1 Solution works, but some minor issues may pop up while installing. "

Here’s some messy installation notes I wrote while doing it on my own system(Ubuntu 18.04 but on Windows) outside Docker. This is all based on the instructions you sent today morning:

• Note to self: run everything with sudo for perms • “apt -y install libz-dev pkg-config python3-yaml binutils-gold python-is-python3 python2 make” fails to find python-is-python3 and python2. Not sure if this is a massive issue since I think it turns any python references to python3/2 respectively already in later ubuntu versions • Saw a lot of “libpng warning: Interlace handling should be turned on when using png_read_image” and “libpng warning: iCCP: known incorrect sRGB profile” while running line 32. Also not sure if this will cause long-term problems • OK, make installing crawl takes quite awhile. After lot of waiting, got error message: “ [ -d /usr/local/share/crawl ] || mkdir -p /usr/local/share/crawl mkdir: cannot create directory ‘/usr/local/share/crawl’: Permission denied Makefile:1446: recipe for target 'install-data' failed make: *** [install-data] Error 1 “ Probably because I didn’t use sudo. Yep, looks like no errors after using sudo “insert previous line here” • “mkdir /dcss/crawl/crawl-ref/source/rcs/” Since currently already in ./source, just need “mkdir rcs”, otherwise fails to find path • “CMD ["python", "webserver/server.py" ]” terminal equivalent is: “./webserver/server.py” running from ./source • In Quickstart, one of the lines says “python .\src\dcss\agent\randomagent.py” This has backslashes instead of foreslashes for some reason. Should be “python ./src/dcss/agent/randomagent.py” • Everything seems to work fine regardless of the previous minor error messages on my local machine.

Tldr; Have perms for each command, install all the packages, translate a couple lines to the command line equivalent = It all works fine for self-installation without Docker as far as I can tell.

"

dtdannen commented 2 years ago

Thanks Chris, we probably want to add a FAQ page to the documentation with common issues, like the docker daemon.