Skip to content

Quickstart guide

sbaogang edited this page Jul 31, 2016 · 43 revisions

Quick Start

Teletraan is currently supported on Mac OS X and Linux.

Vagrant Option

If you have Vagrant installed - we run vagrant 1.8.1 - you can install and run Teletraan quickstart using vagrant. Depending on your system, it may ask for your computer admin password to install virtualbox related dependencies. Once you have vagrant installed, run the following commands:

    $ git clone https://github.com/pinterest/teletraan.git
    $ cd teletraan/deploy-sentinel
    $ vagrant up
    $ vagrant ssh

And then jump to Run Demo section.

Manual Option

  • Install Python 2.7, virtualenv, Java 8

  • Run the demo_run.sh script: (will take a few minutes to complete installation)

    $ curl -O https://raw.githubusercontent.com/pinterest/teletraan/master/deploy-sentinel/demo_run.sh
    $ chmod +x ./demo_run.sh
    $ ./demo_run.sh

Run Demo

Now that we have Teletraan up and running from the Vagrant or manual setup instructions above, we need to configure it.

  1. Visit your now locally running Teletraan page: http://localhost:8888/.

  2. Create a new environment setting the Env name to 'deploy-sentinel' and the Stage name to 'canary'.

  3. Click the 'Capacity' button.

  4. Here we can let Teletraan know some host information. Hosts deployed to by Teletraan require a 'host-info' file with this identifying data. For our quickstart build we are using a group we named 'deploy-sentinel'. Fill in 'deploy-sentinel' in the group field and click the 'Save' button.

  • Publish the quickstart build: At this point, we have nothing to deploy yet. We will build a sample application and publish the build result to Teletraan, so we can deploy it:

    $ cd ~/teletraan-demo
    $ source venv/bin/activate
    (venv)$ cd deploy-sentinel
    (venv)$ make publish
    
  • Deploy the quickstart build: Let's deploy!

  1. Visit you deploy-sentinel environment page http://localhost:8888/env/deploy-sentinel/.

  2. You will notice a new build is available under the 'Builds to Deploy' tab on the left. Click this new build you published and then click 'Deploy It'. Alternatively you can click 'Create Deploy', select your build from the list, and then click the revealed 'Deploy It' button. Accept the deploy confirmation modal.

  • Run deploy agent: Your build is ready to deploy! But nothing will happen unless Deploy Agent is running. While in your venv:
 (venv)$ deploy-agent

Returning to your web browser, you can now see the progress of your deploy! The page will refresh automatically every so often (default is 30 seconds). Deploy agent will untar the build in the /tmp/deploy-sentinel directory and run all the deploy scripts found there. The quickstart build contains the default django mysite code. In our example, the POST-RESTART script executes the command to run it. When you use Teletraan on your own, you can set these deploy scripts to execute anything you would like.

You can follow along in the deploy-agent log to see it execute the contents of each of the script files:

(venv)$ tail -f /tmp/deployd/logs/deploy-agent.log

Teletraan service and deploy board logs can be found under /tmp/teletraan and /tmp/deploy_board respectively.

  • Visit your Teletraan deployed application: Visit http://127.0.0.1:8000/

  • To stop Teletraan server and Deployboard:

    $ cd ~/teletraan-demo
    $ ./deploy-service/bin/run.sh stop
    $ ./deploy-board/run.sh stop
Kill you deployed "../mysite/manage.py" process to stop your demo app.