Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kush/node runners #29

Merged
merged 9 commits into from
Jul 8, 2024
1 change: 1 addition & 0 deletions pages/datasci/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"requirements": "System Requirements",
"deploy-worker-with-allocmd": "Deploy a Worker with allocmd",
"build-and-deploy-worker-from-scratch": "Build and Deploy Worker from Scratch",
"build-and-deploy-worker-with-node-runners": "Build and Deploy Worker with AWS Node Runners",
"register-worker-node": "Register a Worker Node",
"connect-worker-node": "Connect a Worker Node to the Allora Network",
"walkthrough-hugging-face-worker": "Walkthrough: Hugging Face Worker",
Expand Down
62 changes: 62 additions & 0 deletions pages/datasci/build-and-deploy-worker-with-node-runners.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Build and Deploy a Worker Node With AWS Node Runners

Welcome to the AWS Node Runners documentation! This page provides detailed instructions on how to leverage Node Runners on AWS, including benefits, setup instructions, and useful links.

## Overview

Node Runners on AWS enables you to deploy and manage blockchain nodes efficiently using AWS infrastructure. Whether you're deploying Ethereum nodes or other blockchain networks, Node Runners simplifies the process, offering scalability, reliability, and cost-effectiveness.

For more detailed information and step-by-step guides, please refer to the [AWS Node Runners Documentation](https://aws-samples.github.io/aws-blockchain-node-runners/docs/Blueprints/Ethereum).

### Allora Network's AWS Infrastructure

This diagram illustrates the architecture of the integration between the Allora Network (built on a Cosmos AppChain) and an AWS-based infrastructure for handling inference requests.

![node-runners](/aws-node-runners.png)

#### Key Components

1. **Allora Network (Cosmos AppChain)**
- **Public Head Node**: Acts as the entry point for the Allora Network, handling requests and responses.

2. **AWS Account Setup**
- **Region**: The geographical location within AWS where the resources are deployed.
- **Virtual Private Cloud (VPC)**: Provides an isolated network environment within the AWS region.
- **Public Subnet**: A subnet within the VPC that has access to the internet through the VPC Internet Gateway.
- **VPC Internet Gateway**: Allows communication between the instances in the VPC and the internet.

3. **EC2 Instance (Allora Worker Node)**
- **Inference Base**: This component handles network communication, receiving requests from the Allora Network's Public Head Node and sending responses back.
- **Node Function**: Processes requests by interfacing with the private model server. It acts as an intermediary, ensuring the requests are correctly formatted and the responses are appropriately handled.
- **Model Server**: Hosts the proprietary model. It executes the main inference script (`Main.py`) to generate inferences based on the received requests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here


#### Process Flow

1. **Request Flow**:
- The Allora Network's Public Head Node sends a request for inferences to the EC2 instance within the AWS environment.
- The request passes through the VPC Internet Gateway and reaches the Inference Base in the public subnet.
- The Inference Base forwards the request to the Node Function.
- The Node Function calls `Main.py` on the Model Server to generate the required inferences.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The python file name is lower case: main.py


2. **Response Flow**:
- The Model Server processes the request and returns the inferences to the Node Function.
- The Node Function sends the inferences back to the Inference Base.
- The Inference Base communicates the inferences back to the Allora Network's Public Head Node via the VPC Internet Gateway.

## AWS Activate

Before proceeding, please note that eligibility for AWS Activate credits and terms are governed by AWS. This documentation may become outdated, so ensure you refer to the [AWS Activate program page](https://aws.amazon.com/startups/credits#hero) for the latest eligibility requirements and instructions.

## AWS Activate Stepwise Process

To receive up to $5,000 in AWS Activate credits, follow these steps:

1. **Fill out our [Typeform](https://vk4z45e3hne.typeform.com/to/TVwcjiL1)**: Provide your details to receive our Activate Provider Organizational ID.
- Name (required)
- Contact Information (optional): Email, Telegram, Discord handle, Linkedin
- Official Company Website (required)

2. **AWS Activate High-Level Instructions**: After obtaining our Organizational ID,
- Visit [AWS Activate Credit Packages](https://aws.amazon.com/startups/credits#packages).
- Apply through the Activate Portfolio

23 changes: 22 additions & 1 deletion pages/reputers/register-reputer-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,26 @@ Registering a reputer node on the Allora Network requires downloading the `allor
```
- Fund the Key on the network environment you plan to run the reputer, (i.e. testnet faucet, the reputer will be running on testnet). One can obtain funds on our testnet through our faucet as [explained here](../devs/how-to-use-faucet).
- The node will initialize and verify its registration on the chain, and then attempt a registration transaction using the provided configuration. As long as the account is funded, this registration process should be seamless, and the node should automatically update when needed through this path.

## Using Docker to Access `allora-node`

You will need to access the node's command line in order to register it. To access `allora-node` using Docker, follow these steps:

1. Run the following commands to obtain the `container-id` of the specific node you want to register
```bash
$ docker compose up
$ docker ps # choose container
```

2. Once you have the `container-id`, access the node's command line

```bash
$ docker exec -it <container_id> bash
~$ allora-node --help
```

## Register the Node

- When initializing the node, you need to use allora flags to be able to successfully register. The whole set of options can be seen by running `allora-node --help`. The most important ones are:
- ```Text bash
--allora-chain-home-dir /data/.allorad #The home folder of the client, use the user home if not set
Expand All @@ -25,4 +45,5 @@ Registering a reputer node on the Allora Network requires downloading the `allor

If the transaction is successfully processed, the initial stake amount set in the flag plus the registration fee will be deducted from the account, and you will be able to start participating as a reputer in the topic.

The node will create a registration to the Allora L1 using this key information for registration.
The node will create a registration to the Allora L1 using this key information for registration.

6 changes: 3 additions & 3 deletions pages/reputers/reputers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ Here we'll setup a reputer with only the "truth service", which fetches the grou

To only test the truth service, you can simply follow these steps:

- Run `docker compose up --build truth` and wait for the initial data load.
- Run `docker compose up --build data-provider` and wait for the initial data load.
- Requests can now be sent, e.g. ETH price ground truths can be fetched with:
```
$ curl http://localhost:8000/get/ETHUSD/1711105645
{"value":"3227.311942291347"}
$ curl http://localhost:8000/gt/ETHUSD/1719565747
{"value":"3431.440268842158"}
```
or you can trigger an update to the current ETH price:
```
Expand Down
Binary file added public/aws-node-runners.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/node-runners.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading