Games-and-Simulations / sc-docker

Multi-platform Version of StarCraft: Brood War in a Docker Container, ready to use for bot play simulations.
MIT License
230 stars 41 forks source link

error in .sh script in docker container? #54

Closed trollkotze closed 6 years ago

trollkotze commented 6 years ago

Not sure if I have broken things or if things have been broken without my bad influence. I had been able to use scbw.play to play against bots a month or two ago without many problems. Only some bots I would have liked to play did not work back then.

Now I checked and saw there are some updates in the repo, including new releases. Not really knowing how any update process works, I just deleted all docker images, did pip uinstall scbw, pip install scbw to reinstall everything.

Then I wanted to play. But now, this always happens:

DEBUG checking docker-machine presence
DEBUG Docker machine not present
DEBUG Using vnc host 'localhost'
DEBUG 'docker' 'run' '-d' '--privileged' '--name' 'GAME_FA48B843_0_human' '--volume' '/home/trollkotze/.scbw/logs:/app/logs:rw' '--volume' '/home/trollkotze/.scbw/maps:/app/sc/maps:rw' '--volume' '/home/trollkotze/.scbw/bwapi-data/BWTA:/app/sc/bwapi-data/BWTA:rw' '--volume' '/home/trollkotze/.scbw/bwapi-data/BWTA2:/app/sc/bwapi-data/BWTA2:rw' '--net' 'sc_net' '-p' '5900:5900' '-e' 'PLAYER_NAME=human' '-e' 'PLAYER_RACE=R' '-e' 'NTH_PLAYER=0' '-e' 'NUM_PLAYERS=1' '-e' 'GAME_NAME=GAME_FA48B843' '-e' 'MAP_NAME=/app/sc/maps/sscai/(2)Benzene.scx' '-e' 'GAME_TYPE=FREE_FOR_ALL' '-e' 'SPEED_OVERRIDE=0' '-e' 'HIDE_NAMES=0' '-e' 'TM_LOG_RESULTS=../logs/GAME_FA48B843_0_results.json' '-e' 'TM_LOG_FRAMETIMES=../logs/GAME_FA48B843_0_frames.csv' '-e' 'TM_SPEED_OVERRIDE=0' '-e' 'TM_ALLOW_USER_INPUT=1' '-e' 'EXIT_CODE_REALTIME_OUTED=2' '-e' 'JAVA_DEBUG=0' 'starcraft:game' '/app/play_human.sh' '--headful'
INFO launched HumanPlayer:human:R
DEBUG container name 'GAME_FA48B843_0_human'
DEBUG container id 'c16c00a8c5e2'
DEBUG Checking if game has launched properly...
ERROR Some containers exited prematurely, please check logs
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/scbw/cli.py", line 198, in main
    game_result = run_game(args)
  File "/usr/local/lib/python3.6/dist-packages/scbw/game.py", line 93, in run_game
    _wait_callback)
  File "/usr/local/lib/python3.6/dist-packages/scbw/docker.py", line 403, in launch_game
    raise DockerException("Some containers exited prematurely, please check logs")
scbw.error.DockerException: Some containers exited prematurely, please check logs

It does not matter whether I choose bots or human or not. All docker containers exit prematurely, it seems.

If I type in the docker command with all the characters as listed in the debug output above, I get this result:

trollkotze@schrotthaufen:~$ docker run -d --privileged --name GAME_FA48B843_0_human --volume /home/trollkotze/.scbw/logs:/app/logs:rw --volume /home/trollkotze/.scbw/maps:/app/sc/maps:rw --volume /home/trollkotze/.scbw/bwapi-data/BWTA:/app/sc/bwapi-data/BWTA:rw --volume /home/trollkotze/.scbw/bwapi-data/BWTA2:/app/sc/bwapi-data/BWTA2:rw --net sc_net -p 5900:5900 -e PLAYER_NAME=human -e PLAYER_RACE=R -e NTH_PLAYER=0 -e NUM_PLAYERS=1 -e GAME_NAME=GAME_FA48B843 -e MAP_NAME=/app/sc/maps/sscai/(2)Benzene.scx -e GAME_TYPE=FREE_FOR_ALL -e SPEED_OVERRIDE=0 -e HIDE_NAMES=0 -e TM_LOG_RESULTS=../logs/GAME_FA48B843_0_results.json -e TM_LOG_FRAMETIMES=../logs/GAME_FA48B843_0_frames.csv -e TM_SPEED_OVERRIDE=0 -e TM_ALLOW_USER_INPUT=1 -e EXIT_CODE_REALTIME_OUTED=2 -e JAVA_DEBUG=0 starcraft:game /app/play_human.sh --headful

/bin/sh: 1: Syntax error: "(" unexpected

So it seems that the "/app/play_human.sh" script in the starcraft docker container has such a syntax error, an unexpected "(" on line 1.

But I don't know how to get into that container and see what's in it. Or how to get a working replacement. And how it actually came to this.

expected behaviour

Docker images should run.

actual behaviour

See above.

steps to reproduce

not sure... I want to find out what I have done wrong. But I don't know yet what it is.

operating system

Ubuntu 16.04.3 LTS

docker version

output of command docker version: Client: Version: 17.09.0-ce API version: 1.32 Go version: go1.8.3 Git commit: afdb6d4 Built: Tue Sep 26 22:42:18 2017 OS/Arch: linux/amd64

Server: Version: 17.09.0-ce API version: 1.32 (minimum version 1.12) Go version: go1.8.3 Git commit: afdb6d4 Built: Tue Sep 26 22:40:56 2017 OS/Arch: linux/amd64 Experimental: false

scbw version

output of command scbw.play -v

0.2b10
trollkotze commented 6 years ago

Oh, never mind. Doing the same procedure (pip uninstall, then pip reinstall), it suddenly seems to work now. Don't know what I messed up before. Probably not an issue with that repo here anyway. Sorry for the spam.