dimanche 19 avril 2015

Running an IPython notebook server on EC2 instance start

I would like to set up an EC2 instance running an ipython notebook server for personal data science projects. I can successfully get the server up and running, and access it from my browser, etc... I'm using Ubuntu 14.04 for my OS.


However, because I want to use a pretty big instance, it would get really expensive to leave it running all the time, so I want to be able to start and stop it when I don't need it. Currently, this means that I need to ssh into the instance and restart the server every time I start it up. I would like some way to run ipython notebook --profile=nbserver when the instance starts, so that I can start the instance an immediately access my server from my browser.


I put



#!/bin/bash
ipython notebook --profile=nbserver


in the user-data, but this doesn't appear to work. I'm unable to find a clear answer on whether user-data scripts are run only on first launch, or whenever the instance starts.


Is there another place I could put that script so that it would run whenever I start the instance?





Aucun commentaire:

Enregistrer un commentaire