Skip to main content

Golem Workers is an API providing direct and high-level access to GPU and CPU resources on the Golem Network.

Project description

cluster-api

Getting started

Currently cluster-api is only available for used via direct installation from git repository. Here are some steps to prepare local development environment.

Prerequisites

cluster-api uses poetry for project management and poethepoet for task running. To install those tools you can use pipx:

pipx install poetry poethepoet

or just pip:

pip install poetry poethepoet

Also, cluster-api needs some instance of golem-node to interact with Golem Network. Download newest stable version golem-requestor-<your OS type> and make sure that its binaries are available from your PATH environment variable.

Optionally, if you want to use simpler startup, install Docker.

Installation

  1. Clone the repo
    git clone https://github.com/golemfactory/cluster-api
    
  2. Go inside of the newly created directory
    cd cluster-api
    
  3. Install project dependencies
    poetry install
    

Running

The are multiple ways to run cluster-api instance. Below are two of the simplest ways to start it.

Docker example

  1. Start Docker instance and make sure that is running and the current user have access to it.

  2. Go to docker example directory.

    cd examples/docker
    
  3. Build and start compose project in the background. Note that at current stage, your Python and Poetry version needs to match versions used in Dockerfile. Note that because of decentralized fashion, golem-node needs a moment to gather information from the Golem Network and amount of returned proposals can be impacted.

    docker compose up -d --build
    
  4. Prepare some funds for Golem's free test network. Note that this step is needed mostly once per yagna-data volume.

    docker compose exec golem-node yagna payment fund
    

Development

  1. Start golem-node instance in dedicated terminal session. Note that because of decentralized fashion, golem-node needs a moment to gather information from the Golem Network and amount of returned proposals can be impacted.

    yagna service start
    
  2. Prepare some funds for Golem's free test network. Note that this step is needed mostly once per golem-node installation.

    yagna payment fund
    
  3. Create new golem-node application token

    yagna app-key create <your-token-name>
    

    and create .env file at the root of the repo and put there

    YAGNA_APPKEY=<your-application-token>
    
  4. Start cluster-api instance

    poetry run fastapi dev golem_cluster_api/main.py --no-reload
    

Usage

Cluster-api can be interacted with web api at http://localhost:8000. It's OpenApi Specification is available at http://localhost:8000/docs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

golem_workers-0.0.1.tar.gz (23.6 kB view hashes)

Uploaded Source

Built Distribution

golem_workers-0.0.1-py3-none-any.whl (31.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page