Git Product home page Git Product logo

laniakea's Introduction

Logo

Laniakea is a utility for managing instances at various cloud providers and aids in setting up a fuzzing cluster it can be used as a tool or as a library.

Build Status IRC

Setup

python3 -m pip install laniakea

or

pipenv install laniakea
pipenv run laniakea -h

Supported Cloud Providers

UserData Reference

Laniakea supports various macros to construct and maintain user-data files.

Note that not all modules are still supporting UserData files but use a container approach instead i.e Google Compute Engine. You can and probably should spawn containers within UserData files if you plan to chose to use this kind of initialization method.

@import(path_to_other_userdata_file)@
@macro_name@

You can use the -list-userdata-macros option to print out available macros inside a user-data file. Each of these macros can then be substituted with the -userdata-macros option.

Extending Laniakea

To extend Laniakea with new cloud providers you need to ...

  • Add a new folder in laniakea/core/providers/<cloud_provider>
  • Write a command-line interface and put it into the __init__.py
  • Write an API manager class and name it manager.py
  • Add additional files (i.e userdata scripts) to laniakea/userdata/
  • Add additional configuration files to laniakea/examples/

API Documentation

Laniakea Help Menu

usage: laniakea [-verbosity {1,2,3,4,5}] [-settings path] [-userdata path] [-list-userdata-macros] [-print-userdata]
                [-userdata-macros k=v [k=v ...]]
                ...

Laniakea Runtime v1.16.0

Laniakea Cloud Providers:
  Use -h to see the help menu of each provider.


    azure                         Microsoft Azure
    ec2                           Amazon Elastic Cloud Computing
    gce                           Google Compute Engine
    packet                        Packet Bare Metal

Laniakea Base Parameters:
  -verbosity {1,2,3,4,5}          Log sensitivity. (default: 2)
  -settings path                  Laniakea core settings. (default: ~/Library/Application Support/laniakea/laniakea.json)

UserData Parameters:
  -userdata path                  UserData script for the provisioning process. (default: None)
  -list-userdata-macros           List available macros. (default: False)
  -print-userdata                 Print the UserData script to stdout. (default: False)
  -userdata-macros k=v [k=v ...]  Custom macros for the UserData. (default: None)

The exit status is 0 for non-failures and 1 for failures.

laniakea's People

Contributors

choller avatar jschwartzentruber avatar mozilla-github-standards avatar nth10sd avatar posidron avatar rforbes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laniakea's Issues

[EC2] Failed spot request logs nothing.

$ python -m laniakea ec2 -create-spot -userdata default.sh -tags Name=test -max-spot-price 0.6 -region us-east-1 -zone us-east-1e -profile default
[Laniakea] 2018-08-24 10:25:49 INFO: Loading Laniakea configuration from /home/user/.config/laniakea/laniakea.json
[Laniakea] 2018-08-24 10:25:49 INFO: Reading user data script content from /home/user/src/m/laniakea/laniakea/userdata/ec2/default.sh
[Laniakea] 2018-08-24 10:25:49 INFO: Processing "import" of common.sh
[Laniakea] 2018-08-24 10:25:49 INFO: Using image definition "default" from /home/user/.config/laniakea/amazon.json
[Laniakea] 2018-08-24 10:25:49 INFO: Using Boto configuration profile "default"
[Laniakea] 2018-08-24 10:25:50 INFO: Waiting on fulfillment of requested spot instances.
$

The state of the spot request is 'failed' and status is 'bad-parameters' due to invalid availability zone (EC2 issue).

I would expect to see this logged as an error.

[EC2] Use boto3

We should support boto3 and remove boto2. In particular, the spot request API was simplified significantly (same API for spot/demand instances), but we need to use boto3 to take advantage of that..

Block device mapping should be flexible.

The Laniakea.images dictionary assumes one block device per machine and it is named /dev/sda1. This is not a universal name, and prevents laniakea from launching AMIs with other requirements. For example the official AMIs for CoreOS use /dev/xvda1.

Currently, launching a spot request for CoreOS-stable AMI with laniakea gives the following:

State: failed: Either snapshot ID or volume size must be provided for: /dev/sda1
Status: bad-parameters: Your Spot request failed due to bad parameters. 

[GCE] API should be usable asynchronously

Operations like create() and terminate() block execution until completed. There should be a way of polling for state changes as we do with EC2. Not sure if there is a precedent for this in libcloud or if we would have to abandon libcloud.

CODE_OF_CONDUCT.md file missing

As of January 1 2019, Mozilla requires that all GitHub projects include this CODE_OF_CONDUCT.md file in the project root. The file has two parts:

  1. Required Text - All text under the headings Community Participation Guidelines and How to Report, are required, and should not be altered.
  2. Optional Text - The Project Specific Etiquette heading provides a space to speak more specifically about ways people can work effectively and inclusively together. Some examples of those can be found on the Firefox Debugger project, and Common Voice. (The optional part is commented out in the raw template file, and will not be visible until you modify and uncomment that part.)

If you have any questions about this file, or Code of Conduct policies and procedures, please see Mozilla-GitHub-Standards or email [email protected].

(Message COC001)

Laniakea throws because time_exceeded is not specified, if timeout is None

The following line throws if timeout is not specified:
https://github.com/MozillaSecurity/laniakea/blob/59536ad/core/manager.py#L158

Traceback (most recent call last):
  File "/Users/skywalker/trees/laniakea/laniakea.py", line 299, in <module>
    sys.exit(LaniakeaCommandLine().main())
  File "/Users/skywalker/trees/laniakea/laniakea.py", line 223, in main
    args.ebs_volume_type, args.ebs_volume_delete_on_termination)
  File "/Users/skywalker/trees/laniakea/core/manager.py", line 158, in create_spot
    elif time_exceeded:
UnboundLocalError: local variable 'time_exceeded' referenced before assignment

Add scale-up and scale-down arguments

Add a way to quickly add and kill instances.
Suggestion:
-scale-up N
-scale-down N
The scale-down function should probably kill instances which are the oldest ones.

Make the setup process more lightweight

Briefly discussed in #30

A possible idea would be:

Add a new directory called requirements and extract module dependencies out of the requirements.txt and put those into their own requirement files: i.e azure.txt, amazon.txt. A user then would run:

pip install -r requirements.txt -r azure.txt -r amazon.txt

Where requirements.txt would consist of the base requirements for Laniakea. Each module would then call sys.exit if the module is not available and point with an error message to the required requirements file.

ec2.get_all_images often takes too long

This line located at

remote_images = self.ec2.get_all_images(owners=['self', 'amazon', 'aws-marketplace'])

causes the returned list to be huge - it times out often, but when it succeeds, it gives a huge result.

We seem to be retrieving a list that is too big - some folks have had success switching to Python 3 - but Python 3 only worked once for me.

I worked around the issue by removing aws-marketplace to simplify the list retrieved, but it seems a solution might be to use paginator or some sort of filter as discussed.

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.