agentsea / surfkit

A toolkit for building multimodal AI agents
https://docs.hub.agentsea.ai
MIT License
113 stars 10 forks source link

add region flag #90

Closed nph4rd closed 5 months ago

nph4rd commented 5 months ago

depends on: https://github.com/agentsea/agentdesk/pull/26

pbarker commented 5 months ago

Okay update here, I've made the image available and public in the following regions:

"us-west-1" "us-west-2" "eu-west-1" "eu-central-1" "ap-southeast-1"

We should add a check that the given region is in one of the supported regions.

This also makes https://github.com/agentsea/agentdesk/blob/main/agentdesk/vm/img.py#L20 this ami ID invalid. We will need to update https://github.com/agentsea/agentdesk/blob/main/agentdesk/vm/ec2.py#L69 to fetch the ami ID by image name, something like:

import boto3

def find_ami_by_name(ami_name, region):
    ec2_client = boto3.client('ec2', region_name=region)

    response = ec2_client.describe_images(
        Filters=[
            {
                'Name': 'name',
                'Values': [ami_name]
            }
        ]
    )

    images = response.get('Images', [])

    if not images:
        print(f"No AMI found with the name: {ami_name}")
        return None

    # Assuming the first image in the response is the desired one
    ami = images[0]
    return ami

The ami name is agentd-ubuntu-22.04-20240529073401

nph4rd commented 5 months ago

Ok - I can add those changes. Can we make it available on ap-northeast-1 too? That's the region that's being used in the OP.

pbarker commented 5 months ago

sorry yes here is the correct list "us-west-1" "us-west-2" "eu-west-1" "eu-central-1" "ap-southeast-1" "ap-northeast-1"

nph4rd commented 5 months ago

sorry yes here is the correct list "us-west-1" "us-west-2" "eu-west-1" "eu-central-1" "ap-southeast-1" "ap-northeast-1"

Just to confirm: us-east-1 is obviously available too, right? That was the default.

pbarker commented 5 months ago

sorry yes here is the correct list "us-west-1" "us-west-2" "eu-west-1" "eu-central-1" "ap-southeast-1" "ap-northeast-1"

Just to confirm: us-east-1 is obviously available too, right? That was the default.

yep

nph4rd commented 5 months ago

We will need to update https://github.com/agentsea/agentdesk/blob/main/agentdesk/vm/ec2.py#L69

Interesting - it looks like the ID hasn't changed:

Found AMI with name: agentd-ubuntu-22.04-20240529073401 and ID: ami-06f3f5d8474ba4099

Anyway - opened https://github.com/agentsea/agentdesk/pull/26 for the validation.

nph4rd commented 5 months ago

Bumped agentdesk version in 6ad0397

nph4rd commented 5 months ago

Lint will fail until we can run the poetry lock with the new agentdesk version btw.

pbarker commented 5 months ago

0.2.86 of agentdesk is now released, lets update the deps here and get this merged 🚢

nph4rd commented 5 months ago

done - @pbarker let's 🚢 :)