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

Support for Amazon Aws AutoScale Servers #367

Open
aftabnaveed opened this issue Mar 13, 2018 · 4 comments
Open

Support for Amazon Aws AutoScale Servers #367

aftabnaveed opened this issue Mar 13, 2018 · 4 comments

Comments

@aftabnaveed
Copy link

aftabnaveed commented Mar 13, 2018

We have an application running on Amazon AWS which has Amazon AutoScale enabled. Every few days old servers are terminated and new servers are spawned. The biggest problem we have is to deploy the latest code on the newly spawned servers. Currently, we are using Amazon CodeDeploy agent along with bitbucket which automatically pulls the bitbucket code and deploys it.

My question Is there a way to automatically deploy code to the servers created automatically by Amazon AWS's autoscale policy? Is there any artisan command which can be executed to deploy the latest build after server launch?

@REBELinBLUE
Copy link
Owner

Is this spinning up additional instances with new IP addresses, or is it spinning up new instances with more resources and replacing the old ones with the same IP addresses?

If it is the former I don't think deployer would work without a lot of work as the server would need to be configured in the project.

The latter would in theory work because deployer has a webhook you could call, but it would also require some work. You could set it up to notify an SNS topic when autoscaled https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html then you'd need a simple node worker subscribed to the topic which could call the webhook. Unfortunately the issue I can see is unless they have fixed public IPs before they replace the existing instance (which I assume they won't) you'd hit the same problem as in the first scenario

@aftabnaveed
Copy link
Author

The Autoscale servers unfortunately does not have static IP addresses and Amazon assigns a new IP address to the newly spawned server. I know it is a bit tricky to pull the latest code because deployer seems to be based on push model. I do have a suggestion and I am not sure if it would work but I will throw it any way here:

Why not create a worker for deployer and run it on the newly spawned server. The worker listens to the deployer webhooks and pulls the code as soon as the code is pushed to the repository. I may need to add some additional info to support my suggestion but I would like to hear your initial thoughts on this?

@skyrpex
Copy link

skyrpex commented Apr 4, 2018

Not sure if Deployer has an API? I guess not, because you could use it to add/remove the servers and trigger a deployment.

@REBELinBLUE
Copy link
Owner

At present deployer doesn't have an API, it is on my list and in theory should be fairly simple as most endpoints are simple JSON endpoints anyway as creating/updating/deleting is all done via AJAX. Unfortunately I am not sure when I will get a chance to work on deployer at the moment.

@aftabnaveed I'm not sure I understand, if there is a worker on the server which listens for git pushes how will that trigger a deploy when a new instance is spawned?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants