Skip to content

Commit c66d779

Browse files
rootmike dupont
root
authored and
mike dupont
committed
readme
readme capture work in progress wip fixed syntax error readme adding in docs�OA adding in diagram adding docs update diagram update docs readme readme readme adding in docs�OA update readme
1 parent c39f65a commit c66d779

8 files changed

+629
-61
lines changed

README.md

+75-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11

2+
docker
3+
24
`bash runlocaldocker2.sh`
35
```
46
]0;root@ip-10-0-4-156: /opt/agentroot@ip-10-0-4-156:/opt/agent# git pull
5-
git pull
7+
gcodeit pull
68
remote: Enumerating objects: 4, done.
79
remote: Counting objects: 100% (4/4), done.
810
remote: Total 4 (delta 3), reused 4 (delta 3), pack-reused 0 (from 0)
@@ -330,3 +332,75 @@ pnpm install --include=optional sharp
330332

331333
[![Star History Chart](https://api.star-history.com/svg?repos=elizaos/eliza&type=Date)](https://star-history.com/#elizaos/eliza&Date)
332334

335+
336+
## notes
337+
338+
```
339+
cd
340+
cd cloud-deployment-eliza/
341+
python ./ssh-ssm.py
342+
```
343+
344+
`asciinema rec port_forward.cast`
345+
`asciinema upload port_forward.cast`
346+
347+
348+
# diagnose ssh
349+
`ssh localhost -p 2222`
350+
`ssh -vvvvvv localhost -p 2222`
351+
352+
# checking key
353+
`cat ~/id_rsa.pub `
354+
`cat ~/.ssh/id_rsa.pub | pastebinit -b paste.debian.net`
355+
356+
# missing user (defaults to current)
357+
`ssh -vvvvvv localhost -p 2222`
358+
359+
# find the right user name
360+
`ssh ubuntu@localhost -p 2222`
361+
362+
363+
# pull and copy from server
364+
`git remote add agentgit git+ssh://ubuntu@localhost:2222/opt/git/agent`
365+
`git pull agentgit`
366+
`git checkout -b agentgit/feature/arm64_fastembed`
367+
`git push origin`
368+
369+
370+
## local git
371+
372+
373+
* tunnel to aws
374+
375+
1. we can use this from cheaper hosting to create connections to aws, for ssm parameters.
376+
2. and for git
377+
3. allow you to share resources with agents from pc or phone
378+
379+
```
380+
mkdir -p /opt/git/agent
381+
git init /opt/git/agent/
382+
git remote add local /opt/git/agent/.git/
383+
git commit -m 'readme' -a
384+
git push local
385+
chown ubuntu: -R /opt/git/agent/
386+
history >> hist
387+
```
388+
```
389+
aws ssm start-session --target i-06a744b2cf12e2356 --document-name AWS-StartPortForwardingSession --parameters '{"portNumber": ["22"], "localPortNumber": ["2222"]}'
390+
```
391+
392+
* tunnel to aws
393+
394+
1. we can use this from cheaper hosting to create connections to aws, for ssm parameters.
395+
2. and for git
396+
3. allow you to share resources with agents from pc or phone
397+
398+
399+
```
400+
python ./ssh-ssm.py
401+
```
402+
```
403+
aws ssm start-session --target i-06a744b2cf12e2356 --document-name AWS-StartPortForwardingSession --parameters '{"portNumber": ["22"], "localPortNumber": ["2222"]}'
404+
```
405+
406+

docker-compose.doc

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
2+
Sign In
3+
Adapt docker compose to use launch script Ai translate this to docker compose now bind it in/usr/bin/docker run -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_s2457qj3pe4oj\cbckddasgzfvu/node_modules/@anush008/ --mount type=bind,source=/opt/agent,target=/opt/agent --env-file /var/run/agent/secrets/e\nv --rm --name "agent-docker.service" --entrypoint /opt/agent/docker-entrypoint-strace2.sh 767503528736.dkr.ecr.us-east-2.amaz\onaws.com/agent/eliza:feature-arm64_fastembed
4+
To adapt your command into a Docker Compose file, you can structure it as follows. This will create a service that mirrors the command you provided, including the necessary volumes, environment variables, and entrypoint.
5+
6+
Here's how you can write the docker-compose.yaml:
7+
8+
yaml
9+
10+
1
11+
2
12+
3
13+
4
14+
5
15+
6
16+
7
17+
8
18+
9
19+
10
20+
11
21+
12
22+
13
23+
14
24+
15
25+
16
26+
17
27+
18
28+
19
29+
Explanation:
30+
version: Specifies the version of the Docker Compose file format.
31+
32+
services: Defines the services that will be run. In this case, we have a single service named agent.
33+
34+
image: Specifies the Docker image to use.
35+
36+
container_name: Sets a custom name for the container.
37+
38+
entrypoint: Overrides the default entrypoint of the image with your specified script.
39+
40+
ports: Maps port 3000 of the container to port 3000 on the host.
41+
42+
volumes: Binds the specified directories and creates a named volume for tokenizer.
43+
44+
env_file: Loads environment variables from the specified file.
45+
46+
restart: Configures the restart policy for the container.
47+
48+
This setup should replicate the functionality of your original Docker run command within a Docker Compose context.
49+
50+
51+
15 sources
52+
53+
What are the specific requirements for the launch script that need to be included in the Docker Compose file?
54+
55+
Can you explain the purpose of each volume and environment variable in the Docker run command?
56+
57+
How do I ensure that the Docker Compose setup works seamlessly with the existing services and configurations?
58+
explain to to me like a new dev
59+
Sure! Let’s break it down step by step in a way that's easy to understand.
60+
61+
What is Docker Compose?
62+
Docker Compose is a tool that helps you define and run multi-container Docker applications. Instead of running a single container with a long command, you can use a simple YAML file to describe all the containers you need, how they should be configured, and how they should work together.
63+
64+
The Docker Compose File
65+
The file we created is called docker-compose.yaml. Here’s what each part means:
66+
67+
version: This tells Docker Compose which version of the configuration format you are using. We used 3.8, which is a common version.
68+
69+
services: This section defines the different parts of your application. In our case, we have one service called agent. Think of a service as a single container that runs a specific application.
70+
71+
image: This is the Docker image that your service will use. An image is like a blueprint for your container. It contains everything needed to run your application, including the code, libraries, and dependencies.
72+
73+
container_name: This gives a specific name to your container. Instead of a random name, you can easily identify it as agent-docker.service.
74+
75+
entrypoint: This specifies the command that should run when the container starts. In your case, it’s a script located at /opt/agent/docker-entrypoint-strace2.sh. This script will be executed when the container starts.
76+
77+
ports: This maps a port on your computer (host) to a port in the container. Here, we are saying that when you access port 3000 on your computer, it should connect to port 3000 inside the container. This is how you can access your application from your web browser.
78+
79+
volumes: This is used to share files between your host machine and the container. We have two types of volumes here:
80+
81+
Named volume: tokenizer is a named volume that Docker manages for you. It’s used to store data that should persist even if the container is stopped or removed.
82+
Bind mount: This allows you to link a specific folder on your host machine (/opt/agent) to a folder in the container. This way, any changes you make in that folder on your host will be reflected in the container.
83+
env_file: This tells Docker to load environment variables from a file. Environment variables are used to configure your application without hardcoding values in your code.
84+
85+
restart: This setting tells Docker how to handle the container if it stops. unless-stopped means that Docker will automatically restart the container unless you manually stop it.
86+
87+
How to Use It
88+
Create the File: Save the above YAML code in a file named docker-compose.yaml.
89+
90+
Run Docker Compose: Open your terminal, navigate to the directory where your docker-compose.yaml file is located, and run the command:
91+
92+
bash
93+
94+
1
95+
docker-compose up
96+
This command will start your service as defined in the YAML file.
97+
98+
Access Your Application: Once the container is running, you can access your application by going to http://localhost:3000 in your web browser.
99+
100+
Summary
101+
Using Docker Compose simplifies the process of running your application by allowing you to define everything in one file. You don’t have to remember long commands; just run docker-compose up, and it will take care of starting everything for you!
102+
103+
104+
15 sources
105+
106+
What are the basic concepts I need to understand as a new developer?
107+
108+
Can you provide some resources or tutorials for beginners in software development?
109+
110+
What common mistakes should I avoid when starting out in coding?
111+
Ask a follow up...
112+

docker-compose.md

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
Explanation:
2+
version: Specifies the version of the Docker Compose file format.
3+
4+
services: Defines the services that will be run. In this case, we have a single service named agent.
5+
6+
image: Specifies the Docker image to use.
7+
8+
container_name: Sets a custom name for the container.
9+
10+
entrypoint: Overrides the default entrypoint of the image with your specified script.
11+
12+
ports: Maps port 3000 of the container to port 3000 on the host.
13+
14+
volumes: Binds the specified directories and creates a named volume for tokenizer.
15+
16+
env_file: Loads environment variables from the specified file.
17+
18+
restart: Configures the restart policy for the container.
19+
20+
This setup should replicate the functionality of your original Docker run command within a Docker Compose context.
21+
22+
23+
24+
What are the specific requirements for the launch script that need to be included in the Docker Compose file?
25+
26+
Can you explain the purpose of each volume and environment variable in the Docker run command?
27+
28+
How do I ensure that the Docker Compose setup works seamlessly with the existing services and configurations?
29+
explain to to me like a new dev
30+
Sure! Let’s break it down step by step in a way that's easy to understand.
31+
32+
What is Docker Compose?
33+
Docker Compose is a tool that helps you define and run multi-container Docker applications. Instead of running a single container with a long command, you can use a simple YAML file to describe all the containers you need, how they should be configured, and how they should work together.
34+
35+
The Docker Compose File
36+
The file we created is called docker-compose.yaml. Here’s what each part means:
37+
38+
version: This tells Docker Compose which version of the configuration format you are using. We used 3.8, which is a common version.
39+
40+
services: This section defines the different parts of your application. In our case, we have one service called agent. Think of a service as a single container that runs a specific application.
41+
42+
image: This is the Docker image that your service will use. An image is like a blueprint for your container. It contains everything needed to run your application, including the code, libraries, and dependencies.
43+
44+
container_name: This gives a specific name to your container. Instead of a random name, you can easily identify it as agent-docker.service.
45+
46+
entrypoint: This specifies the command that should run when the container starts. In your case, it’s a script located at /opt/agent/docker-entrypoint-strace2.sh. This script will be executed when the container starts.
47+
48+
ports: This maps a port on your computer (host) to a port in the container. Here, we are saying that when you access port 3000 on your computer, it should connect to port 3000 inside the container. This is how you can access your application from your web browser.
49+
50+
volumes: This is used to share files between your host machine and the container. We have two types of volumes here:
51+
52+
Named volume: tokenizer is a named volume that Docker manages for you. It’s used to store data that should persist even if the container is stopped or removed.
53+
Bind mount: This allows you to link a specific folder on your host machine (/opt/agent) to a folder in the container. This way, any changes you make in that folder on your host will be reflected in the container.
54+
env_file: This tells Docker to load environment variables from a file. Environment variables are used to configure your application without hardcoding values in your code.
55+
56+
restart: This setting tells Docker how to handle the container if it stops. unless-stopped means that Docker will automatically restart the container unless you manually stop it.
57+
58+
How to Use It
59+
Create the File: Save the above YAML code in a file named docker-compose.yaml.
60+
61+
Run Docker Compose: Open your terminal, navigate to the directory where your docker-compose.yaml file is located, and run the command:
62+
63+
bash
64+
65+
docker-compose up
66+
This command will start your service as defined in the YAML file.
67+
68+
Access Your Application: Once the container is running, you can access your application by going to http://localhost:3000 in your web browser.
69+
70+
Summary
71+
Using Docker Compose simplifies the process of running your application by allowing you to define everything in one file. You don’t have to remember long commands; just run docker-compose up, and it will take care of starting everything for you!
72+
73+
74+
75+
What are the basic concepts I need to understand as a new developer?
76+
77+
Can you provide some resources or tutorials for beginners in software development?
78+
79+
What common mistakes should I avoid when starting out in coding?
80+
Ask a follow up...
81+

docker-compose.yaml

+22-58
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,29 @@
11
services:
2-
tee:
3-
build:
4-
context: .
5-
dockerfile: Dockerfile
6-
stdin_open: true
7-
tty: true
2+
agentstrace:
3+
image: "767503528736.dkr.ecr.us-east-2.amazonaws.com/agent/eliza:feature-arm64_fastembed"
4+
container_name: agent-docker-trace.service
5+
entrypoint: /opt/agent/docker-entrypoint-strace2.sh
6+
ports:
7+
- "3001:3000"
88
volumes:
9+
- tokenizer:/app/node_modules/@anush008/tokenizers/
10+
- tokenizer:/app/node_modules/fastembed/node_modules/.pnpm/@anush008
11+
- /opt/agent:/opt/agent
912
- /var/run/tappd.sock:/var/run/tappd.sock
1013
- tee:/app/packages/client-twitter/src/tweetcache
11-
# docker will copy existing files into the new volumn
1214
- akash-plugin-data:/app/packages/plugin-akash/src/
1315
- tee:/app/db.sqlite
14-
environment:
15-
# FIXME: passing secrets via env is not best practice, use secrets
16-
OPENAI_API_KEY: "${OPENAI_API_KEY}"
17-
AKASH_MNEMONIC: "${AKASH_MNEMONIC}"
18-
AKASH_WALLET_ADDRESS: "${AKASH_WALLET_ADDRESS}"
19-
AKASH_ENV: mainnet
20-
AKASH_NET: https://raw.githubusercontent.com/ovrclk/net/master/mainnet
21-
RPC_ENDPOINT: https://rpc.akashnet.net:443
22-
AKASH_GAS_PRICES: 0.025uakt
23-
AKASH_GAS_ADJUSTMENT: 1.5
24-
AKASH_KEYRING_BACKEND: os
25-
AKASH_FROM: default
26-
AKASH_FEES: 20000uakt
27-
AKASH_DEPOSIT: 500000uakt
28-
AKASH_PRICING_API_URL: https://console-api.akash.network/v1/pricing
29-
AKASH_DEFAULT_CPU: 1000
30-
AKASH_DEFAULT_MEMORY: 1000000000
31-
AKASH_DEFAULT_STORAGE: 1000000000
32-
AKASH_CLOSE_DEP: closeAll
33-
AKASH_CLOSE_DSEQ: 19729929
34-
AKASH_PROVIDER_INFO: akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz
35-
AKASH_DEP_STATUS: dseq
36-
AKASH_DEP_DSEQ: 19729929
37-
AKASH_GAS_OPERATION: close
38-
AKASH_GAS_DSEQ: 19729929
39-
AKASH_MANIFEST_MODE: auto
40-
AKASH_MANIFEST_VALIDATION_LEVEL: strict
41-
ELEVENLABS_MODEL_ID: eleven_multilingual_v2
42-
ELEVENLABS_VOICE_ID: 21m00Tcm4TlvDq8ikWAM
43-
ELEVENLABS_VOICE_STABILITY: 0.5
44-
ELEVENLABS_VOICE_SIMILARITY_BOOST: 0.9
45-
ELEVENLABS_VOICE_STYLE: 0.66
46-
ELEVENLABS_VOICE_USE_SPEAKER_BOOST: false
47-
ELEVENLABS_OPTIMIZE_STREAMING_LATENCY: 4
48-
ELEVENLABS_OUTPUT_FORMAT: pcm_16000
49-
TWITTER_DRY_RUN: false
50-
TWITTER_USERNAME:
51-
TWITTER_PASSWORD:
52-
TWITTER_EMAIL:
53-
BIRDEYE_API_KEY:
54-
SOL_ADDRESS: So11111111111111111111111111111111111111112
55-
SLIPPAGE: 1
56-
SOLANA_RPC_URL: https://api.mainnet-beta.solana.com
57-
HELIUS_API_KEY:
58-
SERVER_PORT: 3000
59-
WALLET_SECRET_SALT: secret_salt
60-
ports:
61-
- "3000:3000"
62-
restart: always
16+
env_file:
17+
- /var/run/agent/secrets/env
18+
- /var/run/agent/secrets/settings
19+
restart: unless-stopped
20+
21+
tokenizer:
22+
image: "767503528736.dkr.ecr.us-east-2.amazonaws.com/nodemodules/tokenizer:latest"
23+
volumes:
24+
- tokenizer:/node_modules/tokenizers/
25+
6326
volumes:
64-
tee:
65-
akash-plugin-data:
27+
tokenizer: # npm nodemodules/tokenizer:latest
28+
tee:
29+
akash-plugin-data:

0 commit comments

Comments
 (0)