Skip to content

Commit fc794b3

Browse files
committed
adding model repo cloning
1 parent 5390898 commit fc794b3

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

lib/allora/allora.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ new AlloraStack(app, 'allora-single-node', {
4848
},
4949
alloraWorkerName: process.env.ALLORA_WORKER_NAME || 'aws',
5050
alloraEnv: process.env.ALLORA_ENV || 'dev',
51+
modelRepo: process.env.MODEL_REPO || 'https://github.com/allora-network/basic-coin-prediction-node',
5152

5253
//Wallet config
5354
alloraWalletAddressKeyName: process.env.ALLORA_ACCOUNT_NAME || 'secret',

lib/allora/lib/allora-stack.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export interface AlloraStackProps extends cdk.StackProps {
2727
env: AlloraStackEnvironment
2828
alloraWorkerName: string;
2929
alloraEnv: string;
30+
modelRepo: string;
3031

3132
alloraWalletAddressKeyName: string;
3233
alloraWalletAddressRestoreMnemonic: string;
@@ -64,6 +65,7 @@ export class AlloraStack extends cdk.Stack {
6465
dataVolume,
6566
alloraWorkerName,
6667
alloraEnv,
68+
modelRepo,
6769

6870
//wallet props
6971
alloraWalletAddressKeyName,
@@ -175,6 +177,7 @@ export class AlloraStack extends cdk.Stack {
175177
_STACK_ID_: STACK_ID,
176178
_ALLORA_WORKER_NAME_: alloraWorkerName,
177179
_ALLORA_ENV_: alloraEnv,
180+
_MODEL_REPO_: modelRepo,
178181

179182
//wallet config
180183
_ALLORA_WALLET_ADDRESS_KEY_NAME_ : alloraWalletAddressKeyName,
@@ -188,14 +191,14 @@ export class AlloraStack extends cdk.Stack {
188191
_ALLORA_WALLET_SUBMIT_TX_: alloraWalletSubmitTx,
189192

190193
//worker config
191-
_ALLORA_WORKER_TOPIC_ID: alloraWorkerTopicId,
194+
_ALLORA_WORKER_TOPIC_ID_: alloraWorkerTopicId,
192195
_ALLORA_WORKER_INFERENCE_ENTRYPOINT_NAME_: alloraWorkerInferenceEntrypointName,
193196
_ALLORA_WORKER_INFERENCE_ENDPOINT_: alloraWorkerInferenceEndpoint,
194197
_ALLORA_WORKER_LOOP_SECONDS_: alloraWorkerLoopSeconds,
195198
_ALLORA_WORKER_TOKEN_: alloraWorkerToken,
196199

197200
//reputer config
198-
_ALLORA_REPUTER_TOPIC_ID: alloraReputerTopicId,
201+
_ALLORA_REPUTER_TOPIC_ID_: alloraReputerTopicId,
199202
_ALLORA_REPUTER_ENTRYPOINT_NAME_: alloraReputerEntrypointName,
200203
_ALLORA_REPUTER_SOURCE_OF_TRUTH_ENDPOINT_: alloraReputerSourceOfTruthEndpoint,
201204
_ALLORA_REPUTER_LOOP_SECONDS_: alloraReputerLoopSeconds,

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ echo "STACK_ID=${_STACK_ID_}" >> /etc/environment
1111

1212
echo "ALLORA_WORKER_NAME=${_ALLORA_WORKER_NAME_}" >> /etc/environment
1313
echo "ALLORA_ENV=${_ALLORA_ENV_}" >> /etc/environment
14+
echo "MODEL_REPO=${_MODEL_REPO_}" >> /etc/environment
1415

1516

1617
echo "ALLORA_WALLET_ADDRESS_KEY_NAME=${_ALLORA_WALLET_ADDRESS_KEY_NAME_}" >> /etc/environment
@@ -113,6 +114,14 @@ sed -i "s/_ALLORA_REPUTER_LOOP_SECONDS_/$ALLORA_REPUTER_LOOP_SECONDS/" config.js
113114
sed -i "s/_ALLORA_REPUTER_TOKEN_/$ALLORA_REPUTER_TOKEN/" config.json
114115
sed -i "s/_ALLORA_REPUTER_MIN_STAKE_/$ALLORA_REPUTER_MIN_STAKE/" config.json
115116

117+
#pull in model repo
118+
echo 'Pulling in the model repo '
119+
echo $MODEL_REPO
120+
cd ~/node-repo/adapter/api
121+
rm -rf source
122+
git clone $MODEL_REPO source
123+
cd ~/node-repo
124+
116125
docker-compose up --build
117126

118127
echo "----------------------------------------------"

lib/allora/sample-configs/.env-sample-full

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
#Must fill all these in
44
ALLORA_WALLET_ADDRESS_KEY_NAME="xxxxxxxxxxx"
5-
ALLORA_WALLET_ADDRESS_RESTORE_MNEMONIC="xxxxxxxxxxx"
5+
ALLORA_WALLET_ADDRESS_RESTORE_MNEMONIC="xxxxxxxxxxx" #if you don't have this, generate with allocmd
66
AWS_ACCOUNT_ID="xxxxxxxxxxx"
7+
MODEL_REPO="https://github.com/allora-network/basic-coin-prediction-node"
78
###############################
89

910
AWS_RESOURCE_NAME_PREFIX="AlloraWorkerx"

lib/allora/test/.env-test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
ALLORA_WALLET_ADDRESS_KEY_NAME="xxxxxxxxxxx"
55
ALLORA_WALLET_ADDRESS_RESTORE_MNEMONIC="xxxxxxxxxxx"
66
AWS_ACCOUNT_ID="xxxxxxxxxxx"
7+
MODEL_REPO="https://github.com/allora-network/basic-coin-prediction-node"
78
###############################
89

910
AWS_RESOURCE_NAME_PREFIX="AlloraWorkerx"

0 commit comments

Comments
 (0)