Skip to content

Commit 3ef0929

Browse files
committed
feat: add docker support
This commit adds docker support to the livepool pool.
1 parent 9cacf8e commit 3ef0929

4 files changed

Lines changed: 74 additions & 6 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# IDE's
2+
.vscode

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM nvidia/cuda:11.8.0-base-ubuntu22.04
2+
3+
ENV NVIDIA_DRIVER_CAPABILITIES=all
4+
5+
# Install required packages
6+
RUN apt-get update && apt-get install -y \
7+
wget \
8+
tar \
9+
&& rm -rf /var/lib/apt/lists/*
10+
11+
# Download and extract the Titan Node pool binary
12+
RUN wget https://github.com/Livepool-io/transcoder/releases/download/v0.5.28/0.5.28-80b8f968_livepool-linux-amd64.tar.gz && \
13+
tar -xzf 0.5.28-80b8f968_livepool-linux-amd64.tar.gz && \
14+
rm 0.5.28-80b8f968_livepool-linux-amd64.tar.gz && \
15+
mv ./livepool-linux-amd64/livepool /usr/local/bin
16+
17+
# Set the entrypoint to start the Titan Node pool binary with command line arguments
18+
ENTRYPOINT ["/usr/local/bin/livepool"]

README.md

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# Livepool Video Miner
1+
# Livepool Video Miner
22

3-
## Installation
3+
## Installation
44

55
1. Download the latest release for your OS from the [releases page](https://github.com/Livepool-io/transcoder/releases/)
66

7-
2. Unpack the archive.
8-
- .zip : use winzip or winRAR
7+
2. Unpack the archive.
8+
- .zip : use winzip or winRAR
99
- .tar : `$ tar -zxvf livepool-$(YOUR_PLATFORM)-amd64.tar.gz`
1010

1111
3. Move the binary to your executable `PATH`
1212

13-
4. Find your GPU PCIe IDs using `nvidia-smi` , this corresponds to your PCIe 16x slots, i.e. if you have one slot with one GPU your ID will be 0.
13+
4. Find your GPU PCIe IDs using `nvidia-smi` , this corresponds to your PCIe 16x slots, i.e. if you have one slot with one GPU your ID will be 0.
1414

1515
5. Start livepool
1616

@@ -19,6 +19,35 @@ $ livepool -ethAcctAddr $(YOUR_ETH_ADDRESS) -nvidia $(PCIe IDs comma-separated)
1919
```
2020

2121
- `$(YOUR_ETH_ADDRESS)` - Your ethereum address to receive payouts. If you don't have an ethereum account download an ethereum wallet such as [Metamask](https://metamask.io/).
22-
- `$(PCIe IDs comma-separated)` - The PCIe IDs for your GPUs.
22+
- `$(PCIe IDs comma-separated)` - The PCIe IDs for your GPUs.
2323

2424
Example: `$ livepool -ethAcctAddr 0xF5ba856B4DBfBf3A56b01eFd0697fc188cE1aFD8 -nvidia 0,1`
25+
26+
# Containerized Operation (Experimental)
27+
28+
Within this repository, you'll discover a [Dockerfile](Dockerfile) and [docker-compose.yml](docker-compose.yml) file, offering a method to encapsulate the LivePool pool within a Docker container. It's essential to note that this configuration is still in the experimental phase and isn't recommended for production environments. Should you choose to embark on this journey, adhere to the following guidelines:
29+
30+
1. **Docker Deployment**: Commence by installing Docker on your Linux machine. For guidance, refer to the [official Docker installation documentation](https://docs.docker.com/engine/install/ubuntu/).
31+
32+
2. **Nvidia Container Toolkit Integration**: Ensure your system is fortified with the [Nvidia container toolkit](https://github.com/NVIDIA/nvidia-container-toolkit).
33+
34+
3. **Image Construction**: Execute the subsequent command to construct the Docker image:
35+
36+
```bash
37+
docker build -t livepool-pool .
38+
```
39+
40+
4. **Container Launch**: Initiate the container using the following command. Remember to substitute `<ETH_ADDRESS>` with your Ethereum address, `<NICKNAME>` with your designated identifier and `<MAX_SESSIONS>` with your desired session count:
41+
42+
```bash
43+
docker run --runtime nvidia livepool-pool -ethAcctAddr <ETH_ADDRESS>
44+
```
45+
46+
> \[!NOTE]
47+
> If a discreet background operation suits your preferences, orchestrate it via Docker Compose:
48+
>
49+
>```bash
50+
>docker compose up -d
51+
>```
52+
>
53+
> During this process, update the [docker-compose.yml](docker-compose.yml) file with your precise ETH address, orchestrator secret and max sessions count.

docker-compose.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: "3.8"
2+
3+
name: livepool
4+
5+
services:
6+
video-miner-pool:
7+
build: .
8+
image: livepool-pool
9+
container_name: livepool-pool
10+
restart: unless-stopped
11+
runtime: nvidia
12+
volumes:
13+
- "/etc/timezone:/etc/timezone:ro" # Set timezone to host timezone.
14+
- "/etc/localtime:/etc/localtime:ro" # Set time to host time.
15+
command: ["-ethAcctAddr", "0x2390f4d31cB118fB23De052754549F1f325497C1"]
16+
17+
networks:
18+
default:
19+
name: livepool_pool

0 commit comments

Comments
 (0)