Skip to content

0xaaaaaron/crynux-node

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTE: If you don't need to change the code, please use the prebuilt packages to start the node:

Start a node on Windows

Start a node on Mac

Start a node using Docker

Crynux Node for the Helium(He) Network

Start a Crynux Node to share the spared local GPU to others in exchange for tokens. Crynux Node will join the Crynux Network, receive the AI inference/training/fine-tuning tasks from the network, and execute them locally.

Crynux Node WebUI

Start the node from source code

Prepare the config file

Copy config/config.yml.shell_example to config/config.yml. And adjust the file content according to your need:

# In the root folder of the project
$ cp config/config.yml.shell_example config/config.yml

Prepare the server venv

  1. Create the venv in the root folder of the project:
# In the root folder of the project
$ python -m venv venv
  1. Activate the venv and install the requirements:
# In the root folder of the project

# Use ./venv/Scripts/Activate.ps1 on Windows
$ ./venv/bin/activate

# Use requirements_macos.txt on Mac
(venv) $ pip install -r ./requirements_docker.txt
(venv) $ pip install .

Prepare the worker venv

  1. Get the source code of stable-diffusion-task and gpt-task using Git submodule:
# In the root folder of the project
$ git submodule update --init --recursive
  1. Create a folder named "worker" under the root folder of the project, and copy src/crynux_worker_process.py to the folder:
# In the root folder of the project

$ mkdir worker
$ cp src/crynux_worker_process.py worker/
  1. Create the venv under the worker folder:
# In the root folder of the project

$ cd worker
$ python -m venv venv
  1. Activate the venv and install the requirements for stable-diffusion-task and gpt-task:
# In the worker folder

# Use ./venv/Scripts/Activate.ps1 on Windows
$ ./venv/bin/activate

# Install the stable-diffusion-task package
(venv) $ cd ../stable-diffusion-task

## Use requirements_macos.txt on Mac
(venv) $ pip install -r requirements_cuda.txt
(venv) $ pip install .

# Install the gpt-task package
(venv) $ cd ../gpt-task

# Use requirements_macos.txt on Mac
(venv) $ pip install -r requirements_cuda.txt
(venv) $ pip install .

Prepare the WebUI

  1. Prepare the config file
# Go to the root folder of the webui
$ cd src/webui

# Create the config file from the example
$ cp src/config.example.json src/config.json
  1. Build the WebUI distribution package
# In the root folder of the webui

# Install the dependencies
$ yarn

# Build the package
$ yarn build

Start the node

Activate the server's venv, and start from the src/app/main.py script:

# In the root folder of the project

# Use ./venv/Scripts/Activate.ps1 on Windows
$ ./venv/bin/activate

(venv) $ python src/app/main.py

Build the Docker image from the source code

  1. Clone the project
# git clone https://github.com/crynux-ai/crynux-node.git
  1. Go to the root folder of the project
# cd crynux-node
  1. Build the Docker image
# docker build -t crynux-node:dev -f .\build\Dockerfile . 
  1. Start the container
# docker run -d -p 127.0.0.1:7412:7412 --gpus all crynux-node:dev

Build the binary package on Mac

Please refer to the README for the detailed instructions on building the MacOS binary package.

Build the binary package on Windows

Please refer to the README for the detailed instructions on building the Windows binary package.

Run tests

  1. Clone the project
# git clone https://github.com/crynux-ai/crynux-node.git
  1. Go to the root folder of the project
# cd crynux-node
  1. Install the dependencies and package (preferably in a virtualenv)
# pip install -r requirements_docker.txt && pip install .[test]
  1. Run tests
# pytest tests

About

Crynux Node for the Helium(He) Network

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 84.9%
  • Vue 9.2%
  • JavaScript 1.9%
  • Shell 1.7%
  • PowerShell 1.1%
  • Dockerfile 0.5%
  • Other 0.7%