Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Dockerfile for building and running shoginet. #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM debian:stable AS builder

WORKDIR /shoginet
COPY ./build-yaneuraou.sh .

RUN apt update && apt install -y git build-essential clang
RUN ./build-yaneuraou.sh

FROM python:3.9

WORKDIR /shoginet
COPY --from=builder /shoginet/YaneuraOu-by-gcc /shoginet/
COPY ./shoginet.py /shoginet/shoginet.py
COPY ./eval/nn.bin /shoginet/eval/nn.bin

RUN pip install requests

CMD ["python3", "shoginet.py"]
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@ If you want to go over this setup step again, just delete fishnet.ini.

Windows is not supported right now. Although almost everything should be fine. You will obviously have to compile YaneuraOu for windows and provide the correct path, when shoginet.py asks you the first time.

#### Docker

If you have a Docker engine installed, installation via Docker is the easiest
and most reliable way to run Shoginet. You can simply do:

```bash
docker build -t shoginet:latest .
```

And once that completes, run it with:

```bash
docker run -it shoginet:latest
```

(If you already have a `fishnet.ini` file prepared, you can bindmount that file
in to `/shoginet/fishnet.ini`. Otherwise, you'll be prompted for configuration
values.)


## How it works

Every once in a while shoginet running on your computer asks lishogi.org for some work. If someone requested analysis of their game on lishogi.org, you may receive this work. The work is a simple json containing mainly the initial position and sequence of moves. You then run engine analysis on these data and send the results back to lishogi.org.