Skip to content

Commit 2383045

Browse files
author
Simon Goldberg
committed
Updated PR #158 after running pre-commit
1 parent 85d10cf commit 2383045

File tree

9 files changed

+412
-24
lines changed

9 files changed

+412
-24
lines changed

lib/allora/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ This blueprint is designed to assist in deploying a single Allora [Worker Node](
2525
![Single Worker Node Deployment](./doc/assets/Architecture-Single-Allora-Worker-Node.png)
2626

2727
The AWS Cloud Development Kit (CDK) is used to deploy a single Allora Worker Node. The CDK application deploys the following infrastructure:
28-
28+
2929
- Virtual Private Cloud (VPC)
3030
- Internet Gateway (IGW) to allow inbound requests for inferences from consumers and outbound responses from the worker node revealing inferences
3131
- Public subnet that has a direct route to the IGW
3232
- Security Group (SG) with TCP Port 9010 open inbound allowing requests for inferences to be routed to the Allora Worker Node
3333
- Single Amazon Elastic Compute Cloud (EC2) instance (the Allora Worker Node) assigned to the public subnet
3434

35-
The Allora Worker Node is accessed by the user internally and is not exposed to the Internet to protect the node from unauthorized access. A user can gain access to the EC2 Instance using AWS Session Manager.
35+
The Allora Worker Node is accessed by the user internally and is not exposed to the Internet to protect the node from unauthorized access. A user can gain access to the EC2 Instance using AWS Session Manager.
3636

3737
Multiple processes run on the Allora Worker Node (EC2 instance):
3838

@@ -41,7 +41,7 @@ Multiple processes run on the Allora Worker Node (EC2 instance):
4141

4242
Allora Public Head Nodes publish the Allora chain requests (requests for inferences from consumers) to Allora worker nodes. When a worker node is initialized, it starts with an environment variable called BOOT_NODES, which helps handle the connection and communications between worker nodes and the head nodes.
4343

44-
The worker node (docker container) will call the function that invokes custom logic that handles the actual inference. The request-response is a bidirectional flow from the Allora chain (inference requests from consumers) to the public head nodes to the worker node and finally to the model server that reveals inferences.
44+
The worker node (docker container) will call the function that invokes custom logic that handles the actual inference. The request-response is a bidirectional flow from the Allora chain (inference requests from consumers) to the public head nodes to the worker node and finally to the model server that reveals inferences.
4545

4646
## Additional materials
4747

@@ -68,7 +68,7 @@ This is the Well-Architected checklist for the Allora worker nodes implementatio
6868
| Performance efficiency | Compute selection | How is compute solution selected? | Compute solution is selected based on best price-performance, i.e. AWS EC2 T3 Medium instance suitable for bursty workloads. |
6969
| | Storage selection | How is storage solution selected? | Storage solution is selected based on best price-performance, i.e. Amazon EBS volumes with optimal IOPS and throughput. |
7070
| | Architecture selection | How is the best performance architecture selected? | A combination of recommendations from the Allora Network community and Allora Labs testing. |
71-
| Sustainability | Hardware & services | Select most efficient hardware for your workload | The solution uses AMD-powered instances. There is a potential to use AWS Graviton-based Amazon EC2 instances which offer the best performance per watt of energy use in Amazon EC2.
71+
| Sustainability | Hardware & services | Select most efficient hardware for your workload | The solution uses AMD-powered instances. There is a potential to use AWS Graviton-based Amazon EC2 instances which offer the best performance per watt of energy use in Amazon EC2.
7272
</details>
7373

7474
## Worker Node System Requirements
@@ -230,4 +230,4 @@ aws ssm start-session --target $INSTANCE_ID --region $AWS_REGION
230230
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
231231
b10c12c51f32 worker-worker "allora-node allora-…" 18 hours ago Exited (2) 18 hours ago worker
232232
05273577ce7a alloranetwork/allora-inference-base-head:latest "allora-node allora-…" 18 hours ago Exited (2) 18 hours ago head
233-
```
233+
```

lib/allora/allora.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ new EdgeCommonStack(app, "allora-edge-common", {
3131

3232
new AlloraStack(app, 'allora-single-node', {
3333
stackName: 'allora-single-node',
34-
env: {
34+
env: {
3535
account: process.env.AWS_ACCOUNT_ID || "xxxxxxxxxxx",
3636
region: process.env.AWS_REGION || 'us-east-1',
3737
},
@@ -77,7 +77,7 @@ new AlloraStack(app, 'allora-single-node', {
7777
alloraWorkerInferenceEndpoint: process.env.ALLORA_WORKER_INFERENCE_ENDPOINT || 'http://source:8000/inference/{Token}',
7878
alloraWorkerLoopSeconds: process.env.ALLORA_WORKER_LOOP_SECONDS || '30',
7979
alloraWorkerToken: process.env.ALLORA_WORKER_TOKEN || 'ethereum',
80-
80+
8181
//Reputer Properties
8282
alloraReputerTopicId: process.env.ALLORA_REPUTER_TOPIC_ID || '1',
8383
alloraReputerEntrypointName: process.env.ALLORA_REPUTER_ENTRYPOINT_NAME || 'api-worker-reputer',

lib/allora/doc/assets/Architecture-Single-Allora-Worker-Node-Source.drawio

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,4 @@
119119
</root>
120120
</mxGraphModel>
121121
</diagram>
122-
</mxfile>
122+
</mxfile>

lib/allora/lib/allora-stack.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ export class AlloraStack extends cdk.Stack {
7272
super(scope, id, props);
7373

7474
const {
75-
env,
76-
instanceType,
77-
resourceNamePrefix,
78-
dataVolume,
79-
alloraWorkerName,
75+
env,
76+
instanceType,
77+
resourceNamePrefix,
78+
dataVolume,
79+
alloraWorkerName,
8080
alloraEnv,
8181
modelRepo,
8282
modelEnvVars,
@@ -125,7 +125,7 @@ export class AlloraStack extends cdk.Stack {
125125
const STACK_NAME = cdk.Stack.of(this).stackName;
126126
const STACK_ID = cdk.Stack.of(this).stackId;
127127

128-
128+
129129

130130
// Create S3 Bucket
131131
const bucket = new s3.Bucket(this, `${resourceNamePrefix}Bucket`, {
@@ -159,7 +159,7 @@ export class AlloraStack extends cdk.Stack {
159159
});
160160
securityGroup.addIngressRule(ec2.Peer.anyIpv4(), ec2.Port.tcp(9010), 'Allow inbound TCP 9010');
161161

162-
162+
163163

164164

165165
// Getting the snapshot bucket name and IAM role ARN from the common stack
@@ -208,7 +208,7 @@ export class AlloraStack extends cdk.Stack {
208208

209209
//wallet config
210210
_ALLORA_WALLET_ADDRESS_KEY_NAME_ : alloraWalletAddressKeyName,
211-
_ALLORA_WALLET_ADDRESS_RESTORE_MNEMONIC_ : alloraWalletAddressRestoreMnemonic,
211+
_ALLORA_WALLET_ADDRESS_RESTORE_MNEMONIC_ : alloraWalletAddressRestoreMnemonic,
212212
_ALLORA_WALLET_HOME_DIR_: alloraWalletHomeDir,
213213
_ALLORA_WALLET_GAS_ADJUSTMENT_: alloraWalletGasAdjustment,
214214
_ALLORA_WALLET_GAS_: alloraWalletGas,
@@ -220,7 +220,7 @@ export class AlloraStack extends cdk.Stack {
220220
_ALLORA_WALLET_WINDOW_CORRECTION_FACTOR_: alloraWalletWindowCorrectionFactor,
221221
_ALLORA_WALLET_MAX_FEES_: alloraWalletMaxFees,
222222
_ALLORA_WALLET_ACCOUNT_SEQUENCE_RETRY_DELAY_: alloraWalletAccountSequenceRetryDelay,
223-
223+
224224
_ALLORA_WALLET_NODE_RPC_: alloraWalletNodeRpc,
225225
_ALLORA_WALLET_MAX_RETRIES_: alloraWalletMaxRetries,
226226
_ALLORA_WALLET_DELAY_: alloraWalletDelay,
@@ -245,7 +245,7 @@ export class AlloraStack extends cdk.Stack {
245245
_ALLORA_REPUTER_TOKEN_: alloraReputerToken,
246246
_ALLORA_REPUTER_MIN_STAKE_: alloraReputerMinStake,
247247

248-
248+
249249
});
250250

251251
// Create UserData for EC2 instance

lib/allora/lib/assets/node-cw-dashboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,4 +576,4 @@ const instance_storage_types = new Set(["d3en.12xlarge",
576576
"r3.large",
577577
"c3.large",
578578
"m3.large",
579-
"m3.medium"])
579+
"m3.medium"])

lib/allora/lib/assets/user-data/node.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ cd node-repo
106106
git checkout $ALLORA_ENV
107107

108108
cp config.cdk.json.template config.json
109-
cd
109+
cd
110110
#wallet config str replace
111111
sed -i "s/_ALLORA_WALLET_ADDRESS_KEY_NAME_/$ALLORA_WALLET_ADDRESS_KEY_NAME/" config.json
112112
sed -i "s/_ALLORA_WALLET_ADDRESS_RESTORE_MNEMONIC_/$ALLORA_WALLET_ADDRESS_RESTORE_MNEMONIC/" config.json
@@ -171,12 +171,12 @@ echo -e "$MODEL_ENV_VARS" >> .env
171171
echo 'building basic worker'
172172
chmod +x init.config
173173
./init.config
174-
docker-compose up --build
174+
docker-compose up --build
175175

176176
echo "----------------------------------------------"
177177
echo "[user-data] Allora user-data script successful"
178178
echo "----------------------------------------------"
179179

180180

181181
#ping the server for an inference response to $ALLORA_WORKER_INFERENCE_ENDPOINT/inference/$ALLORA_WORKER_TOKEN
182-
curl "$ALLORA_WORKER_INFERENCE_ENDPOINT/inference/$ALLORA_WORKER_TOKEN"
182+
curl "$ALLORA_WORKER_INFERENCE_ENDPOINT/inference/$ALLORA_WORKER_TOKEN"

0 commit comments

Comments
 (0)