-
Notifications
You must be signed in to change notification settings - Fork 54
Debugging
Scott Sievert edited this page Feb 17, 2017
·
1 revision
Note: we describe the steps graphically at the bottom of the page. This will likely be useful for beginners.
- Logging into a machine:
cd NEXT/ec2
python next_ec2.py --key-pair=$KEY_PAIR --identity-file=$KEY_FILE docker_login amazon_machine_name
# amazon machine name from `python next_ec2.py ... launch amazon_machine_name`
# also viewable (with other stuff) on the AWS console
By default, the below will assume you are docker_login
'd unless explicitly mentioned otherwise.
- To sync any changes you make locally on your machine to the remote ec2 machine, run the command
python next_ec2.py ... rsync amazon_machine_name
. - We have a method to have your changes propagate instantly using the command line environment variable
CELERY_ON
. To use this, on the remote machine runexport CELERY_ON=False
(capitalization important) before runningdocker-compose up
. - You can also allow your changes to propagate using a slower method by running
# remote machine
docker-compose stop # typically via cntrl-c
# docker-compose rm # pro: don't rerun experiment_*.script. con: not as safe.
docker-compose up
This allows the changes to propagate with all current experiments in place. You don't have to rerun your experiment script.
Run docker-compose logs -f
to view the running logs. When you docker-compose up
, these logs will run automatically. This is where utils.debug_print
(and print) show up.
- When
docker_login
'd, NEXT prints out a lot of stuff, meaning it's hard to see debugging printing information. We have developed autils
function just for this and the usage is given below:
import next.utils as utils
utils.debug_print("This will be bold and yellow!")
- Disable CELERY_ON. When
docker_login
'd to the machine, edit the filedocker-compose.yml
and change the lineCELERY_ON: True
toCELERY_ON: False
before runningdocker-compose up
. This will allow you to view your changes byrsync
ing up and allow them to propagate. Every time you rsync,docker-compose.yml
changes and takes effect when you rerundocker-compose up
.
A graphical representation of the debug workflow.