-
Notifications
You must be signed in to change notification settings - Fork 375
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
rllab ec2 tutorial #40
Merged
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
3f3adec
no backoff in unit tests
eugenevinitsky 0ad7e26
Merge branch 'master' of https://github.com/berkeleyflow/flow into un…
eugenevinitsky 775b5d7
Merge branch 'master' of https://github.com/berkeleyflow/flow
eugenevinitsky ca6fe56
fixed sumo build instructions for linux
eugenevinitsky 63c12f5
moved changes from flow-devel
AboudyKreidieh 86dfa8d
initial tutorial 11 commit
nskh 7c54bb4
Merge branch 'master' of https://github.com/berkeleyflow/flow into un…
AboudyKreidieh 6e3fa53
Merge pull request #16 from berkeleyflow/unit_test_backoff
AboudyKreidieh 5700337
Add __version__ macro (#17)
fywu85 f266a6b
cleaned up examples folder
AboudyKreidieh 7fdf0a5
Merge branch 'master' of https://github.com/berkeleyflow/flow into ex…
AboudyKreidieh 1191fcd
test fixed
AboudyKreidieh d0fd5cd
added missing example
AboudyKreidieh dc9c515
Merge pull request #23 from berkeleyflow/flow_devel_merge
AboudyKreidieh 27f3c65
Merge branch 'master' of https://github.com/berkeleyflow/flow into ex…
AboudyKreidieh a7a6f5f
discrete traffic light env
AboudyKreidieh bdb3f74
Merge pull request #18 from berkeleyflow/linux_build_instructions
AboudyKreidieh 716eb2a
tests for methods in utils/rllib
AboudyKreidieh c9b050b
added test for utils/registry.py
AboudyKreidieh 8cadd76
pep8
AboudyKreidieh 217bf74
removed a file from the front page of flow that I don't think is used…
AboudyKreidieh 6eda621
fixing typo (rllab->rllib)
nskh 3a3212c
Merge pull request #38 from berkeleyflow/nskh-patch-1
eugenevinitsky 041fc24
PR fix
AboudyKreidieh 442fe1c
Merge pull request #25 from berkeleyflow/examples_fix
eugenevinitsky 4453d0d
Merge pull request #31 from berkeleyflow/traffic_lights_env
eugenevinitsky c8912c7
minor pep8 fixes
eugenevinitsky 00fd078
Merge pull request #33 from berkeleyflow/cleanup_bloat
eugenevinitsky 04a226f
Merge branch 'master' of https://github.com/berkeleyflow/flow into te…
AboudyKreidieh e33916f
test includes inflows now
AboudyKreidieh 7b5b36b
typo
AboudyKreidieh 8ab2a3f
Merge pull request #32 from berkeleyflow/tests_utils
AboudyKreidieh d13abdb
Merge branch 'master' of github.com:berkeleyflow/flow into rllab_tuto…
nskh 9ff877d
draft tutorial
nskh e9f7ea0
result dir
nskh 5f3ebc2
deleting cell
nskh a57d448
Merge branch 'master' of github.com:flow-project/flow into rllab_tuto…
nskh 30d9eb9
Merge branch 'master' of github.com:flow-project/flow into rllab_tuto…
nskh 0328d1c
extra
nskh e43e1ed
added rllab ec2 tutorial to docs
nskh ae372a7
merging master
nskh 4078edd
Merge branch 'master' of github.com:flow-project/flow into rllab_tuto…
nskh 00671ce
added tutorials substructure to docs
nskh c48e077
pulled in master
nskh ef93f59
localdocker
nskh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
Running rllab experiments on EC2 | ||
================================ | ||
|
||
This page covers the process of running rllab experients on an Amazon | ||
EC2 instance. This tutorial assumes rllab has been installed correctly | ||
(`instructions <https://rllab.readthedocs.io/en/latest/user/installation.html>`_). | ||
|
||
Setting up rllab with AWS | ||
------------------------- | ||
|
||
First, follow the `rllab cluster setup | ||
instructions <https://rllab.readthedocs.io/en/latest/user/cluster.html>`__ | ||
with region ``us-west-1``. Modify ``rllab/config_personal.py`` to | ||
reference the most current Flow Docker image. | ||
|
||
Navigate to your ``flow`` directory and modify ``Makefile.template`` per | ||
the instructions in that file. The variable ``RLLABDIR`` should be the | ||
relative path from your ``flow`` directory to ``rllab`` and **should not | ||
have a backslash at the end**. | ||
|
||
Running an experiment | ||
--------------------- | ||
|
||
When running AWS experiments, your entire ``rllab`` directory is | ||
uploaded to AWS so that the files necessary for your experiment are | ||
available to the EC2 instance. Thus, commands are included to copy over | ||
your ``flow`` directory to your ``rllab`` root directory (this is the | ||
reason for the ``RLLABDIR`` variable above). | ||
|
||
- Before running an experiment, run ``make prepare`` from your ``flow`` | ||
directory. | ||
- Ensure you have committed or otherwise tracked the state of your | ||
``flow`` directory, because that instance is what will be used to run | ||
your experiment. Upon visualization, the same files will need to be | ||
used—for example, changes to your environment's state-space would break | ||
the ability to run a trained policy using a different state space. | ||
Check out an old commit of your ``flow`` directory before visualizing | ||
your experiment results. | ||
|
||
``make clean`` removes the debug directory and also all XML files in | ||
rllab root directory to reduce the size of the data to upload to AWS. If | ||
you are using already-existing network files (from, say, OpenStreetMap), | ||
ensure they do not get deleted by ``make clean`` by storing such files | ||
elsewhere. | ||
|
||
Inside the experiment, change the ``mode`` to ``ec2``. Other mode options are | ||
``local``, which uses your standard environment and ``local_docker``, which | ||
uses a local Docker image to run the experiment. You should run the experiment in | ||
``local_docker`` mode briefly before running the ``ec2`` version to | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a descripton of what running in local_docker tests? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think I should say here? |
||
ensure there are no errors, particularly with Docker image compatibility. | ||
|
||
After running ``python example.py`` once the ``mode`` of ``example.py`` | ||
is ``ec2``, you should see your experiment running on AWS. | ||
|
||
Fetching Results | ||
---------------- | ||
|
||
- To get the results of your AWS experiments, navigate to your | ||
``rllab`` directory and run ``python scripts/sync_s3.py``. | ||
- Your experiment results will be in ``data/s3`` in your ``rllab`` | ||
directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Tutorials | ||
========= | ||
Tutorials for learning how to use Flow are available, both on GitHub | ||
and as part of this documentation. | ||
|
||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:caption: Links: | ||
|
||
rllabec2 | ||
GitHub Tutorials <https://github.com/flow-project/flow/tree/master/tutorials/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Exercise 11: Running rllab experiments on EC2\n", | ||
"\n", | ||
"This tutorial, a complement to tutorial 10, covers the process of running rllab experients on an Amazon EC2 instance. This tutorial assumes rllab has been installed correctly ([instructions](https://rllab.readthedocs.io/en/latest/user/installation.html)). " | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Setting up rllab with AWS\n", | ||
" \n", | ||
"First, follow the [rllab cluster setup instructions](https://rllab.readthedocs.io/en/latest/user/cluster.html) with region `us-west-1`. Modify `rllab/config_personal.py` to reference the most current Flow Docker image (at the time of this writing, `evinitsky/flow`). [@fangyu is this true?]\n", | ||
"\n", | ||
"Navigate to your `flow` directory and modify `Makefile.template` per the instructions in that file. The variable `RLLABDIR` should be the relative path from your `flow` directory to `rllab` and should not have a backslash at the end. " | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"source": [ | ||
"## Running an experiment\n", | ||
"\n", | ||
"When running AWS experiments, your entire `rllab` directory is uploaded to AWS so that the files necessary for your experiment are available to the EC2 instance. Thus, commands are included to copy over your `flow` directory to your `rllab` root directory (this is the reason for the `RLLABDIR` variable above). \n", | ||
"\n", | ||
"- Before running an experiment, run `make prepare` from your `flow` directory.\n", | ||
"- Ensure you have committed or otherwise tracked the state of your `flow` directory, because that instance is what will be used to run your experiment. Upon visualization, the same files will need to be used—for example, changes to environment's state-space would break the ability to run a trained policy using a different state space. Check out an old commit of your `flow` directory and run `make prepare` to use visualization tools included with rllab.\n", | ||
"\n", | ||
"`make clean` removes the debug directory and also all XML files in rllab root directory to reduce the size of the data to upload to AWS. If you are using already-existing network files (from, say, OpenStreetMap), ensure they do not get deleted by `make clean` by storing such files elsewhere.\n", | ||
"\n", | ||
"Inside the experiment, change the `mode` to `ec2` (other options are `local` and `local_docker`). You should run the experiment in `local_docker` mode briefly before running the `ec2` version to ensure there are no errors, particularly with Docker image compatability\n", | ||
"\n", | ||
"After running `python example.py` once the `mode` of `example.py` is `ec2`, you should see your experiment running on AWS." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"source": [ | ||
"## Fetching Results\n", | ||
"\n", | ||
"- To get the results of your AWS experiments, navigate to your `rllab` directory and run `python scripts/sync_s3.py`. \n", | ||
"- Your experiment results will be in `data/s3` in your `rllab` directory." | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.5.2" | ||
}, | ||
"widgets": { | ||
"state": {}, | ||
"version": "1.1.2" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add the name of the most current Flow docker image? @kjang96 which one are you using?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fywu85 @kjang96 @lucfisc any updates on the docker image to reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fywu85/flow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fywu85 @lucfisc @kjang96 we should figure out what docker image to mention here