Commit Graph
52 Commits
Author SHA1 Message Date
Richard LiawandGitHub dbba7f2a53 [autoscaler] Cleanup Logging (#2709)
Moves Autoscaler onto Python `logging` module.
2018-08-25 17:08:45 -07:00
Eric LiangandGitHub 9473da69bd [autoscaler] Experimental support for local / on-prem clusters (#2678)
This adds some experimental (undocumented) support for launching Ray on existing nodes. You have to provide the head ip, and the list of worker ips.

There are also a couple additional utils added for rsyncing files and port-forward.
2018-08-19 12:43:04 -07:00
Eric LiangandGitHub 079c4e482a ray exec and ray attach commands (#2560)
ray exec CLUSTER CMD [--screen] [--start] [--stop]
ray attach CLUSTER [--start]

Example:
ray exec sgd.yaml 'source activate tensorflow_p27 && cd ~/ray/python/ray/rllib && ./train.py --run=PPO --env=CartPole-v0' --screen --start --stop

This will in one command create a cluster and run the command on it in a screen session. The screen can later be attached to via ray attach. After the command finishes, the cluster workers will be terminated and the head node stopped.
2018-08-15 14:31:50 -07:00
Melih ElibolandGitHub 89f60e39f3 Override user-specified name tag. (#2480)
Override user-specified name tag.
2018-08-01 14:16:57 -04:00
Steve SeveranceandEric Liang f1b4ea69a3 Prevent hasher from running out of memory on large files (#2451)
* Prevent hasher from running out of memory on large files

* dump out keys

* only print if failed

* remove debugging

* Fix lint error. Reverse adding newline.
2018-07-28 23:29:09 -07:00
Eric LiangandRobert Nishihara 90a3ea9443 [xray] Fix heartbeat subscription for autoscaler (#2498) 2018-07-28 13:34:55 -07:00
Richard LiawandGitHub 5188b1d080 [autoscaler] Bug for file mounts for tilde (#2382) 2018-07-12 19:18:47 +02:00
Robert NishiharaandPhilipp Moritz 35f4a3070c Update 0.4.0 to 0.5.0 in autoscaler and installation examples. (#2352) 2018-07-07 14:34:20 -07:00
Adam GleaveandEric Liang 89460b8d11 autoscaler: count head node, don't kill below target (fixes #2317) (#2320)
Specifically, subtracts 1 from the target number of workers, taking into
account that the head node has some computational resources.

Do not kill an idle node if it would drop us below the target number of
nodes (in which case we just immediately relaunch).
2018-06-28 15:33:51 -07:00
Adam GleaveandEric Liang 30684446a6 Support multiple availability zones in AWS (fix #2177) (#2254)
* AWS: support multiple availability zones (fix #2177)

* Bugfix: [] rather than ()

* Test config

* Test config tweaks

* Remove test config

* Formatting fixes

* Update YAML config
2018-06-19 20:22:07 -07:00
Eric LiangandGitHub 7fcaad264a [autoscaler] Translate to/from AWS 'Name' tag (#2219)
* fix tag

* fix
2018-06-11 12:10:10 -07:00
Eric LiangandRichard Liaw 8da558f5b7 [autoscaler] Should use internal IP for ssh (#2209) 2018-06-08 01:08:59 -07:00
Eric LiangandRobert Nishihara 31046f7e06 Autoscaler Python 2 queue fix (#2205) 2018-06-07 18:43:07 -07:00
Eric LiangandRobert Nishihara 100d8c207f [xray] [autoscaler] Fix autoscaler / raylet integration (#2143) 2018-06-07 15:43:20 -07:00
Adam GleaveandEric Liang 6ef3b255ea Launch nodes in separate threads (#2183)
Modifies the autoscaler to run launch_new_nodes in a separate thread, keeping track of the number of pending requests.
2018-06-05 20:19:31 -07:00
Kristian HartikainenandRichard Liaw 74dc14d1fc [autoscaler] GCP node provider (#2061)
* Google Cloud Platform scaffolding

* Add minimal gcp config example

* Add googleapiclient discoveries, update gcp.config constants

* Rename and update gcp.config key pair name function

* Implement gcp.config._configure_project

* Fix the create project get project flow

* Implement gcp.config._configure_iam_role

* Implement service account iam binding

* Implement gcp.config._configure_key_pair

* Implement rsa key pair generation

* Implement gcp.config._configure_subnet

* Save work-in-progress gcp.config._configure_firewall_rules.

These are likely to be not needed at all. Saving them if we happen to
need them later.

* Remove unnecessary firewall configuration

* Update example-minimal.yaml configuration

* Add new wait_for_compute_operation, rename old wait_for_operation

* Temporarily rename autoscaler tags due to gcp incompatibility

* Implement initial gcp.node_provider.nodes

* Still missing filter support

* Implement initial gcp.node_provider.create_node

* Implement another compute wait
  operation (wait_For_compute_zone_operation). TODO: figure out if we
  can remove the function.

* Implement initial gcp.node_provider._node and node status functions

* Implement initial gcp.node_provider.terminate_node

* Implement node tagging and ip getter methods for nodes

* Temporarily rename tags due to gcp incompatibility

* Tiny tweaks for autoscaler.updater

* Remove unused config from gcp node_provider

* Add new example-full example to gcp, update load_gcp_example_config

* Implement label filtering for gcp.node_provider.nodes

* Revert unnecessary change in ssh command

* Revert "Temporarily rename tags due to gcp incompatibility"

This reverts commit e2fe634c5d11d705c0f5d3e76c80c37394bb23fb.

* Revert "Temporarily rename autoscaler tags due to gcp incompatibility"

This reverts commit c938ee435f4b75854a14e78242ad7f1d1ed8ad4b.

* Refactor autoscaler tagging to support multiple tag specs

* Remove missing cryptography imports

* Update quote function import

* Fix threading issue in gcp.config with the compute discovery object

* Add gcs support for log_sync

* Fix the labels/tags naming discrepancy

* Add expanduser to file_mounts hashing

* Fix gcp.node_provider.internal_ip

* Add uuid to node name

* Remove 'set -i' from updater ssh command

* Also add TODO with the context and reason for the change.

* Update ssh key creation in autoscaler.gcp.config

* Fix wait_for_compute_zone_operation's threading issue

Google discovery api's compute object is not thread safe, and thus
needs to be recreated for each thread. This moves the
`wait_for_compute_zone_operation` under `autoscaler.gcp.config`, and
adds compute as its argument.

* Address pr feedback from @ericl

* Expand local file mount paths in NodeUpdater

* Add ssh_user name to key names

* Update updater ssh to attempt 'set -i' and fall back if that fails

* Update gcp/example-full.yaml

* Fix wait crm operation in gcp.config

* Update gcp/example-minimal.yaml to match aws/example-minimal.yaml

* Fix gcp/example-full.yaml comment indentation

* Add gcp/example-full.yaml to setup files

* Update example-full.yaml command

* Revert "Refactor autoscaler tagging to support multiple tag specs"

This reverts commit 9cf48409ca2e5b66f800153853072c706fa502f6.

* Update tag spec to only use characters [0-9a-z_-]

* Change the tag values to conform gcp spec

* Add project_id in the ssh key name

* Replace '_' with '-' in autoscaler tag names

* Revert "Update updater ssh to attempt 'set -i' and fall back if that fails"

This reverts commit 23a0066c5254449e49746bd5e43b94b66f32bfb4.

* Revert "Remove 'set -i' from updater ssh command"

This reverts commit 5fa034cdf79fa7f8903691518c0d75699c630172.

* Add fallback to `set -i` in force_interactive command

* Update autoscaler tests to match current implementation

* Update GCPNodeProvider.create_node to include hash in instance name

* Add support for creating multiple instance on one create_node call

* Clean TODOs

* Update styles

* Replace single quotes with double quotes
* Some minor indentation fixes etc.

* Remove unnecessary comment. Fix indentation.

* Yapfify files that fail flake8 test

* Yapfify more files

* Update project_id handling in gcp node provider

* temporary yapf mod

* Revert "temporary yapf mod"

This reverts commit b6744e4e15d4d936d1a14f4bf155ed1d3bb14126.

* Fix autoscaler/updater.py lint error, remove unused variable
2018-05-31 09:00:03 -07:00
Alok SinghandPhilipp Moritz f795173b51 Use flake8-comprehensions (#1976)
* Add flake8 to Travis

* Add flake8-comprehensions

[flake8 plugin](https://github.com/adamchainz/flake8-comprehensions) that
checks for useless constructions.

* Use generators instead of lists where appropriate

A lot of the builtins can take in generators instead of lists.

This commit applies `flake8-comprehensions` to find them.

* Fix lint error

* Fix some string formatting

The rest can be fixed in another PR

* Fix compound literals syntax

This should probably be merged after #1963.

* dict() -> {}

* Use dict literal syntax

dict(...) -> {...}

* Rewrite nested dicts

* Fix hanging indent

* Add missing import

* Add missing quote

* fmt

* Add missing whitespace

* rm duplicate pip install

This is already installed in another file.

* Fix indent

* move `merge_dicts` into utils

* Bring up to date with `master`

* Add automatic syntax upgrade

* rm pyupgrade

In case users want to still use it on their own, the upgrade-syn.sh script was
left in the `.travis` dir.
2018-05-20 16:15:06 -07:00
Alok SinghandRichard Liaw 9a8f29e571 YAPF, take 3 (#2098)
* Use pep8 style

The original style file is actually just pep8 style, but with everything
spelled out. It's easier to use the `based_on_style` feature. Any overrides are
clearer that way.

* Improve yapf script

1. Do formatting in parallel
2. Lint RLlib
3. Use .style.yapf file

* Pull out expressions into variables

* Don't format rllib

* Don't allow splits in dicts

* Apply yapf

* Disallow single line if-statements

* Use arithmetic comparison

* Simplify checking for changed files

* Pull out expr into var
2018-05-19 16:07:28 -07:00
Melih ElibolandRobert Nishihara bea97b425b Fix python linting (#2076) 2018-05-16 15:04:31 -07:00
Eric LiangandGitHub 3f1dd29eab [autoscaler] Remove faulty assert that breaks during downscaling, pull configs from env (#2006)
* fixes

* coment out test

* Update ray_constants.py

* Update autoscaler_test.py

* Update ray_constants.py

* lint

* lint
2018-05-15 12:47:11 -07:00
Eric LiangandGitHub 9ad94e33d6 updates (#1958) 2018-04-27 19:44:21 -07:00
Robert NishiharaandPhilipp Moritz 1a6b5b04e6 Pin Cython in autoscaler development example. (#1951) 2018-04-26 00:17:29 -07:00
Philipp MoritzandRobert Nishihara 74162d1492 Lint Python files with Yapf (#1872) 2018-04-11 10:11:35 -07:00
Robert NishiharaandPhilipp Moritz d3e974a9a4 Increase ulimit -n in autoscaler examples. (#1769) 2018-04-02 00:32:56 -07:00
Robert NishiharaandPhilipp Moritz 23b8793f0e Update documentation and autoscaler to find 0.4.0. (#1789) 2018-04-02 00:28:47 -07:00
Christian BarraandRichard Liaw 13b3df9321 Check if the provider is external before getting the config. (#1743) 2018-03-22 22:59:29 -07:00
Christian BarraandEric Liang 070e27ea7a Add external module as a node scaler. (#1703)
* WIP: add external module as a node scaler.

* Fix style.

* Add tests, fix style issues.

* Fix typos.

* Fix test error.

* Fix node provider path.

* Add function to spli pkg from class.

* Add doc.

* Correct documentation.

* Debugging....

* Debugging....

* Add __init__.py to tests.

* add more output for debugging

* Add more test, fix error with import.

* Add a small detail to the documentation.

* Update autoscaler.py
2018-03-17 16:59:13 -07:00
Robert NishiharaandPhilipp Moritz 75dc106303 Install flex and bison in autoscaler development example. (#1725) 2018-03-16 11:55:59 -07:00
Richard LiawandGitHub 40799fee37 [autoscaler] Fix Defaults (#1661) 2018-03-09 16:59:21 -08:00
Richard LiawandGitHub 162d063f0d [autoscaler/tune] Optional YAML Fields + Fix Pretty Printing for Tune (#1541) 2018-03-04 23:35:58 -08:00
Eric LiangandGitHub 9b33f3a7b7 [autoscaler] Bad error message when dict field omitted (#1632)
* Wed Feb 28 23:22:55 PST 2018

* Wed Feb 28 23:24:07 PST 2018
2018-03-03 20:25:58 -08:00
Eric LiangandGitHub 80d7def9dc [autoscaler] [tune] More doc fixes (#1560)
* Fri Feb 16 13:53:50 PST 2018

* Sat Feb 17 15:32:08 PST 2018

* Sat Feb 17 15:44:59 PST 2018

* fix

* Sun Feb 18 14:46:24 PST 2018

* Sun Feb 18 14:46:37 PST 2018

* Sun Feb 18 14:55:52 PST 2018

* Sun Feb 18 15:14:32 PST 2018

* Wed Feb 21 17:34:17 PST 2018

* Sun Feb 25 17:51:17 PST 2018

* Sun Feb 25 22:18:40 PST 2018

* Wed Feb 28 13:19:05 PST 2018

* Wed Feb 28 13:22:13 PST 2018

* Wed Feb 28 13:33:29 PST 2018

* Wed Feb 28 13:35:33 PST 2018

* add ex

* Fri Mar  2 12:50:17 PST 2018

* Fri Mar  2 12:54:31 PST 2018
2018-03-03 13:01:49 -08:00
Robert NishiharaandPhilipp Moritz 5859a2d249 Replace python setup.py install with pip install -e . (#1460) 2018-02-22 11:15:03 -08:00
Richard LiawandGitHub e62ad7007d [autoscaler] Improve UX for Autoscaler (#1558) 2018-02-21 22:19:04 -08:00
Richard LiawandGitHub 1cd2703cac [autoscaler] Docker Support (#1505) 2018-02-20 00:24:01 -08:00
Eric LiangandRichard Liaw 41007722f9 [tune] improve s3 log sync (#1511) 2018-02-08 00:42:25 -08:00
Robert NishiharaandPhilipp Moritz 12095611c6 Update wheel in example.yaml. (#1515) 2018-02-05 15:06:02 -08:00
Robert NishiharaandEric Liang fcb59cba81 Add missing availability_zone argument to development example. (#1509) 2018-02-03 15:04:22 -08:00
Robert NishiharaandPhilipp Moritz ab5d4a6010 Bring cloudpickle inside the repository. (#1445)
* Bring cloudpickle version 0.5.2 inside the repo.

* Use internal copy of cloudpickle everywhere.

* Fix linting.

* Import ordering.

* Change __init__.py.

* Set pickler in serialization context.

* Don't check ray location.
2018-01-25 11:36:37 -08:00
Philipp MoritzandEric Liang a1b01ee7fb [autoscaler] Fix confirmation (y/N) for autoscaler for Python 2 (#1450)
* Fix autoscaler for Python 2

* fix version test

* add linting exception for raw_input in Python 3

* two spaces
2018-01-24 14:05:42 -08:00
Peter SchafhalterandPhilipp Moritz 83949a533b [autoscaler] Increased head and worker storage to 25 GiB (#1401)
* Increased head and worker storage to 25 GiB

* Update example.yaml
2018-01-21 13:09:29 -08:00
Eric LiangandGitHub b8811cbe34 [autoscaling] increase connect timeout, boto retries, and check subnet conf (#1422)
* some autoscaling config tweaks

* Sun Jan 14 13:56:55 PST 2018

* Mon Jan 15 14:21:09 PST 2018

* increase backoff

* Mon Jan 15 14:40:47 PST 2018

* check boto version
2018-01-16 16:11:09 -08:00
Robert NishiharaandEric Liang eac11c252c Update wheel in autoscaler example. (#1408) 2018-01-13 01:06:23 -08:00
Yaroslav BulatovandEric Liang 78fb3c5ed9 [autoscaler] Fix ValueError: Missing required config keyavailability_zoneof type str 2018-01-13 00:59:15 -08:00
Peter SchafhalterandPhilipp Moritz a59a9e20af Added option for availability zone (#1393) 2018-01-09 13:49:47 -08:00
Eric LiangandRobert Nishihara 77af2b5516 [autoscaler] Sometimes instances are restarted even when they don't need to be (#1385)
* fix hash

* Update autoscaler.py
2018-01-02 16:34:46 -08:00
Eric LiangandRobert Nishihara 1bc55e182d Update the pip wheel in example.yaml and add docs (#1381) 2018-01-01 13:02:05 -08:00
Eric LiangandGitHub b6c42f96be Auto-scale ray clusters based on GCS load metrics (#1348)
This adds (experimental) auto-scaling support for Ray clusters based on GCS load metrics. The auto-scaling algorithm is as follows:

Based on current (instantaneous) load information, we compute the approximate number of "used workers". This is based on the bottleneck resource, e.g. if 8/8 GPUs are used in a 8-node cluster but all the CPUs are idle, the number of used nodes is still counted as 8. This number can also be fractional.
We scale that number by 1 / target_utilization_fraction and round up to determine the target cluster size (subject to the max_workers constraint). The autoscaler control loop takes care of launching new nodes until the target cluster size is met.
When a node is idle for more than idle_timeout_minutes, we remove it from the cluster if that would not drop the cluster size below min_workers.
Note that we'll need to update the wheel in the example yaml file after this PR is merged.
2017-12-31 14:39:57 -08:00
Eric LiangandPhilipp Moritz 43e78217f8 Thu Dec 21 23:19:24 PST 2017 (#1367) 2017-12-22 17:29:45 -08:00
Robert NishiharaandPhilipp Moritz 22460ff7af Use Anaconda for autoscaling example and add example config for devel… (#1361)
* Use Anaconda for autoscaling example and add example config for development.

* Install Python2 for building the web ui.
2017-12-22 01:59:02 -08:00