-
Notifications
You must be signed in to change notification settings - Fork 337
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
feat: support for using spot instances #171
base: main
Are you sure you want to change the base?
Conversation
@machulav, kindly requesting your opinion on this. Would it be possible to merge and release this feature? |
great work! spot requests are really missing for the one-off builds, thanks for working on this @troinine . I think actions like this one should be adopted by aws official or by github official repos 🧐 because it's kind of a must have functionality for either of these companies. |
What about the bid price though, is it automatic on aws side when that function is called, and uses the current market price? Has a bit more chance of termination for long builds then, isn't it? if ec2 gets quickly outbid by other requests. |
Good point. Initially, I allowed for a configurable bid price, but after considering some experiences and reviewing the AWS documentation, I reverted to using defaults. Not defining a bid price gives the best chance of running the instance uninterrupted. According to the RunInstances API documentation:
|
I wonder if the linter status is a blocker for it to get merged 🧐 can i help somehow push it through? 😅 i want to use the main release so waiting for it to get merged. btw there's this "cpu options" to make "threads_per_core=1", it seems not available in current options. maybe we should allow an array of all possible aws sdk options to be passed as a whole?
it could be a good option to let the user chose any 'input' fields to append, like 'extraOptions:' and whatever goes there. because there are so many options to the ec2 spawn operation. storage mapping, networking stuff, launch template to use, resource group, etc. what do you think? |
Hi all hope you're having a good new year 🎉
|
You could activate the Instance Termination Protection, right after the instance has launched. This will prohibit the action from terminating the instance. Then you will have enough time to connect to the instance (e.g. via SSH oder SSM agent) and have a look if the GitHub Runner is active |
basically user-data script had syntax errors, because I merged a mix of windows support and spots, while making a mess in that js file 😁 works nicely. i hope this gets merged. |
Any idea when this could get merged? |
+1 |
@machulav Could you please prioritise your review on this one pls? it will be a great addition! 🙏🏻 |
I'm not sure whether this project is still maintained, but for anyone interested I recently launched RunsOn, which supports spot instances, arm64, compatible images, etc. and is backed by many clients so it won't go away anytime soon. This project was an inspiration for that work, so hopefully it continues to live since it fills a specific use-case well. |
@troinine can you update the dist/index.js and src/aws.js, want to test this out asap so that we can get this feature in. |
Closes #169
This PR adds an optional variable to request EC2 Spot instances which are significantly more cost-effective for running non-critical workloads compared on-demand pricing.
The default functionality remains the same. If you do not define
market-type
, you get on-demand instances. Tested to work on an actual AWS account:Start:
Stop:
P.S. I have some future improvement ideas like reverting to on-demand capacity if the spot request cannot be fulfilled but I wanted to keep it simple for now, especially since there are no tests in the project (which are another area of improvement).