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

Allow different instance type per role #675

Merged
merged 21 commits into from
Mar 1, 2018

Conversation

tmarballi
Copy link
Member

@tmarballi tmarballi commented Feb 12, 2018

@tmarballi
Copy link
Member Author

AppScaleLogger.warn("AppScale was unable to start the requested number "
"of instances, attempting to terminate those that "
"were started.")
if len(spawned_instance_ids) > 0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the caller do this?

node_layout.nodes[index].public_ip = public_ips[node_index]
node_layout.nodes[index].private_ip = private_ips[node_index]
node_layout.nodes[index].instance_id = instance_ids[node_index]
instance_type_roles = {'with_disks':{}, 'without_disks': {}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm having trouble figuring out the reason for this separation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cdonati azure cannot attach existing disks to scaleset machines so they would have to be created as regular machines, it was added in a little early with the expectation of managed disks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. That sounds like an implementation detail that belongs in the azure agent instead of here.

Copy link
Contributor

@jeanleonov jeanleonov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, but I think that changes to such basement functionality like start of deployment and scaling it should go with regression tests against different cloud providers.

@tmarballi
Copy link
Member Author

@jeanleonov I did test the autoscaling on Azure, euca and GCE. I can record those for a demo or do them live if you prefer that. Let me know if there's any specific test that you would like to see to confirm it works as it should.

@tmarballi
Copy link
Member Author

@tmarballi
Copy link
Member Author

@tmarballi
Copy link
Member Author

@tmarballi
Copy link
Member Author

@cdonati
Copy link
Member

cdonati commented Feb 27, 2018

@tmarballi Did you see my question about the caller performing the terminate? I think it would be unexpected for a spawn function to terminate other instances as a side effect.

@tmarballi
Copy link
Member Author

@cdonati Oops, I completely missed that. Looking into it now.

instance_type_params = params.copy()
instance_type_params['instance_type'] = instance_type

instance_ids, public_ips, private_ips = cls.spawn_nodes_in_cloud(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to clean up after itself if it encounters an exception?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does, It left my mind that we could technically have different instance types for LBs and it would need clean up if the 2nd LB faced a problem after the 1st one was started successfully. I have added the same try except as for non load balancer nodes.

@tmarballi
Copy link
Member Author

@tmarballi
Copy link
Member Author

"""
terminate_params = params.copy()
terminate_params[agent.PARAM_INSTANCE_IDS] = spawned_instance_ids
for _ in range(len(spawned_instance_ids)):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this running the terminate call multiple times (based on the number of started machines)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, it does not need a loop because the terminate instances method uses a list of instances to delete anyways.

@tmarballi
Copy link
Member Author

Latest all blue build: https://ocd.appscale.com:8080/job/Daily%20Build/4767/

@scragraham scragraham merged commit dadad21 into AppScale:master Mar 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants