Git Product home page Git Product logo

lc0-docker's Introduction

Let's run latest releases of lc0, lczero-client and lichess-bot under NVIDIA docker.

Run Lc0 self-play training games

To download and run the prebuilt Docker image

docker run --runtime nvidia --rm -it vochicong/lc0-docker

otherwise, clone this repository then run

docker-compose up lc0

Kubernetes

See k8s.yaml for a sample configuration.

Version

The docker image is tagged by lc0 release version, see .github/main.workflow, k8s.yaml and docker-compose.yml.

Run Lc0 with lichess-bot

  • Clone this repository, cd lc0-nvdia-docker
  • Download and put syzygy tablebases into data/syzygy
  • Download and put networks (weights) into data/networks
  • Edit lc0.config and lcbot-config.yml to your preference
  • Put your LICHESS_API_TOKEN in file .env (NEVER git commit this file)

Run

docker-compose up lcbot

Requirements

lc0-docker's People

Contributors

vochicong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lc0-docker's Issues

Missing or Invalid URL in the dockerfile.

The error I got was

Step 9/27 : RUN curl -s -L https://github.com/LeelaChessZero/lc0/releases/latest |    egrep -o '/LeelaChessZero/lc0/archive/v.*.tar.gz' |    wget --base=https://github.com/ -O lc0latest.tgz -i - &&    tar xfz lc0latest.tgz && rm lc0latest.tgz && mv lc0* /lc0
 ---> Running in ca0d93afccbb
No URLs found in -.
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
The command '/bin/sh -c curl -s -L https://github.com/LeelaChessZero/lc0/releases/latest |    egrep -o '/LeelaChessZero/lc0/archive/v.*.tar.gz' |    wget --base=https://github.com/ -O lc0latest.tgz -i - &&    tar xfz lc0latest.tgz && rm lc0latest.tgz && mv lc0* /lc0' returned a non-zero code: 2

It seems to reference this line in the Dockerfile

    wget --base=https://github.com/ -O lc0latest.tgz -i - &&\

I don't have a lot of experience working with docker but from what I've pieced together there is supposed to be an URL after "-i" but it is missing.

Ideas

  • Auto-rebuild when lc0 or client are updated
  • Get lc0 networks by ID for lcbot
  • Tag Docker image by lc0 version
  • CPU player
  • GPU player

Docker build fails

shiv@pop-os:~/workspace/lc0-docker$ docker-compose up lc0
WARNING: The LICHESS_API_TOKEN variable is not set. Defaulting to a blank string.
Building lc0
Step 1/18 : FROM nvidia/cuda:10.0-cudnn7-runtime as lc0base
---> 6029ae406c22
Step 2/18 : RUN apt-get update && apt-get install -y libopenblas-base libprotobuf10 zlib1g-dev ocl-icd-libopencl1 tzdata && apt-get clean all
---> Using cache
---> 158291e62e18

Step 3/18 : FROM lc0base as botbase
---> 158291e62e18
Step 4/18 : RUN apt-get update && apt-get install -y python3 && apt-get clean all
---> Using cache
---> 641b69290f75

Step 5/18 : FROM nvidia/cuda:10.0-cudnn7-devel as builder
---> 2a1a442c2ae2
Step 6/18 : RUN apt-get update && apt-get install -y curl wget supervisor git clang-6.0 libopenblas-dev ninja-build protobuf-compiler libprotobuf-dev python3-pip && apt-get clean all
---> Using cache
---> 510074258563
Step 7/18 : RUN pip3 install meson
---> Using cache
---> 7971f9af4f87
Step 8/18 : LABEL "version"="lc0_v0.26.3-client_v29"
---> Using cache
---> de7238036efc
Step 9/18 : RUN curl -s -L https://github.com/LeelaChessZero/lc0/releases/latest | egrep -o '/LeelaChessZero/lc0/archive/v..tar.gz' | wget --base=https://github.com/ -O lc0latest.tgz -i - && tar xfz lc0latest.tgz && rm lc0latest.tgz && mv lc0 /lc0
---> Using cache
---> c3a7159d0331
Step 10/18 : WORKDIR /lc0
---> Using cache
---> b96ccc085c26
Step 11/18 : RUN CC=clang-6.0 CXX=clang++-6.0 INSTALL_PREFIX=/lc0 ./build.sh release && ls /lc0/bin
---> Running in 03ba908c9f09
/lc0 /lc0
The Meson build system
Version: 0.56.0
Source dir: /lc0
Build dir: /lc0/build/release
Build type: native build
Project name: lc0
Project version: undefined
Using 'CXX' from environment with value: 'clang++-6.0'
C++ compiler for the host machine: clang++-6.0 (clang 6.0.0-1ubuntu2 "clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)")
C++ linker for the host machine: clang++-6.0 ld.bfd 2.30
Using 'CXX' from environment with value: 'clang++-6.0'
Host machine cpu family: x86_64
Host machine cpu: x86_64
Has header "optional" : YES
Has header "string_view" : YES
Has header "charconv" : NO
meson.build:30: WARNING: Your compiler or library does not have full C++17 support. See the README for compilers that are known to be working. This will become an error in the future.
Compiler for C++ supports arguments -march=native: YES
Program scripts/compile_proto.py found: YES (/lc0/scripts/compile_proto.py)
Program git found: YES (/usr/bin/git)
Message: cloning lczero-common.git into libs/lczero-common
meson.build:110: WARNING: Failed to parse short revision. Use git clone instead of downloading the archive from GitHub.
Message: Using build identifier "git.unknown".
Run-time dependency threads found: YES
Library dl found: YES
Did not find pkg-config by name 'pkg-config'
Found Pkg-config: NO
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency tensorflow_cc found: NO (tried pkgconfig and cmake)
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/mesonmain.py", line 140, in run
return options.run_func(options)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/msetup.py", line 253, in run
app.generate()
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/msetup.py", line 161, in generate
self._generate(env)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/msetup.py", line 200, in _generate
intr.run()
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreter.py", line 4703, in run
super().run()
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 519, in run
self.evaluate_codeblock(self.ast, start=1)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 544, in evaluate_codeblock
raise e
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 537, in evaluate_codeblock
self.evaluate_statement(cur)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 560, in evaluate_statement
return self.evaluate_if(cur)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 642, in evaluate_if
self.evaluate_codeblock(i.block)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 544, in evaluate_codeblock
raise e
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 537, in evaluate_codeblock
self.evaluate_statement(cur)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 552, in evaluate_statement
self.assignment(cur)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 1219, in assignment
value = self.evaluate_statement(node.value)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 550, in evaluate_statement
return self.function_call(cur)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 909, in function_call
return func(node, func_args, kwargs)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 393, in wrapped
return f(*wrapped_args, **wrapped_kwargs)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 393, in wrapped
return f(*wrapped_args, **wrapped_kwargs)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 393, in wrapped
return f(*wrapped_args, **wrapped_kwargs)
[Previous line repeated 3 more times]
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 209, in wrapped
ret = f(*wrapped_args, **wrapped_kwargs)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 228, in wrapped
return f(*wrapped_args, **wrapped_kwargs)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreter.py", line 3734, in func_dependency
d = d.as_system_method([wanted], {})
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 301, in wrapped
return f(*wrapped_args, **wrapped_kwargs)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreterbase.py", line 228, in wrapped
return f(*wrapped_args, **wrapped_kwargs)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/interpreter.py", line 516, in as_system_method
new_dep = self.held_object.generate_system_dependency(new_is_system)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/dependencies/base.py", line 235, in generate_system_dependency
new_dep = copy.deepcopy(self)
File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct
state = deepcopy(state, memo)
File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct
state = deepcopy(state, memo)
File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct
state = deepcopy(state, memo)
File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct
state = deepcopy(state, memo)
File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct
state = deepcopy(state, memo)
File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib/python3.6/copy.py", line 161, in deepcopy
y = copier(memo)
TypeError: cannot deepcopy this pattern object
ERROR: Service 'lc0' failed to build: The command '/bin/sh -c CC=clang-6.0 CXX=clang++-6.0 INSTALL_PREFIX=/lc0 ./build.sh release && ls /lc0/bin' returned a non-zero code: 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.