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

fog list fails if instance is not fully set up yet #28

Closed
mjd3 opened this issue Apr 15, 2022 · 6 comments
Closed

fog list fails if instance is not fully set up yet #28

mjd3 opened this issue Apr 15, 2022 · 6 comments
Assignees
Labels
bug Something isn't working medium-priority

Comments

@mjd3
Copy link
Collaborator

mjd3 commented Apr 15, 2022

Describe the bug
If the instance is still starting up, running ros2 fog list results in a FileNotFoundError.

To Reproduce
Steps to reproduce the behavior:

  1. Run ros2 launch fogros2_examples talker.launch.py
  2. While this is starting the EC2 instance, run ros2 fog list
  3. Errors with stack trace:

image

Expected behavior
Should output a list of current fogros2 instances.

@KeplerC
Copy link
Collaborator

KeplerC commented Apr 15, 2022

The current design is that we only flush the info file after the instance is launched, but we still create a directory for storing temporary files such as pem keys.

Is there any better way of doing this? (I know I need to add error handling)

@mjd3 mjd3 added the bug Something isn't working label Apr 15, 2022
@mjd3
Copy link
Collaborator Author

mjd3 commented Apr 15, 2022

Yeah I think there are multiple options here: 1) just check if the info file is not available yet and return an abbreviated description for this instance, 2) remove any instances from ros2 fog list that are not completely set up yet. I'd probably lean towards (1) but as long as it doesn't crash it's probably fine.

@jeffi
Copy link
Collaborator

jeffi commented Apr 28, 2022

The fix for #33 now reuses a single security group for all runs. We can use it to filter EC2 instances with the with fog list and related CLI commands.

  instances = boto3_client.describe_instances(
    Filters=[{"Name":"instance.group-name", "Values":["FOGROS2_SECURITY_GROUP"]}])

We could also consider using other AWS/EC2 functionality like tags.

With this, we can get most of the information related to an instance other than the private key. So we still have to store something locally. Also need to consider how we can do something similar with other providers (e.g., GCP).

@jeffi jeffi assigned jeffi and unassigned KeplerC Apr 28, 2022
@KeplerC
Copy link
Collaborator

KeplerC commented Apr 28, 2022

the check existence is resolved by 7807f26. We should close this issue

@KeplerC KeplerC closed this as completed Apr 28, 2022
@jeffi
Copy link
Collaborator

jeffi commented Apr 28, 2022

I'm working on a more robust version that queries AWS directly.

@jeffi jeffi reopened this Apr 28, 2022
@jeffi
Copy link
Collaborator

jeffi commented Apr 29, 2022

Updated CLI to use AWS API directly. Added some modifications to the launch process to support this change. FogROS 2 instances get names similar to Docker instances. EC2 instances now have a FogROS2-Name tag with their name. Associated commits: d15bb33 and d4f70e8.

@jeffi jeffi closed this as completed Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working medium-priority
Projects
None yet
Development

No branches or pull requests

3 participants