Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

crepererum/cloudexec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cloudexec Build Status Requirements Status

Sometimes you just need a bigger machine for your tasks, so why not use one? Cloudexec provides you an easy way to execute one command on remote machine which is allocated, set up and destroyed on demand. So you get power but paying a lot of money and manual setup.

Requirements

To get this monster running you'll need:

  • Linux
  • Python >= 3.4
  • Python modules mentioned in requirements.txt (you can use a venv)
  • sshd (installed, no configuration or root access required)

Configuration

WARNING: Please set the file permissions for the configuration file wisely (e.g. chmod 600 ~/.cloudexecrc). Otherwise other users might be able to read your secret API keys! Never share the configuration file or copy it to unsecure locations!

Before you can kick some code you need to configure a cloud provider. Cloudexec reads all required data from ~/.cloudexecrc which is a YAML file. The following template sets up an Arch Linux using Rackspace and a small virtual machine:

accounts:
    myrackspace:
        username: <YOUR RACKSPACE USERNAME>
        api_key: <YOUR API KEY GOES HERE>
        region: iad
        provider: rackspace
profiles:
    default:
        image_id: 4d031536-275a-4c17-bedf-c7f34dc50ef8
        size_id: 2
        account: myrackspace

Usage

First of all you need to start a daemon which manages all your accounts and running VMs

python -mcloudexec -d

To run a command in the cloud just use

python -mcloudexec your_command --including -p -a --ram=eter s

Your current working dictionary is available so you can simply get the folder entries by

python -mcloudexec ls -la

Even writing files is supported. Just try

python -mcloudexec touch hello
ls -la hello

Return values are preserved, even through multiple script levels

python -mcloudexec sh -c "exit 13"
echo $?

WARNING: The daemon tries to destroy all VMs at shutdown or when it crashes. Because there can be connection problems or other unexpected errors or even bugs in cloudexec or one of the used libraries, some VMs might live forever. Please check the dashboard of your cloud provider and kill all remaining VMs with the name cloudexec... to avoid high costs! The same might be true for SSH key-pairs.

About

Sometimes you need a bigger machine...

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages