Skip to content

Commit 1e8ccc8

Browse files
author
mike dupont
committed
cloud deployment patch
1 parent ec2a8c4 commit 1e8ccc8

36 files changed

+559
-9
lines changed

.gitignore

+50-1
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,53 @@ lerna-debug.log
6565
tsdoc_cache/
6666
tsdoc_comments/
6767

68-
**/elizaDb/**
68+
**/elizaDb/**# -*- mode: gitignore; -*-
69+
*~
70+
\#*\#
71+
/.emacs.desktop
72+
/.emacs.desktop.lock
73+
*.elc
74+
auto-save-list
75+
tramp
76+
.\#*
77+
78+
# Org-mode
79+
.org-id-locations
80+
*_archive
81+
82+
# flymake-mode
83+
*_flymake.*
84+
85+
# eshell files
86+
/eshell/history
87+
/eshell/lastdir
88+
89+
# elpa packages
90+
/elpa/
91+
92+
# reftex files
93+
*.rel
94+
95+
# AUCTeX auto folder
96+
/auto/
97+
98+
# cask packages
99+
.cask/
100+
dist/
101+
102+
# Flycheck
103+
flycheck_*.el
104+
105+
# server auth directory
106+
/server/
107+
108+
# projectiles files
109+
.projectile
110+
111+
# directory configuration
112+
.dir-locals.el
113+
114+
# network security
115+
/network-security.data
116+
117+
packages/autodoc/text_objects/*

.gitmodules

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[submodule "vendor/elizaos/plugin-twitter"]
2+
path = vendor/elizaos/plugin-twitter
3+
url = https://github.com/meta-introspector/plugin-twitter
4+
[submodule "vendor/elizaos/agent-twitter-client"]
5+
path = vendor/elizaos/agent-twitter-client
6+
url = https://github.com/meta-introspector/agent-twitter-client.git
7+
[submodule "vendor/elizaos/client-twitter"]
8+
path = vendor/elizaos/client-twitter
9+
url = https://github.com/meta-introspector/client-twitter-eliza-zos
10+
[submodule "vendor/elizaos/client-discord-eliza"]
11+
path = vendor/elizaos/client-discord-eliza
12+
url = https://github.com/meta-introspector/client-discord-eliza-zos
13+
[submodule "vendor/elizaos/plugin-speech-tts"]
14+
path = vendor/elizaos/plugin-speech-tts
15+
url = https://github.com/meta-introspector/plugin-speech-tts-eliza-zos
16+
[submodule "vendor/elizaos/client-telegram"]
17+
path = vendor/elizaos/client-telegram
18+
url = https://github.com/meta-introspector/client-telegram-eliza-zos
19+
[submodule "characters"]
20+
path = characters
21+
url = https://github.com/meta-introspector/characters-eliza-zos

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v23.3.0
1+
v23.9.0

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
- feat: add docs for story plugin [\#1672](https://github.com/elizaOS/eliza/pull/1672) ([chandiniv1](https://github.com/chandiniv1))
102102
- fix: 1668 fix twitter image link [\#1671](https://github.com/elizaOS/eliza/pull/1671) ([nusk0](https://github.com/nusk0))
103103
- fix: 1634 fix image description service [\#1667](https://github.com/elizaOS/eliza/pull/1667) ([nusk0](https://github.com/nusk0))
104-
- fix: Seperated imageModelProvider and imageVisionModelProvider for ImageDescriptioServices [\#1664](https://github.com/elizaOS/eliza/pull/1664) ([denizekiz](https://github.com/denizekiz))
104+
- fix: Separated imageModelProvider and imageVisionModelProvider for ImageDescriptionServices [\#1664](https://github.com/elizaOS/eliza/pull/1664) ([denizekiz](https://github.com/denizekiz))
105105
- fix: Update Supabase schema.sql [\#1660](https://github.com/elizaOS/eliza/pull/1660) ([0xRider](https://github.com/0xRider))
106106
- fix: Fix bug in plugin-bootstrap/src/evaluators/facts.ts [\#1648](https://github.com/elizaOS/eliza/pull/1648) ([metakai1](https://github.com/metakai1))
107107
- Added Hungarian README [\#1645](https://github.com/elizaOS/eliza/pull/1645) ([mdominikd](https://github.com/mdominikd))
@@ -188,7 +188,7 @@
188188
- bun install shows errors [\#1234](https://github.com/elizaOS/eliza/issues/1234)
189189
- Long tweets fail with error Tweet needs to be a bit shorter \(Code 186\) [\#1178](https://github.com/elizaOS/eliza/issues/1178)
190190
- Unable to Perform Transfer with plugin-evm Due to Parameter Parsing Error [\#964](https://github.com/elizaOS/eliza/issues/964)
191-
- I have a twitter premium subscription and MAX\_TWEET\_LENGTH to 2500 but I can't to post a tweet with more than 280 characteres [\#883](https://github.com/elizaOS/eliza/issues/883)
191+
- I have a twitter premium subscription and MAX\_TWEET\_LENGTH to 2500 but I can't to post a tweet with more than 280 characters [\#883](https://github.com/elizaOS/eliza/issues/883)
192192
- Twitter cookies do not match the docs [\#558](https://github.com/elizaOS/eliza/issues/558)
193193

194194
**Closed issues:**

Dockerfile

+6-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ RUN bun add better-sqlite3
3535

3636
# Build the project
3737
RUN bun run build:core
38-
RUN bun run build:docker
38+
3939

4040
# Create a new stage for the final image
4141
FROM node:23.3.0-slim
@@ -52,6 +52,7 @@ RUN apt-get update && \
5252
RUN npm install -g bun turbo@2.3.3
5353

5454
# Copy built artifacts and production dependencies from the builder stage
55+
5556
COPY --from=builder /app/package.json ./
5657
COPY --from=builder /app/tsconfig.json ./
5758
COPY --from=builder /app/turbo.json ./
@@ -62,11 +63,14 @@ COPY --from=builder /app/node_modules ./node_modules
6263
COPY --from=builder /app/packages ./packages
6364
COPY --from=builder /app/scripts ./scripts
6465

66+
67+
6568
# Set environment variables
6669
ENV NODE_ENV=production
6770

6871
# Expose any necessary ports (if needed)
6972
EXPOSE 3000 5173
7073

74+
7175
# Start the application
72-
CMD ["bun", "run", "start"]
76+
CMD ["bun", "run", "start"]

buildspec.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: 0.2
2+
3+
env:
4+
parameter-store:
5+
DOCKER_USERNAME : "tine_agent_4_docker_username"
6+
DOCKER_PASSWORD : "tine_agent_4_docker_password"
7+
#DOCKER_IMAGE : "tine_agent_7_agent_image"
8+
variables:
9+
DOCKER_IMAGE : "h4ckermike/elizaos-eliza:v2"
10+
11+
12+
phases:
13+
pre_build:
14+
commands:
15+
- apt update
16+
- apt-get install -y ec2-instance-connect git wget unzip systemd ca-certificates curl cloud-utils apt-transport-https ca-certificates software-properties-common
17+
- curl -fsSL test.docker.com -o get-docker.sh && sh get-docker.sh
18+
- echo $DOCKER_PASSWORD | md5sum
19+
- echo $DOCKER_PASSWORD | wc
20+
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
21+
- aws ecr get-login-password --region us-east-2 | docker login --username AWS --password-stdin 767503528736.dkr.ecr.us-east-2.amazonaws.com
22+
build:
23+
commands:
24+
- docker build -t agent/eliza:feb10 .
25+
- docker tag agent/eliza:feb10 767503528736.dkr.ecr.us-east-2.amazonaws.com/agent/eliza:feb10
26+
post_build:
27+
commands:
28+
- docker push 767503528736.dkr.ecr.us-east-2.amazonaws.com/agent/eliza:feb10
29+
- docker tag 767503528736.dkr.ecr.us-east-2.amazonaws.com/agent/eliza:feb10 $DOCKER_IMAGE
30+
- docker push $DOCKER_IMAGE
31+
# h4ckermike/elizaos-eliza:feb10
32+

bun.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "eliza",
66
"dependencies": {
77
"@anthropic-ai/sdk": "^0.39.0",
8-
"@babel/generator": "^7.26.9",
8+
"@babel/generator": "^7.26.10",
99
"vittest": "^1.0.2",
1010
"zod": "3.24.1",
1111
},

call_update.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
aws ssm send-command \
2+
--profile solfunmeme_dev \
3+
--region us-east-2 \
4+
--document-name "UpdateEliza" \
5+
--document-version "\$LATEST" \
6+
--targets '[{"Key":"InstanceIds","Values":["i-0b0e822632e0bef20"]}]' \
7+
--parameters '{"ImageParameterName":["tine_agent_4_agent_image"],"CharacterParameterName":["tine-agent-config-1"],"ContainerMemory":["1512"]}' \
8+
--timeout-seconds 600 \
9+
--max-concurrency "50" \
10+
--max-errors "0"

codebuild.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
aws codebuild start-build --region us-east-2 \
3+
--project-name github-runner-codebuild-eliza-build \
4+
--source-version $(git rev-parse --abbrev-ref HEAD) \
5+
--source-type-override GITHUB \
6+
--source-location-override https://github.com/meta-introspector/cloud-deployment-eliza.git \
7+
--git-clone-depth 1 \
8+
--git-submodules-config fetchSubmodules=true

docker-entrypoint-none.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Run command with node if the first argument contains a "-" or is not a system command. The last
5+
# part inside the "{}" is a workaround for the following bug in ash/dash:
6+
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264
7+
set -x
8+
#if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then
9+
#apt update
10+
#apt install -y strace
11+
12+
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
13+
corepack enable && corepack install --global pnpm@9.8.0
14+
15+
#strace -f -o /opt/agent/strace.log -s99999 node CMD ["pnpm", "start", "--characters=characters/eliza.character.json"]
16+
#pnpm start --characters=characters/tine-test.character.json
17+
pnpm start --characters=$(ls -1p characters/*.json | paste -sd,)
18+
#fi
19+
#exec "$@"

docker-entrypoint-strace.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Run command with node if the first argument contains a "-" or is not a system command. The last
5+
# part inside the "{}" is a workaround for the following bug in ash/dash:
6+
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264
7+
set -x
8+
#if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then
9+
strace -f -o /opt/agent/strace.log -s99999 node "$@"
10+
#fi
11+
#exec "$@"

docker-entrypoint-strace2.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Run command with node if the first argument contains a "-" or is not a system command. The last
5+
# part inside the "{}" is a workaround for the following bug in ash/dash:
6+
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264
7+
set -x
8+
#if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then
9+
apt update
10+
apt install -y strace
11+
12+
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
13+
corepack enable && corepack install --global pnpm@9.8.0
14+
15+
16+
#strace -f -o /opt/agent/strace.log -s99999 node CMD ["pnpm", "start", "--characters=characters/eliza.character.json"]
17+
strace -f -o /opt/agent/strace.log -s99999 pnpm start:debug --characters=$(ls -1p characters/*.json | paste -sd,)
18+
#fi
19+
#exec "$@"

docker-entrypoint.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Run command with node if the first argument contains a "-" or is not a system command. The last
5+
# part inside the "{}" is a workaround for the following bug in ash/dash:
6+
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264
7+
if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then
8+
set -- node "$@"
9+
fi
10+
11+
exec "$@"

doit.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
nvm use 23
3+
pnpm clean
4+
pnpm install --no-frozen-lockfile
5+
pnpm build
6+
7+
8+
pushd packages/adapter-sqlite
9+
pnpm rebuild
10+
popd
11+
12+
13+
pushd scripts/jsdoc-automation
14+
pnpm install --no-frozen-lockfile
15+
pnpm build
16+
17+
pushd node_modules/.pnpm/better-sqlite3@11.8.1/node_modules/better-sqlite3/
18+
pnpm rebuild
19+
20+
popd
21+
popd

get_secrets.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
# we are using parameters prefixed by ${AGENT_NAME}_, eg. "tine_agent_7_"
3+
## TURN OFF LOGGING
4+
echo using "${AGENT_NAME}" as agent name base for keys
5+
set +x
6+
7+
# This script expects AGENT_NAME to be set to something like "tine_agent"
8+
9+
mkdir -p "/var/run/agent/secrets/"
10+
echo "" > "/var/run/agent/secrets/env" # blank the file
11+
12+
# Fetch all variables with the prefix and name them the same as the variable minus agent name underscore
13+
for key in $(aws ssm describe-parameters --query 'Parameters[?starts_with(Name, `'"${AGENT_NAME}"'_`)].Name' --output text); do
14+
value=$(aws ssm get-parameter --name "$key" | jq .Parameter.Value -r)
15+
var_name=$(echo "$key" | sed "s/^${AGENT_NAME}_//")
16+
echo "$var_name=${value}" >> "/var/run/agent/secrets/env"
17+
done
18+
19+
# append these constant values to the env
20+
declare -A params_const=(
21+
["VERBOSE"]="TRUE"
22+
["NODE_ENV"]="development"
23+
)
24+
for key in "${!params_const[@]}"; do
25+
value="${params_const[$key]}"
26+
echo "$key=$value" >> "/var/run/agent/secrets/env"
27+
done
28+
29+
set -x
30+
## TURN ON LOGGING

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
},
6161
"dependencies": {
6262
"@anthropic-ai/sdk": "^0.39.0",
63-
"@babel/generator": "^7.26.9",
63+
"@babel/generator": "^7.26.10",
6464
"vittest": "^1.0.2",
6565
"zod": "3.24.1"
6666
},

packages/registry

-1
This file was deleted.

push_twitter.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
export TWITTER_EMAIL TWITTER_PASSWORD TWITTER_USER
3+
4+
aws ssm put-parameter --name "tine_agent_twitter_password" --value "${TWITTER_PASSWORD}" --type String
5+
aws ssm put-parameter --name "tine_agent_twitter_email" --value "${TWITTER_EMAIL}" --type String
6+
aws ssm put-parameter --name "tine_agent_twitter_username" --value "${TWITTER_USERNAME}" --type String

run_with_groq.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
#
3+
bash ./get_secrets.sh
4+
5+
docker kill agent-docker.service || echo skip
6+
docker rm --force agent-docker.service || echo skip
7+
8+
/usr/bin/bash -c 'docker login -u AWS -p $(aws ecr get-login-password --region us-east-2) 767503528736.dkr.ecr.us-east-2.amazonaws.com'
9+
10+
/usr/bin/docker pull 767503528736.dkr.ecr.us-east-2.amazonaws.com/agent/eliza:feature-arm64_fastembed
11+
12+
#/usr/bin/docker run -p 3000:3000 --mount type=bind,source=/opt/agent,target=/opt/agent --env-file /var/run/agent/secrets/env --rm --name "agent-docker.service" --entry-point docker-entrypoint-strace.sh 767503528736.dkr.ecr.us-east-2.amazonaws.com/agent/eliza:feature-arm64_fastembed pnpm start:debug --characters=characters/eliza.character.json
13+
14+
#~/cloud-deployment-eliza/runlocaldocker-install-script.sh
15+
# install strace (fixme : update docker)
16+
#/usr/bin/docker run -p 3000:3000 --mount type=bind,source=/opt/agent,target=/opt/agent --env-file /var/run/agent/secrets/env --rm --name "agent-docker.service" --entrypoint /opt/agent/docker-entrypoint-none.sh 767503528736.dkr.ecr.us-east-2.amazonaws.com/agent/eliza:feature-arm64_fastembed /opt/agent/runlocaldocker-install-script.sh
17+
#/usr/bin/docker commit "agent-docker.service" "agent-docker-strace"
18+
# second step we debug with strace entrypoint
19+
# first we create a volumee
20+
#mount /node_modules/tokenizers/ from 767503528736.dkr.ecr.us-east-2.amazonaws.com/nodemodules/tokenizer:latest into
21+
#"/app/node_modules/fastembed/node_modules/.pnpm/@anush008+tokenizers@https+++codeload.github.com+meta-introspector+arm64-tokenizers+tar.gz+98_s2457qj3pe4ojcbckddasgzfvu/node_modules/@anush008/"
22+
23+
docker run -v tokenizer:/node_modules/tokenizers/ 767503528736.dkr.ecr.us-east-2.amazonaws.com/nodemodules/tokenizer:latest
24+
25+
# now bind it in
26+
/usr/bin/docker run -d -p 3000:3000 -v tokenizer:/app/node_modules/@anush008/tokenizers/ -v tokenizer:/app/node_modules/fastembed/node_modules/.pnpm/@anush008+tokenizers@https+++codeload.github.com+meta-introspector+arm64-tokenizers+tar.gz+98_s2457qj3pe4ojcbckddasgzfvu/node_modules/@anush008/ --mount type=bind,source=/opt/agent,target=/opt/agent --mount type=bind,source=/opt/agent/characters/,target=/app/characters/ --env-file /var/run/agent/secrets/env --rm --name "agent-docker.service" --entrypoint /opt/agent/docker-entrypoint-strace2.sh groq
27+
#100755 >
28+

run_with_groq_docker.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
#
3+
bash ./get_secrets.sh
4+
5+
docker kill agent-docker.service || echo skip
6+
docker rm --force agent-docker.service || echo skip
7+
8+
export CORE_AGENT_IMAGE=h4ckermike/elizaos-eliza:feature-arm64_fastembed
9+
export TOKENIZERS_IMAGE=h4ckermike/arm64-tokenizers:feature-arm64
10+
# AUDIO
11+
# video
12+
# more
13+
/usr/bin/docker pull $TOKENIZERS_IMAGE
14+
/usr/bin/docker pull $CORE_AGENT_IMAGE
15+
16+
# intialize the volume as side effect
17+
docker run -v tokenizer:/node_modules/tokenizers/ $TOKENIZERS_IMAGE
18+
#docker cp characters/eliza.character.json agent-docker.service:/app/agent/characters/eliza.character.json
19+
#docker commit agent-docker.service groq
20+
21+
# now bind it in
22+
/usr/bin/docker run -d -p 3000:3000 \
23+
-v tokenizer:/app/node_modules/@anush008/tokenizers/ -v tokenizer:/app/node_modules/fastembed/node_modules/.pnpm/@anush008+tokenizers@https+++codeload.github.com+meta-introspector+arm64-tokenizers+tar.gz+98_s2457qj3pe4ojcbckddasgzfvu/node_modules/@anush008/ \
24+
--mount type=bind,source=/opt/agent,target=/opt/agent \
25+
--mount type=bind,source=/opt/agent/characters/,target=/app/characters/ \
26+
--env-file /var/run/agent/secrets/env \
27+
--rm \
28+
--name "agent-docker.service" \
29+
--entrypoint /opt/agent/docker-entrypoint-strace2.sh $DOCKERIMAGE
30+

0 commit comments

Comments
 (0)