Instructions Needed for Using Dockerfile to Build a UI-Compatible Engine #6
-
Dear @dhbloo, Firstly, I want to express my appreciation for your work on the Rapfi engine. It is a very impressive project, and I am excited to use it. Currently, I am trying to create a Docker environment to build and run Rapfi. I have constructed a Dockerfile that compiles and runs the engine successfully within the container. Here is the Dockerfile for your reference: # Builder Stage
FROM alpine:edge as builder
# Install necessary packages using apk add
RUN apk update && apk add \
cmake \
g++ \
curl \
unzip \
git \
libtbb-dev \
make \
linux-headers
# Working directory setup
WORKDIR /app
# Clone the repository
RUN git clone https://github.com/dhbloo/rapfi.git . \
&& git submodule update --init --recursive --force && git submodule sync
# Build process
RUN cd Rapfi \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_BUILD_TYPE=Release \
&& make
# Final Stage
FROM alpine:edge
LABEL author="xanonymous"
# Copy necessary files from builder stage
COPY --from=builder /app/Rapfi/build/pbrain-rapfi /app/rapfi
COPY --from=builder /app/Networks/config-example/config.toml /app/config.toml
COPY --from=builder /app/Networks/mix7nnue /app
COPY --from=builder /app/Networks/classical /app
# Install necessary packages using apk add
RUN apk update && apk add --no-cache \
libtbb-dev \
linux-headers \
&& sed -i 's/default_thread_num = 1/default_thread_num = 0/g' /app/config.toml
# Set default command to execute
CMD ["/app/rapfi"] I am now trying to figure out how to make this Docker-built Rapfi engine communicate with a UI, so that I can use it to play games. However, I am unsure of the necessary steps to make this happen. Could you please provide some guidance on how I could go about doing this? Specifically, I need to understand how the UI should interact with the Rapfi engine running within the Docker container. Any guidance or advice you could provide would be greatly appreciated. Thank you for your time and consideration. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hello, I am not familiar with docker, but I searched something like this to send something into the stdin of a container, FYI. |
Beta Was this translation helpful? Give feedback.
It seems the page has been moved to a new address. In addition to this, Yixin board extension describes additional interaction about multi-threading, etc. There are also some commands unique to rapfi, which I will add a detailed description in readme soon.
The docker image is nice. I think I will add more detailed instructions about running in a docker later.