Skip to content

Feature/v2/telegram #48

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

Open
wants to merge 3 commits into
base: feature/runbook
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,45 @@ flycheck_*.el

/logs/logs/
.aider*
all.txt
aide.txt
ellamacodereviewmodulelt_dynamic_ami_prod.org
.terraform.lock.hcl
err
error.txt
files.txt
accounts/AI_Token_Team/.terraform.lock.hcl
accounts/mdupont/athena.txt
accounts/mdupont/batch.org
accounts/mdupont/batch2.org
accounts/mdupont/cf.org
accounts/mdupont/cloudfront.cf
accounts/mdupont/codebuild.txt
accounts/mdupont/drift.txt
accounts/mdupont/lattice-cybersecurity.md
accounts/mdupont/lattice.md
accounts/mdupont/swarms_alb_target_group.cf
accounts/mdupont/plan.org
accounts/mdupont/plan.txt
accounts/mdupont/reflog.txt
accounts/mdupont/remove.cf
accounts/mdupont/review.org
accounts/mdupont/states_new.txt
accounts/mdupont/states.txt
accounts/mdupont/swarms.cf
accounts/mdupont/targets.txt
accounts/mdupont/tt
accounts/mdupont/tt2
accounts/mdupont/installq.org
accounts/ariana/main.tf
logs/github.txt
cloudformation/params.txt
logs/names.txt
logs/parts.txt
logs/report.txt
logs/requirements.txt
logs/ttt
modules/build/builder.cf
modules/build/cf.cf
tasks/converter.md
accounts/mdupont/generated/
3 changes: 3 additions & 0 deletions accounts/mdupont/patch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
terraform plan -no-color > plan.txt
grep create plan.txt | cut -d" " -f4 | grep module > targets.txt
for x in `cat targets.txt`; do echo " --target '$x'"; done | sed -e "s;\n;;g" | tr -d '\n'^J^J > tt 2>tt2
92 changes: 18 additions & 74 deletions cloudformation/standalone_cloudformation/cloudformation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,10 @@ Parameters:
Description: "git repo for the agent you can modify this to your own repo"
Default : "https://github.com/meta-introspector/cloud-deployment-eliza/"

AgentCharacterFile:
Type: "String"
Description: "File name of agent to load, FIXME not used yet"
# referenced ~/cloud-deployment-eliza/systemd/agent-docker.service
Default: "/app/agent/characters/tine-test.character.json"

GitBranch:
Type: "String"
Description: "git branch for the agent you can modify this to your own branch"
Default: "feature/signoz"

GroqKey:
NoEcho: true
Type: 'String'
Description: 'secret groq key (hidden)'

TwitterEmail:
NoEcho: true
Type: 'String'
Description: 'twitter email (hidden)'

TwitterPassword:
NoEcho: true
Type: 'String'
Description: 'twitter password (please dont use chars like single quote ()!"${} in the password due to known bugs (hidden)'

TwitterUserName:
NoEcho: true
Type: 'String'
Description: 'twitter username (hidden)'
Default: "feature/v2/telegram"

AgentCodeName:
Type: 'String'
Expand All @@ -59,16 +33,6 @@ Parameters:
Type: "String"
Description: 'aws image id that is specific to the region you must also accept the licence for the ami'

SSMParameterPattern:
Type: 'String'
Description: 'pattern for ssm parameter, leave default'
Default: "tine_agent_*"

S3BucketPattern:
Type: 'String'
Description: 'pattern for ssm parameter, leave default'
Default: "tine_agent_*"

AgentImage:
Type: 'String'
Description: 'agent docker image to load'
Expand Down Expand Up @@ -96,15 +60,7 @@ Resources:
Tier: 'Standard'
Description: 'Parameter for Tine Agent image'

TineAgentGroqKey:
Type: 'AWS::SSM::Parameter'
Properties:
Name: !Sub '${AgentCodeName}_GROQ_API_KEY'
Type: 'String'
Value: !Ref GroqKey
Tier: 'Standard'
Description: 'Secret Parameter for Groq Key'


TineAgentTokenizerImage:
Type: 'AWS::SSM::Parameter'
Properties:
Expand All @@ -114,32 +70,6 @@ Resources:
Tier: 'Standard'
Description: 'Parameter for Tokenizer Image'

TineAgentTwitterEmail:
Type: 'AWS::SSM::Parameter'
Properties:
Name: !Sub '${AgentCodeName}_TWITTER_EMAIL'
Type: 'String'
Value: !Ref TwitterEmail
Tier: 'Standard'
Description: 'Parameter for TwitterEmail'

TineAgentTwitterPassword:
Type: 'AWS::SSM::Parameter'
Properties:
Name: !Sub '${AgentCodeName}_TWITTER_PASSWORD'
Type: 'String'
Value: !Ref TwitterPassword
Tier: 'Standard'
Description: 'Parameter for TwitterPassword'

TineAgentTwitterUserName:
Type: 'AWS::SSM::Parameter'
Properties:
Name: !Sub '${AgentCodeName}_TWITTER_USERNAME'
Type: 'String'
Value: !Ref TwitterUserName
Tier: 'Standard'
Description: 'Parameter for TwitterUserName'

IAMRoleAgent:
Type: "AWS::IAM::Role"
Expand Down Expand Up @@ -268,6 +198,13 @@ Resources:
export AGENT_NAME="${AgentCodeName}"
export GIT_REPO="${GitRepo}" # FIXME
export GIT_BRANCH="${GitBranch}" # FIXME

mkdir /etc/agent/

echo AGENT_NAME="${AgentCodeName}" > /etc/agent/env
echo GIT_REPO="${GitRepo}" >> /etc/agent/env
echo GIT_BRANCH="${GitBranch}" >> /etc/agent/env

export HOME=/root
apt update
apt-get install -y ec2-instance-connect git wget unzip systemd curl
Expand All @@ -286,7 +223,7 @@ Resources:
git stash
git fetch --all
git checkout --track --force "origin/${GitBranch}"
bash -x /opt/agent/rundocker.sh
bash -x /opt/agent/scripts/rundocker.sh

BlockDeviceMappings:
-
Expand All @@ -308,7 +245,14 @@ Resources:
DependsOn:
- EC2LaunchTemplate
- AWSServiceRoleForAutoScaling
Properties:

Properties:
Tags:
-
Key : Name
Value: !Sub "${AgentCodeName}-agent"
PropagateAtLaunch : true

AutoScalingGroupName: "docker-agent-ami-t4g.small"
LaunchTemplate:
LaunchTemplateName: "agent-docker-t4g.small-launch-template"
Expand Down
Loading