Skip to content
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

add region flag #90

Merged
merged 5 commits into from
Jun 26, 2024
Merged

add region flag #90

merged 5 commits into from
Jun 26, 2024

Conversation

nph4rd
Copy link
Contributor

@nph4rd nph4rd commented Jun 24, 2024

depends on: agentsea/agentdesk#26

@nph4rd nph4rd requested review from pbarker and zhuraromdev June 24, 2024 19:23
@pbarker
Copy link
Contributor

pbarker commented Jun 25, 2024

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
Copy link
Contributor Author

nph4rd commented Jun 25, 2024

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
Copy link
Contributor

pbarker commented Jun 25, 2024

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
Copy link
Contributor Author

nph4rd commented Jun 25, 2024

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
Copy link
Contributor

pbarker commented Jun 25, 2024

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
Copy link
Contributor Author

nph4rd commented Jun 25, 2024

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 agentsea/agentdesk#26 for the validation.

@nph4rd
Copy link
Contributor Author

nph4rd commented Jun 25, 2024

Bumped agentdesk version in 6ad0397

@nph4rd nph4rd requested a review from zhuraromdev June 25, 2024 19:28
@nph4rd
Copy link
Contributor Author

nph4rd commented Jun 25, 2024

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

@pbarker
Copy link
Contributor

pbarker commented Jun 26, 2024

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

@nph4rd
Copy link
Contributor Author

nph4rd commented Jun 26, 2024

done - @pbarker let's 🚢 :)

surfkit/cli/main.py Outdated Show resolved Hide resolved
@nph4rd nph4rd requested a review from pbarker June 26, 2024 03:08
@pbarker pbarker merged commit 5d94a13 into main Jun 26, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants