generated from TheDevOpsHub/terraform-template
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feature/swarms.ai #5
Open
jmikedupont2
wants to merge
39
commits into
main
Choose a base branch
from
feature/swarms.ai
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
558aa60
start of new version
2138b04
now creating
2badf08
machine image
51a0906
update
fdac521
now running
5ed453c
using ami
f29b5df
bugfix egress
f381197
adding updates and proposed changes
5c7e3a2
work in progress
7f1fd3a
starting
b9a7e36
moving towards asg support
d8898a4
now trying again with medium
7e7f8f9
many sizes
7f40ba1
now creating more sizes
107ae6a
removing too small
68c39a9
alb
790bb6b
create tg
8c10213
create tg
bb62580
applied
f9d0d56
group coming online
a135fe8
plan
b561619
wip
7e4cf29
update
1cf2295
health check
c6fd42c
update
049c6ef
start of swarms deploy
05ed0bd
start of swarms
248221c
now applying
1063aed
now applying
06f9a86
adding readme
464cc1c
insecure listener and updated instructions
334207b
building ami
79ec0b3
now larger drive
ada7442
new ami asg
2e59cc2
loading
c38d394
new installer
45f8b38
update
13621be
remove the slow asg
06a8b41
simple autoscale policy
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
test: | ||
find -name \*.tf -exec grep -r provider {} \; -print |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
|
||
# credentials | ||
|
||
set up ~/.aws/credentials | ||
``` | ||
[swarms] | ||
aws_access_key_id =${your key} | ||
aws_secret_access_key=${your SECRET} | ||
``` | ||
|
||
# install opentofu or terraform | ||
# install aws cli | ||
# install aws ssm plugin | ||
|
||
# create openai secret token | ||
|
||
TODO: | ||
`aws ssm set-parameter --name "swarms_openai_key"` | ||
|
||
# tofu init | ||
# tofu plan | ||
# tofu apply | ||
point the dns api.swarms.ai at the dns servers in godaddy | ||
|
||
`tofu state show module.swarms_api.module.alb.module.route53.data.aws_route53_zone.primary` | ||
|
||
```terraform | ||
# module.swarms_api.module.alb.module.route53.data.aws_route53_zone.primary: | ||
data "aws_route53_zone" "primary" { | ||
arn = "arn:aws:route53:::hostedzone/Z04162952OP7P14Z97UWY" | ||
caller_reference = "937599df-113d-4b02-8c75-4a20f8e6293e" | ||
id = "Z04162952OP7P14Z97UWY" | ||
name = "api.swarms.ai" | ||
name_servers = [ | ||
"ns-864.awsdns-44.net", | ||
"ns-1595.awsdns-07.co.uk", | ||
"ns-1331.awsdns-38.org", | ||
"ns-463.awsdns-57.com", | ||
] | ||
primary_name_server = "ns-864.awsdns-44.net" | ||
private_zone = false | ||
resource_record_set_count = 3 | ||
tags = {} | ||
zone_id = "Z04162952OP7P14Z97UWY" | ||
} | ||
``` | ||
so we need 4 records | ||
|
||
1. NS api.swarms.ai -> "ns-864.awsdns-44.net" | ||
2. NS api.swarms.ai -> "ns-1595.awsdns-07.co.uk" | ||
3. NS api.swarms.ai -> "ns-1331.awsdns-38.org" | ||
4. NS api.swarms.ai -> "ns-463.awsdns-57.com" | ||
|
||
see forum https://repost.aws/questions/QULXL3STgjQtefiJ_q0BixXA/configure-godaddy-subdomain-to-route53 | ||
|
||
it says ns records need fqdn! | ||
|
||
``` | ||
dig NS api.swarms.ai @97.74.103.14 | ||
|
||
; <<>> DiG 9.18.28-0ubuntu0.22.04.1-Ubuntu <<>> NS api.swarms.ai @97.74.103.14 | ||
;; global options: +cmd | ||
;; Got answer: | ||
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42722 | ||
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 4, ADDITIONAL: 1 | ||
;; WARNING: recursion requested but not available | ||
|
||
;; OPT PSEUDOSECTION: | ||
; EDNS: version: 0, flags:; udp: 1232 | ||
;; QUESTION SECTION: | ||
;api.swarms.ai. IN NS | ||
|
||
;; AUTHORITY SECTION: | ||
api.swarms.ai. 3600 IN NS ns-1912.awsdns-47.co.uk. | ||
api.swarms.ai. 3600 IN NS ns-184.awsdns-23.com. | ||
api.swarms.ai. 3600 IN NS ns-598.awsdns-10.net. | ||
api.swarms.ai. 3600 IN NS ns-1175.awsdns-18.org. | ||
|
||
;; Query time: 5 msec | ||
;; SERVER: 97.74.103.14#53(97.74.103.14) (UDP) | ||
;; WHEN: Wed Dec 18 09:20:45 EST 2024 | ||
;; MSG SIZE rcvd: 182 | ||
``` | ||
|
||
``` | ||
mdupont@mdupont-G470:~/swarms-terraform/accounts/swarms$ dig NS api.swarms.ai +trace | ||
|
||
; <<>> DiG 9.18.28-0ubuntu0.22.04.1-Ubuntu <<>> NS api.swarms.ai +trace | ||
;; global options: +cmd | ||
. 198100 IN NS b.root-servers.net. | ||
. 198100 IN NS j.root-servers.net. | ||
. 198100 IN NS a.root-servers.net. | ||
. 198100 IN NS d.root-servers.net. | ||
. 198100 IN NS c.root-servers.net. | ||
. 198100 IN NS g.root-servers.net. | ||
. 198100 IN NS l.root-servers.net. | ||
. 198100 IN NS i.root-servers.net. | ||
. 198100 IN NS h.root-servers.net. | ||
. 198100 IN NS f.root-servers.net. | ||
. 198100 IN NS e.root-servers.net. | ||
. 198100 IN NS m.root-servers.net. | ||
. 198100 IN NS k.root-servers.net. | ||
;; Received 811 bytes from 127.0.0.53#53(127.0.0.53) in 10 ms | ||
|
||
ai. 172800 IN NS v0n0.nic.ai. | ||
ai. 172800 IN NS v0n1.nic.ai. | ||
ai. 172800 IN NS v0n2.nic.ai. | ||
ai. 172800 IN NS v0n3.nic.ai. | ||
ai. 172800 IN NS v2n0.nic.ai. | ||
ai. 172800 IN NS v2n1.nic.ai. | ||
ai. 86400 IN DS 44137 8 2 7886BD35ED745DCA983D951A643495B929B3A7676A88C682EF88EB6F EDBDB253 | ||
ai. 86400 IN DS 3799 8 2 8A8030D4661AE6FCF417349682AC058648371002E70E717E4CF2F11F 83543385 | ||
ai. 86400 IN RRSIG DS 8 1 86400 20241231050000 20241218040000 61050 . chqcZJHy4mAsB6DryQAHcvFBsUDVkhHQStDq65NbEXoeo+sfNsRWVpGV qyibbDL8nLY0QDOifh5EXu1Mnf6ZXqs8NPaPBEwCpA9oVmRA0t3vG2th jrDhKY77f4iL4ovMQLBSYbF5x61HnFZXcgyI22YDbbChsC6rCwmNJnwj sldGSNknyRy4ytEwbsWYquRmXIzSHJ2O9lMw1l/vUHpw9/xo6k26TyhZ 3bydt6Sg/e56zwevU0oW1sRpR9aKwn4x/0X0txKmUo+2wWtJr/GXLJ28 uWIuEF71Tvg2QKM0XqZ2CLeURCkU3v4sV92vKQ3rY0GkMiKKlWYFaC8Q Ev4+0A== | ||
;; Received 807 bytes from 199.7.91.13#53(d.root-servers.net) in 11 ms | ||
|
||
;; communications error to 2001:500:a4::1#53: timed out | ||
;; communications error to 2001:500:a4::1#53: timed out | ||
;; communications error to 2001:500:a4::1#53: timed out | ||
;; communications error to 2001:500:a1::1#53: timed out | ||
;; communications error to 2001:500:a2::1#53: timed out | ||
;; communications error to 2001:500:a5::1#53: timed out | ||
swarms.ai. 3600 IN NS ns27.domaincontrol.com. | ||
swarms.ai. 3600 IN NS ns28.domaincontrol.com. | ||
58cj07tk4r4uuu6m10c83sia655jfil6.ai. 86400 IN NSEC3 1 1 0 73 58MDDLU23QVIIIQ5GPLB3A6K7OB4F5JH NS SOA TXT RRSIG DNSKEY NSEC3PARAM ZONEMD | ||
jib3vggauf3u1alb3kfuqrcjo6a0v2hq.ai. 86400 IN NSEC3 1 1 0 73 JIGGLMUFEJ6D5CFLQAC5CFQICTP7IJTE NS DS RRSIG | ||
58cj07tk4r4uuu6m10c83sia655jfil6.ai. 86400 IN RRSIG NSEC3 8 2 86400 20250108141827 20241218131827 6279 ai. r8VEiuIyhowQ2sXxszJEgCBMnMEkyboj418iO/jJfUKxWM408IJTSiuO aALz97JNhHMyzPxScRCO+Vcr3EOuoBknhiO5oO9w7UDnuzxNRyPuevV6 WdloLDUc3GRKSPxWom4/Dh+yaMTBXr2xiDDpIvmAElU5q1oGceB+5wWf 4i4= | ||
jib3vggauf3u1alb3kfuqrcjo6a0v2hq.ai. 86400 IN RRSIG NSEC3 8 2 86400 20250107151955 20241217141955 6279 ai. vyYgTKyNXo+kYzRoc0zYeR544efw1GPI4br3GtS4lRaUwzc3sEFKtoyo /nNGBWKgnYxlWyhrAgTvCQTLO1Qt6uJWyHVcog+6hcVcbeFsL6whp/u8 LKHOtSFg2C/FzqP3JktiSPO5CcQh6WiBik2KXhkD00lMjXfStciqk9nP osk= | ||
;; Received 583 bytes from 199.115.156.1#53(v2n0.nic.ai) in 22 ms | ||
|
||
api.swarms.ai. 3600 IN NS ns-1912.awsdns-47.co.uk. | ||
api.swarms.ai. 3600 IN NS ns-184.awsdns-23.com. | ||
api.swarms.ai. 3600 IN NS ns-598.awsdns-10.net. | ||
api.swarms.ai. 3600 IN NS ns-1175.awsdns-18.org. | ||
;; Received 182 bytes from 173.201.71.14#53(ns28.domaincontrol.com) in 5 ms | ||
|
||
;; Received 31 bytes from 205.251.199.120#53(ns-1912.awsdns-47.co.uk) in 4 ms | ||
``` | ||
|
||
https://toolbox.googleapps.com/apps/dig/#ANY/ returns | ||
for swarms.ai this: | ||
``` | ||
id 44700 | ||
opcode QUERY | ||
rcode NOERROR | ||
flags QR RD RA | ||
;QUESTION | ||
swarms.ai. IN ANY | ||
;ANSWER | ||
swarms.ai. 3600 IN A 15.197.225.128 | ||
swarms.ai. 3600 IN A 3.33.251.168 | ||
swarms.ai. 3600 IN NS ns28.domaincontrol.com. | ||
swarms.ai. 3600 IN NS ns27.domaincontrol.com. | ||
swarms.ai. 3600 IN SOA ns27.domaincontrol.com. dns.jomax.net. 2024121702 28800 7200 604800 600 | ||
swarms.ai. 3600 IN TXT "google-site-verification=VlUvNHJo0LQzJzm7SIwMzYLB7-Rexx4yxcSJKh0VtjE" | ||
;AUTHORITY | ||
;ADDITIONAL | ||
``` | ||
|
||
# tofu apply | ||
|
||
`tofu apply` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
locals { | ||
#ami_name = "ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64-server-*" | ||
ami_name = "ubuntu-minimal/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64-minimal-*" | ||
dns = "api.swarms.ai" | ||
account = "916723593639" | ||
region = "us-east-2" | ||
} | ||
|
||
provider aws { | ||
region = "us-east-2" | ||
profile = "swarms" | ||
} | ||
output dns { | ||
value = local.dns | ||
} | ||
|
||
output profile { | ||
value = "swarms" | ||
} | ||
|
||
output account { | ||
value = "916723593639" | ||
} | ||
|
||
output region { | ||
value = "us-east-2" | ||
} | ||
|
||
#SLOW | ||
data "aws_ami" "ami" { | ||
most_recent = true | ||
name_regex = "^${local.ami_name}" | ||
} | ||
|
||
module "swarms_api" { | ||
source = "../../environments/swarms-aws-agent-api/dev/us-east-1" | ||
domain = local.dns | ||
ami_id = data.aws_ami.ami.id | ||
#"ami-0ad5d6c7069ce56ac" | ||
#ami_id = "ami-0ad5d6c7069ce56ac" | ||
|
||
name = "swarms" | ||
tags = {project="swarms"} | ||
|
||
} | ||
|
||
output api { | ||
value = module.swarms_api | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to be under version control?