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

Allora - Pr 158 -- resolution #170

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
86fb2ae
Create README.md
allora-rc Jun 27, 2024
b583d83
Create file.txt
allora-rc Jun 27, 2024
4147ed6
Add files via upload
allora-rc Jun 27, 2024
662bcd9
Update README.md
allora-rc Jun 27, 2024
9cc8fc4
working
Madisonw Jun 28, 2024
dc6637d
allora stack
Madisonw Jun 28, 2024
dd686fd
update readme
Madisonw Jun 28, 2024
37f914c
added tests, redid project structure, added .env sample, deleted file…
Madisonw Jul 1, 2024
9845ecc
adding drawing source and fixing scripts to with in c9
Madisonw Jul 3, 2024
abc4db3
user-data script
Madisonw Jul 3, 2024
85042cb
adding types: [ node ] to tsconfig, and uploading the node.sh script …
Madisonw Jul 9, 2024
a868467
success msg
Madisonw Jul 9, 2024
ff3c3c3
adding allora.md to website
Madisonw Jul 9, 2024
8415f6b
using singlenodeconstruct
Madisonw Jul 10, 2024
9853f57
added: cdk-nag, changed @type source, removed package-lock, using Sin…
Madisonw Jul 10, 2024
9dce197
instance role and fixing issue with EIP
Madisonw Jul 10, 2024
c221022
user-data still freezing the instance
Madisonw Jul 12, 2024
569cf95
installing pip differently
Madisonw Jul 12, 2024
e37c868
user-data script
Madisonw Jul 18, 2024
71423d8
venv approach
Madisonw Jul 23, 2024
0771b73
using amazon AMI
Madisonw Jul 23, 2024
174635c
no package-lock
Madisonw Jul 23, 2024
f73dd0d
restore package-lock
Madisonw Jul 23, 2024
e36c476
updating the readme, and the draw png/source
Madisonw Jul 24, 2024
85c2976
adding allocmd to user-data
Madisonw Jul 24, 2024
e263525
adding allocmd generate command and parameterization
Madisonw Jul 26, 2024
00d0180
test env file
Madisonw Jul 26, 2024
3421a2d
updating readme with FAQ
Madisonw Jul 26, 2024
ce0dfd6
undeploy common cleanup step
Madisonw Jul 26, 2024
7a4bf05
typo on stack name
Madisonw Jul 26, 2024
b18b613
changing the way we build the node, and adding a bunch of env variabl…
Madisonw Aug 5, 2024
5390898
adding many configs for the new version of the offhcain node repo
Madisonw Aug 13, 2024
fc794b3
adding model repo cloning
Madisonw Aug 30, 2024
560d3c8
using docker-compose for both inner and outer
Madisonw Sep 3, 2024
9152b1a
updating to use configurable model repo
Madisonw Sep 6, 2024
e911b50
adding ability to config inner node
Madisonw Sep 11, 2024
0cf78e2
small adjustments but is ready to go
Madisonw Sep 11, 2024
b280e29
volume name
Madisonw Sep 12, 2024
c3f8e36
updating to new version of offchain node
Madisonw Dec 24, 2024
2b94d44
Merge branch 'main' into vec4/allora-cdk
Madisonw Dec 24, 2024
d326df9
Merge branch 'main' into vec4/allora-cdk
frbrkoala Dec 27, 2024
85d10cf
Merge branch 'main' into vec4/allora-cdk
frbrkoala Jan 24, 2025
2383045
Updated PR #158 after running pre-commit
Feb 12, 2025
7b9efad
Modfied allora.test.ts to incorporate additional stack params
Feb 12, 2025
dd9d1cd
Merge branch 'pr-158' of https://github.com/aws-samples/aws-blockchai…
vlasonfa Feb 13, 2025
a579cd3
Allora. Refactored CDK and user-data. Node failes to start
vlasonfa Feb 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
8 changes: 8 additions & 0 deletions lib/allora/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.js
!jest.config.js
*.d.ts
node_modules

# CDK asset staging directory
.cdk.staging
cdk.out
6 changes: 6 additions & 0 deletions lib/allora/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.ts
!*.d.ts

# CDK asset staging directory
.cdk.staging
cdk.out
237 changes: 237 additions & 0 deletions lib/allora/README.md

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions lib/allora/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env node
import 'dotenv/config';
import 'source-map-support/register';
import * as cdk from 'aws-cdk-lib';
import { AlloraCommonStack } from "./lib/common-stack";
import { AlloraStack } from './lib/single-node-stack';
import { baseConfig, singleNodeConfig } from './lib/config/node-config';

const app = new cdk.App();

new AlloraCommonStack(app, "allora-common", {
stackName: `allora-common`,
env: { account: baseConfig.accountId, region: baseConfig.region },
});

new AlloraStack(app, 'allora-single-node', {
stackName: 'allora-single-node',
env: {
account: baseConfig.accountId,
region: baseConfig.region
},
...singleNodeConfig
});
72 changes: 72 additions & 0 deletions lib/allora/cdk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"app": "npx ts-node --prefer-ts-exts app.ts",
"watch": {
"include": [
"**"
],
"exclude": [
"README.md",
"cdk*.json",
"**/*.d.ts",
"**/*.js",
"tsconfig.json",
"package*.json",
"yarn.lock",
"node_modules",
"test"
]
},
"context": {
"@aws-cdk/aws-lambda:recognizeLayerVersion": true,
"@aws-cdk/core:checkSecretUsage": true,
"@aws-cdk/core:target-partitions": [
"aws",
"aws-cn"
],
"@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
"@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
"@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
"@aws-cdk/aws-iam:minimizePolicies": true,
"@aws-cdk/core:validateSnapshotRemovalPolicy": true,
"@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true,
"@aws-cdk/aws-s3:createDefaultLoggingPolicy": true,
"@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true,
"@aws-cdk/aws-apigateway:disableCloudWatchRole": true,
"@aws-cdk/core:enablePartitionLiterals": true,
"@aws-cdk/aws-events:eventsTargetQueueSameAccount": true,
"@aws-cdk/aws-iam:standardizedServicePrincipals": true,
"@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true,
"@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true,
"@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true,
"@aws-cdk/aws-route53-patters:useCertificate": true,
"@aws-cdk/customresources:installLatestAwsSdkDefault": false,
"@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true,
"@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true,
"@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true,
"@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true,
"@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true,
"@aws-cdk/aws-redshift:columnId": true,
"@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true,
"@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": true,
"@aws-cdk/aws-apigateway:requestValidatorUniqueId": true,
"@aws-cdk/aws-kms:aliasNameRef": true,
"@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": true,
"@aws-cdk/core:includePrefixInUniqueNameGeneration": true,
"@aws-cdk/aws-efs:denyAnonymousAccess": true,
"@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": true,
"@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": true,
"@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": true,
"@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": true,
"@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": true,
"@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": true,
"@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true,
"@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": true,
"@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse": true,
"@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2": true,
"@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope": true,
"@aws-cdk/aws-eks:nodegroupNameAttribute": true,
"@aws-cdk/aws-ec2:ebsDefaultGp3Volume": true,
"@aws-cdk/aws-ecs:removeDefaultDeploymentAlarm": true,
"@aws-cdk/custom-resources:logApiResponseDataPropertyTrueDefault": false
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<mxfile host="app.diagrams.net" modified="2024-07-24T01:08:34.766Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" version="24.6.4" etag="3z6mRWU6WvMbnayaXaUI" type="google">
<diagram name="Page-1" id="Z24EPSqC7-ZLOVr7-3XL">
<mxGraphModel dx="3205" dy="1023" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="2" value="AWS Account" style="html=1;overflow=block;blockSpacing=1;whiteSpace=wrap;fontSize=18.3;fontColor=#232f3e;spacing=0;strokeColor=#232f3e;strokeOpacity=100;fillOpacity=0;rounded=1;absoluteArcSize=1;arcSize=12;fillColor=#ffffff;strokeWidth=2.3;container=1;pointerEvents=0;collapsible=0;recursiveResize=0;lucidId=_YvMQiWvPY6W;" vertex="1" parent="1">
<mxGeometry x="915" y="195" width="1680" height="990" as="geometry" />
</mxCell>
<mxCell id="3" value="Region" style="html=1;overflow=block;blockSpacing=1;whiteSpace=wrap;fontSize=18.3;fontColor=#147eba;spacing=0;strokeColor=#147eba;strokeOpacity=100;fillOpacity=0;rounded=1;absoluteArcSize=1;arcSize=12;fillColor=#ffffff;dashed=1;fixDash=1;dashPattern=6 5;strokeWidth=2.3;container=1;pointerEvents=0;collapsible=0;recursiveResize=0;lucidId=9QJM80IVYh6_;" vertex="1" parent="1">
<mxGeometry x="960" y="240" width="1590" height="900" as="geometry" />
</mxCell>
<mxCell id="4" value="Virtual Private Cloud (VPC)" style="html=1;overflow=block;blockSpacing=1;whiteSpace=wrap;fontSize=18.3;fontColor=#248814;spacing=0;strokeColor=#248814;strokeOpacity=100;fillOpacity=0;rounded=1;absoluteArcSize=1;arcSize=12;fillColor=#ffffff;strokeWidth=2.3;container=1;pointerEvents=0;collapsible=0;recursiveResize=0;lucidId=TXJMV_QqjrSG;" vertex="1" parent="1">
<mxGeometry x="1005" y="285" width="1500" height="810" as="geometry" />
</mxCell>
<mxCell id="5" value="Public Subnet" style="html=1;overflow=block;blockSpacing=1;whiteSpace=wrap;fontSize=18.3;fontColor=#248814;spacing=0;strokeColor=none;strokeOpacity=100;fillOpacity=13;rounded=1;absoluteArcSize=1;arcSize=12;fillColor=#248814;strokeWidth=0;container=1;pointerEvents=0;collapsible=0;recursiveResize=0;lucidId=XgKM0bekm8-m;" vertex="1" parent="1">
<mxGeometry x="1261" y="488" width="1034" height="428" as="geometry" />
</mxCell>
<mxCell id="6" value="Availability Zone (AZ)" style="html=1;overflow=block;blockSpacing=1;whiteSpace=wrap;fontSize=18.3;fontColor=#147eba;spacing=0;strokeColor=#147eba;strokeOpacity=100;fillOpacity=0;rounded=1;absoluteArcSize=1;arcSize=12;fillColor=#ffffff;dashed=1;fixDash=1;dashPattern=6 5;strokeWidth=2.3;container=1;pointerEvents=0;collapsible=0;recursiveResize=0;lucidId=CyLM2.gjfOU.;" vertex="1" parent="1">
<mxGeometry x="1231" y="450" width="1094" height="499" as="geometry" />
</mxCell>
<mxCell id="7" value="EC2 Instance (Allora Worker Node running Docker)" style="html=1;overflow=block;blockSpacing=1;whiteSpace=wrap;fontSize=18.5;fontColor=#d86613;spacing=0;verticalAlign=top;strokeColor=#d86613;strokeOpacity=100;fillOpacity=100;rounded=1;absoluteArcSize=1;arcSize=12;fillColor=#ffffff;strokeWidth=2.3;container=1;pointerEvents=0;collapsible=0;recursiveResize=0;lucidId=-u2NlGh-AkDf;" vertex="1" parent="1">
<mxGeometry x="1456" y="555" width="629" height="264" as="geometry" />
</mxCell>
<mxCell id="8" value="" style="group;dropTarget=0;pointerEvents=0;" vertex="1" parent="1">
<mxGeometry as="geometry" />
</mxCell>
<mxCell id="9" value="" style="group;dropTarget=0;pointerEvents=0;" vertex="1" parent="1">
<mxGeometry as="geometry" />
</mxCell>
<mxCell id="10" value="" style="html=1;overflow=block;blockSpacing=1;whiteSpace=wrap;fontSize=13;align=center;spacing=3.8;strokeColor=#unset;rounded=1;absoluteArcSize=1;arcSize=12;fillColor=#unset;strokeWidth=NaN;lucidId=7X7MiWF~K5Hu;" vertex="1" parent="1">
<mxGeometry x="-75" y="525" width="420" height="330" as="geometry" />
</mxCell>
<mxCell id="11" value="" style="html=1;jettySize=18;whiteSpace=wrap;fontSize=13;strokeColor=#3a414a;strokeOpacity=100;strokeWidth=0.8;rounded=1;arcSize=24;edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=block;endFill=1;entryX=0;entryY=0.156;entryPerimeter=0;lucidId=FY7MXUKkzTnU;" edge="1" target="27" parent="1">
<mxGeometry width="100" height="100" relative="1" as="geometry">
<Array as="points" />
<mxPoint x="675" y="689" as="sourcePoint" />
</mxGeometry>
</mxCell>
<mxCell id="12" value="Request for Inferences" style="text;html=1;resizable=0;labelBackgroundColor=default;align=center;verticalAlign=middle;fontColor=#333333;fontSize=18.3;" vertex="1" parent="11">
<mxGeometry x="-0.7296296296296296" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="13" value="Allora Network&#xa;Public Head Nodes" style="html=1;overflow=block;blockSpacing=1;whiteSpace=wrap;fontSize=18.3;align=center;spacing=0;verticalAlign=middle;strokeColor=#5a6c86;strokeOpacity=100;fillOpacity=0;rounded=1;absoluteArcSize=1;arcSize=12;fillColor=#ffffff;strokeWidth=2.3;container=1;pointerEvents=0;collapsible=0;recursiveResize=0;lucidId=Q51NzTwxD9la;" vertex="1" parent="1">
<mxGeometry x="495" y="675" width="165" height="75" as="geometry" />
</mxCell>
<mxCell id="14" value="" style="html=1;jettySize=18;whiteSpace=wrap;fontSize=13;strokeColor=#3a414a;strokeOpacity=100;strokeWidth=0.8;rounded=1;arcSize=24;edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=block;endFill=1;exitX=0;exitY=0.657;exitPerimeter=0;entryX=1.007;entryY=0.788;entryPerimeter=0;lucidId=kj2NyueEfGJ9;" edge="1" source="27" target="13" parent="1">
<mxGeometry width="100" height="100" relative="1" as="geometry">
<Array as="points" />
</mxGeometry>
</mxCell>
<mxCell id="15" value="Response with Inferences" style="text;html=1;resizable=0;labelBackgroundColor=default;align=center;verticalAlign=middle;fontColor=#333333;fontSize=18.3;" vertex="1" parent="14">
<mxGeometry x="0.6843987246741681" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="16" value="" style="html=1;jettySize=18;whiteSpace=wrap;fontSize=13;strokeColor=#3a414a;strokeOpacity=100;strokeWidth=0.8;rounded=1;arcSize=24;edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=block;endFill=1;lucidId=3W2NCLsf5O8j;" edge="1" parent="1">
<mxGeometry width="100" height="100" relative="1" as="geometry">
<Array as="points" />
<mxPoint x="345" y="692" as="sourcePoint" />
<mxPoint x="495" y="692" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="17" value="Request" style="text;html=1;resizable=0;labelBackgroundColor=default;align=center;verticalAlign=middle;fontColor=#333333;fontSize=18.3;" vertex="1" parent="16">
<mxGeometry relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="18" value="" style="html=1;jettySize=18;whiteSpace=wrap;fontSize=13;strokeColor=#3a414a;strokeOpacity=100;strokeWidth=0.8;rounded=1;arcSize=24;edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=block;endFill=1;lucidId=BZ2N9~-V4MCM;" edge="1" parent="1">
<mxGeometry width="100" height="100" relative="1" as="geometry">
<Array as="points" />
<mxPoint x="495" y="735" as="sourcePoint" />
<mxPoint x="345" y="735" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="19" value="Response" style="text;html=1;resizable=0;labelBackgroundColor=default;align=center;verticalAlign=middle;fontColor=#333333;fontSize=18.3;" vertex="1" parent="18">
<mxGeometry x="-0.10999999999999999" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="20" value="VPC Internet Gateway" style="html=1;overflow=block;blockSpacing=1;whiteSpace=wrap;shape=mxgraph.aws3.internet_gateway;labelPosition=center;verticalLabelPosition=bottom;align=center;verticalAlign=top;pointerEvents=1;fontSize=18.3;fontColor=#3a414a;spacing=3.8;strokeColor=#3a414a;strokeOpacity=100;rounded=1;absoluteArcSize=1;arcSize=12;fillColor=#f58536;strokeWidth=0.8;lucidId=H07MxiphtlWI;" vertex="1" parent="1">
<mxGeometry x="1035" y="645" width="120" height="135" as="geometry" />
</mxCell>
<mxCell id="21" value="" style="html=1;overflow=block;blockSpacing=1;whiteSpace=wrap;shape=image;fontSize=13;spacing=0;verticalAlign=top;strokeColor=none;strokeOpacity=0;rounded=1;absoluteArcSize=1;arcSize=12;dashed=1;fixDash=1;dashPattern=1 4;strokeWidth=0;image=https://images.lucid.app/images/26d560da-be5f-4e5a-8a1f-d08955e03b65/content;imageAspect=0;lucidId=Nr3NNLmmP2up;" vertex="1" parent="1">
<mxGeometry x="-13" y="600" width="266" height="110" as="geometry" />
</mxCell>
<mxCell id="22" value="" style="html=1;jettySize=18;whiteSpace=wrap;fontSize=13;strokeColor=#3a414a;strokeOpacity=100;strokeWidth=0.8;rounded=1;arcSize=24;edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=block;endFill=1;exitX=1;exitY=0.167;exitPerimeter=0;lucidId=bD3NWywXu_YH;" edge="1" source="27" parent="1">
<mxGeometry width="100" height="100" relative="1" as="geometry">
<Array as="points" />
<mxPoint x="1858" y="690" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="23" value="Call Main.py" style="text;html=1;resizable=0;labelBackgroundColor=default;align=center;verticalAlign=middle;fontColor=#333333;fontSize=18.3;" vertex="1" parent="22">
<mxGeometry x="-0.1696745874502491" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="24" value="" style="html=1;jettySize=18;whiteSpace=wrap;fontSize=13;strokeColor=#3a414a;strokeOpacity=100;strokeWidth=0.8;rounded=1;arcSize=24;edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=block;endFill=1;entryX=1;entryY=0.667;entryPerimeter=0;lucidId=jD3NIj7fWPk6;" edge="1" target="27" parent="1">
<mxGeometry width="100" height="100" relative="1" as="geometry">
<Array as="points" />
<mxPoint x="1860" y="735" as="sourcePoint" />
</mxGeometry>
</mxCell>
<mxCell id="25" value="Return Inferences" style="text;html=1;resizable=0;labelBackgroundColor=default;align=center;verticalAlign=middle;fontColor=#333333;fontSize=18.3;" vertex="1" parent="24">
<mxGeometry relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="26" value="A self-improviing decentralized AI network " style="html=1;overflow=block;blockSpacing=1;whiteSpace=wrap;fontSize=21.7;spacing=3.8;verticalAlign=middle;strokeOpacity=0;fillOpacity=0;rounded=1;absoluteArcSize=1;arcSize=12;fillColor=#000000;strokeWidth=NaN;lucidId=WgfOnQqIrc8R;" vertex="1" parent="1">
<mxGeometry y="659" width="255" height="127" as="geometry" />
</mxCell>
<mxCell id="27" value="Worker&#xa;Container" style="html=1;overflow=block;blockSpacing=1;whiteSpace=wrap;shape=mxgraph.aws3.ec2_compute_container;labelPosition=center;verticalLabelPosition=bottom;align=center;verticalAlign=top;pointerEvents=1;fontSize=18.3;fontColor=#333333;spacing=3.8;strokeColor=none;strokeOpacity=100;rounded=1;absoluteArcSize=1;arcSize=12;fillColor=#f58536;dashed=1;fixDash=1;dashPattern=1 4;strokeWidth=0;lucidId=2fYOvTz-elsl;" vertex="1" parent="1">
<mxGeometry x="1500" y="675" width="135" height="90" as="geometry" />
</mxCell>
<mxCell id="28" value="Inference Container" style="html=1;overflow=block;blockSpacing=1;whiteSpace=wrap;shape=mxgraph.aws3.ec2_compute_container;labelPosition=center;verticalLabelPosition=bottom;align=center;verticalAlign=top;pointerEvents=1;fontSize=18.3;fontColor=#333333;spacing=3.8;strokeColor=none;strokeOpacity=100;rounded=1;absoluteArcSize=1;arcSize=12;fillColor=#f58536;dashed=1;fixDash=1;dashPattern=1 4;strokeWidth=0;lucidId=ruYOFB6uyYjL;" vertex="1" parent="1">
<mxGeometry x="1864" y="668" width="135" height="90" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions lib/allora/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
testEnvironment: 'node',
roots: ['<rootDir>/test'],
testMatch: ['**/*.test.ts'],
transform: {
'^.+\\.tsx?$': 'ts-jest'
}
};
4 changes: 4 additions & 0 deletions lib/allora/lib/assets/instance/cfn-hup/cfn-auto-reloader.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[cfn-auto-reloader-hook]
triggers=post.update
path=Resources.WebServerHost.Metadata.AWS::CloudFormation::Init
action=/opt/aws/bin/cfn-init -v --stack __AWS_STACK_NAME__ --resource WebServerHost --region __AWS_REGION__
5 changes: 5 additions & 0 deletions lib/allora/lib/assets/instance/cfn-hup/cfn-hup.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[main]
stack=__AWS_STACK_ID__
region=__AWS_REGION__
# The interval used to check for changes to the resource metadata in minutes. Default is 15
interval=2
8 changes: 8 additions & 0 deletions lib/allora/lib/assets/instance/cfn-hup/cfn-hup.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Unit]
Description=cfn-hup daemon
[Service]
Type=simple
ExecStart=/usr/local/bin/cfn-hup
Restart=always
[Install]
WantedBy=multi-user.target
40 changes: 40 additions & 0 deletions lib/allora/lib/assets/instance/cfn-hup/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

if [ -n "$1" ]; then
export STACK_ID=$1
else
echo "Error: No Stack ID is provided"
echo "Usage: instance/cfn-hup/setup.sh <stack_id> <aws_region>"
exit 1
fi

if [ -n "$2" ]; then
export AWS_REGION=$2
else
echo "Error: No AWS Region is provided"
echo "Usage: instance/cfn-hup/setup.sh <stack_id> <aws_region>"
exit 1
fi

echo "Install CloudFormation helper scripts"
mkdir -p /opt/aws/
pip3 install --break-system-packages https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz
ln -s /usr/local/init/ubuntu/cfn-hup /etc/init.d/cfn-hup

echo "Configuring CloudFormation helper scripts"
mkdir -p /etc/cfn/
mv /opt/instance/cfn-hup/cfn-hup.conf /etc/cfn/cfn-hup.conf
sed -i "s;__AWS_STACK_ID__;\"$STACK_ID\";g" /etc/cfn/cfn-hup.conf
sed -i "s;__AWS_REGION__;\"$AWS_REGION\";g" /etc/cfn/cfn-hup.conf

mkdir -p /etc/cfn/hooks.d/system
mv /opt/instance/cfn-hup/cfn-auto-reloader.conf /etc/cfn/hooks.d/cfn-auto-reloader.conf
sed -i "s;__AWS_STACK_NAME__;\"$STACK_NAME\";g" /etc/cfn/hooks.d/cfn-auto-reloader.conf
sed -i "s;__AWS_REGION__;\"$AWS_REGION\";g" /etc/cfn/hooks.d/cfn-auto-reloader.conf

echo "Starting CloudFormation helper scripts as a service"
mv /opt/instance/cfn-hup/cfn-hup.service /etc/systemd/system/cfn-hup.service

systemctl daemon-reload
systemctl enable --now cfn-hup
systemctl start cfn-hup.service
Loading
Loading