Giter VIP home page Giter VIP logo

Capi5k is a proof of concept for making the deployments on Grid'5000 easier, reusable and shareable.

It consists in a set of conventions over Capistrano (v2), and bower. It also makes use of xp5k for job submissions and deployments on Grid'5000.

Prerequisites > Wiki > Project Home >

Quick start (aka. quick setup)

The quick start will give you a quick overview of what can be done using the project.

At the end you'll be able to

  • submit a job
  • deploy nodes
  • run command on nodes
  • make basic customizations (e.g. changing the number of nodes, defining tasks, grouping nodes into roles)

... everything from your laptop !

Before going through the tutorial, check the prerequisites.

Initialization

  • Initialize a new project :
$) xpm init hello
  • This will download a skeleton project under the hellodirectory.

Move to the project directory

$) cd hello

If you use rvm you'll move to a new gemset.

  • Install runtime dependencies (capistrano, xp5k ...)
$) bundle install

Validate the installation

  • Run cap -T and you should see :
$)  cap -T
cap automatic # Automatic deployment
cap clean     # Remove all running jobs
cap deploy    # Deploy with Kadeploy
cap describe  # Describe the cluster
cap invoke    # Invoke a single command on the remote servers.
cap myproject # TODO : myproject task
cap shell     # Begin an interactive Capistrano session.
cap submit    # Submit jobs
  • Then try to submit a job :
$) cap submit
  * 2014-05-11 11:42:37 executing `submit'
 ** Waiting for the job init #562301 to be running at nancy...
.. [OK]

See the file : config/deploy/xp5k.rb to see the description of the job.

If something went wrong here, check your restfully configuration.

  • Then try to deploy your nodes :
$) cap deploy
  * 2014-05-11 11:44:38 executing `deploy'
 ** Waiting for all the deployments to be terminated...
............... [OK]
Summary of the deployment
------------------------------------------------------------
                Name            Deployed          Undeployed
------------------------------------------------------------
         capi5k-init                   2                   0

First command

A capistrano role is defined in roles.rb.

  • Test the connection to your deployed nodes :
$) cap invoke COMMAND="date" ROLES="myrole" USER="root"
  * 2014-05-11 11:54:41 executing `invoke'
  * executing multiple commands in parallel
    -> "else" :: "date"
    -> "else" :: "date"
    servers: ["graphite-3.nancy.grid5000.fr", "graphite-4.nancy.grid5000.fr"]
  * establishing connection to gateway `"[email protected]"'
  * Creating gateway using [email protected]
Enter passphrase for /Users/msimonin/.ssh/id_rsa:
  * establishing connection to `graphite-3.nancy.grid5000.fr' via gateway
  * establishing connection to `graphite-4.nancy.grid5000.fr' via gateway
    [graphite-3.nancy.grid5000.fr] executing command
    [graphite-4.nancy.grid5000.fr] executing command
 ** [out :: graphite-3.nancy.grid5000.fr] Sun May 11 11:54:38 CEST 2014
 ** [out :: graphite-4.nancy.grid5000.fr] Sun May 11 11:54:32 CEST 2014
    command finished in 270ms
  • You can define the command (and many others) inside the Capfile.
namespace :myproject do

  desc 'TODO : myproject task'
  task :default do
    date
    # other tasks can be added here
  end

  desc 'run date command'
  task :date, :roles => [:myrole] do
    set :user,"root"
    run "date"
  end
end

You can launch the date task by invoking :

  • cap myproject, this will call all the tasks written in the default block,
  • or simply cap myproject:date

Wrap up

  • submission parameters are controlled in ```config/deploy/xp5k.rb````
  • capistrano roles are defined in roles.rb
  • custom tasks applying on roles can be added in the Capfile

Further readings

xp5k > capistrano v2 >

Create a module (aka. complete setup)

soon

Capi5k's Projects

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.