-
Notifications
You must be signed in to change notification settings - Fork 0
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
Start service on boot #42
Comments
For purposes of a spot instance, the solution to this would be a little more complicated. When a spot instance is terminated, it's the same as terminating a typical instance. This means that all the setup (mainly via ansible) won't be done. So it won't be as simple as just starting the service again. However, I think this would still be valuable for just being able to restart an instance normally. We'll likely want to create a It should also work well for spot instances as long as they aren't terminated. I'm doing work now to have spot instances stopped rather than terminated. They should start back up again automatically when there is spot instance availability again. |
I provisioned the alt server with a spot instance specifying to stop the instance on interruption. The instance started back up and the container was still there. Creating a However, there's a problem that needs to be resolved first. When the instance starts back up, it seems like it's possible for it to have a new IP address. This happened, and DNS was no longer mapping to the correct IP. I see two ways this could be fixed:
For the former, I think I'd want to use an Elastic IP. It seems that there's no charge for having a single IP associated with a EC2 instance. There's a small charge for when it's associated and the machine is down. This applies to us since the alt server will be stopped occasionally since it's a spot instance. However, I don't believe it's stopped for very long and I doubt this will be a problem. Still something to potentially keep an eye on.
I'm not sure which solution I would prefer. I may need to look into each to see what the implementation would look like. The elastic IP solution seems somewhat clean, although it's another piece to deal with and it could come with other complications or limits and I feel like I shouldn't have to rely on a specific IP and the DNS is really what should be handling this automatically. After a little research it appears that you can't create an alias directly to an EC2 instance, so the Elastic IP will hopefully be a clean implementation. |
So far the EIP solution was implemented and it seems like the instance restarts just fine. Next up is to implement a service that runs to start conjob on boot. I think a "oneshot" will work. NOTE: most of the work done so far has just been for the alt-env and needs to be carried over to the main service. |
Fixed by 47c48f6. |
In the deployed instance, set up conjob to start on boot.
This will help with being able to restart the server unattended knowing the service will come back up automatically.
Once this is done, create a follow up ticket to run the alt service as a
persistent
rather thanone-time
spot_type
. Then also consider reducing thespot_price
substantially since it isn't super important that it's always available since the conjob build doesn't run very often.The text was updated successfully, but these errors were encountered: