dask-ec2 icon indicating copy to clipboard operation
dask-ec2 copied to clipboard

Added initial support for spot instances

Open stumitchell opened this issue 8 years ago • 11 comments

Hi I really don't know how the test harness is setup but this code does work in practice,

If I was to improve it I would make sure the try except handling for ec2 errors is around the right code,

and I would issue a warning if there are 0 non-spot instances (actually I haven't tested that so that probably fails too)

Stu

stumitchell avatar Jan 30 '17 21:01 stumitchell

Thanks for the PR @stumitchell ! I suspect things aren't passing CI because Travis times out. Looking briefly over the code it looks like things probably halt in wait_for_fulfillment(..) . I suspect we can mock some of those things out with moto: https://github.com/spulec/moto/blob/master/tests/test_ec2/test_spot_instances.py

I think we also want defaults to not use spot pricing: spot_count=0.

Because this doesn't require running machine the unittest suite can be fully executed with the following:

py.test dask_ec2/tests -s -vv

or a particular file:

py.test dask_ec2/tests/test_cluster.py -s -vv

or a particular function in a file:

py.test dask_ec2/tests/test_cluster.py::test_from_boto3 -s -vv

quasiben avatar Jan 31 '17 02:01 quasiben

Looks like master is failing with the same errors I am getting on this pr, so I'll wait till it is fixed

stumitchell avatar Feb 02 '17 22:02 stumitchell

@stumitchell thanks for looking at CI. Resolving shortly

quasiben avatar Feb 03 '17 02:02 quasiben

@stumitchell finished fixing CI. Rebase against master and push to trigger CI again

quasiben avatar Feb 03 '17 20:02 quasiben

Coverage Status

Coverage decreased (-1.05%) to 73.004% when pulling ae76aa1fde7e9ffabf3369e5d2ba906bcd1af7c1 on stumitchell:spot-instances into 9c60d9208ab6ff5e52ffc91227bb0c8b534a760e on dask:master.

coveralls avatar Feb 05 '17 23:02 coveralls

Coverage Status

Coverage decreased (-1.05%) to 73.004% when pulling ae76aa1fde7e9ffabf3369e5d2ba906bcd1af7c1 on stumitchell:spot-instances into 9c60d9208ab6ff5e52ffc91227bb0c8b534a760e on dask:master.

coveralls avatar Feb 05 '17 23:02 coveralls

Right this now passes but the new code is not covered by tests. It should be fairly simple to add tests to this, but I don't really have the time to do it.

Also I think the code would benefit if one of the team looked at it to add coverage, and perhaps check some of the corner cases i.e. --count=0 (if you don't have any non spots) and the placement of try except blocks.

stumitchell avatar Feb 06 '17 00:02 stumitchell

Any progress on this? It would be nice if this worked.

swamidass avatar Dec 28 '17 21:12 swamidass

I don't know of anything. If anyone has something a PR would be most welcome.

On Thu, Dec 28, 2017 at 1:30 PM, swamidass [email protected] wrote:

Any progress on this? It would be nice if this worked.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dask/dask-ec2/pull/66#issuecomment-354360863, or mute the thread https://github.com/notifications/unsubscribe-auth/AASszH6VxmjS-2zjs9yLRofy0g0fdWyjks5tFAiKgaJpZM4Lx6k9 .

mrocklin avatar Dec 28 '17 21:12 mrocklin

Ah, my apologies, I see now that this is a PR. It looks like this PR needs help with testing and coverage as mentioned by @stumitchell above. If you have time to help with this @swamidass that would be great

mrocklin avatar Dec 28 '17 21:12 mrocklin

In the mean time, I've generally been recommending Kubernetes to people: http://dask.pydata.org/en/latest/setup/kubernetes.html

mrocklin avatar Dec 28 '17 21:12 mrocklin