-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e8f2b30
Showing
110 changed files
with
15,461 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# .coveragerc to control coverage.py | ||
[run] | ||
branch = True | ||
source = tune_registry | ||
|
||
[report] | ||
ignore_errors = True | ||
|
||
[html] | ||
directory = coverage_report | ||
|
||
[xml] | ||
directory = coverage_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
cover/ | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
docs/html/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# jetbrains | ||
.idea | ||
|
||
# OSX | ||
.DS_Store | ||
|
||
# web assets-cache | ||
.webassets-cache | ||
*.sublime-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Change Log | ||
#### All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning. | ||
|
||
## [1.0.0] - 2016-02-02 | ||
|
||
### Breaking Changes: | ||
* Due to configuration validation additions users will more than likely will have | ||
to make updates their freight-forwarder.yml. There isn't a way around this sorry for | ||
any inconveniences. | ||
* Injector environment variable name changes. The names have change to be prefixed with INJECTOR inplace of CIA. These | ||
changes were made to make open sourcing the projects easier. | ||
|
||
### Changes: | ||
* Updated configuration file format to use yaml. | ||
* Added logger to remove print statements and provide nice formatting. | ||
* Updated a number of expection messages to be more clear. | ||
* Updated injector to with better exceptions and messages to provide the user | ||
better insight. | ||
* Updated injector to use oauth tokens for CIA. | ||
* When running containers that have dependencies and dependents will now intelligently | ||
create and restart only the containers that are required to. | ||
* timestamp label will now be populated. | ||
* Updated code base to support python3 | ||
* Export will no longer attempt to build and start dependents only dependencies. | ||
* added unit tests, improved test coverage | ||
|
||
### New Features: | ||
* Simplified configuration file to make it easier to understand and integrate with. | ||
* Added in-depth configuration file validation and a friendly easy to read output. | ||
* Configuration file errors will provide hinting to assist user when fixing issues. | ||
* Configuration file errors will provide line number when possible. | ||
* Use child processes to store logs in queue to display to users if required. This | ||
is required when log driver is set to something other than json-file. | ||
* Added state file for actions and queue to stop users from running multiple commands | ||
when containers are dependent on each other. This is to prevent unexpected outcomes | ||
when building and deploying. | ||
* Added the ability to use the freight forwarder tagging scheme or not. | ||
* Added the ability to use image cache or not. | ||
* Search for images and list tags added to marshalling yard | ||
* V2 registry support. | ||
|
||
### Removed: | ||
* Old configuration file design. | ||
|
||
### Bugs Resolved: | ||
* Fixed issue with deploying. Containers with similar names were being delete | ||
when they shouldn't be. | ||
* Ports were backwards in the configuration file definition. | ||
* Fixed logic issue with ulimits. | ||
* Fixed issue when detach was false container would continually be restarted. | ||
* No longer require .dockercfg unless trying to auth with registry. | ||
* Fixed issue when finishing dispatch. Will no longer attempt to delete state file | ||
and dangling images a second time if host is defined twice. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
FROM centos:7 | ||
MAINTAINER Alex Banna [email protected] | ||
ENV REFRESHED_AT 2016-1-22 | ||
|
||
# Define python verisons. | ||
ENV PYTHON2 "2.7.10" | ||
ENV PYTHON3 "3.4.3" | ||
ENV APP_NAME freight_forwarder | ||
ENV HOME /opt/$APP_NAME | ||
|
||
# install system packages | ||
RUN yum -y update && \ | ||
yum -y install gcc make curl patch zlib-devel bzip2 bzip2-devel git \ | ||
readline-devel sqlite sqlite-devel openssl-devel tar && \ | ||
yum -y clean all && \ | ||
mkdir -p $HOME | ||
|
||
# change to root home | ||
WORKDIR $HOME | ||
|
||
# add source code | ||
ADD ./ $HOME | ||
|
||
# install pyenv | ||
RUN curl -kL https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash | ||
|
||
# set pyenv variables | ||
ENV PYENV_ROOT $HOME/.pyenv | ||
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH | ||
|
||
# install python versions | ||
RUN pyenv install $PYTHON2 && \ | ||
pyenv install $PYTHON3 && \ | ||
pyenv global $PYTHON2 $PYTHON3 && \ | ||
pyenv rehash | ||
|
||
# upgrade pip, install packages, and create freight forwarder package. | ||
RUN pip install --upgrade pip && \ | ||
pip2 install --upgrade pip && \ | ||
pip2 install wheel setuptools && \ | ||
pip2 install -r requirements.txt && \ | ||
python2 setup.py bdist_wheel && \ | ||
pip3 install --upgrade pip && \ | ||
pip3 install wheel setuptools && \ | ||
pip3 install -r requirements.txt && \ | ||
python3 setup.py bdist_wheel && \ | ||
pip install $HOME | ||
|
||
# share the wheel with other containers. | ||
VOLUME ["dist"] | ||
|
||
ENTRYPOINT ["freight-forwarder"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright (c) 2014-2016 Tune Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[![Documentation Status](https://readthedocs.org/projects/freight-forwarder/badge/?version=latest)](http://freight-forwarder.readthedocs.org/en/latest/?badge=latest) | ||
[![Build Status](https://travis-ci.org/TuneOSS/freight_forwarder.svg?branch=master)](https://travis-ci.org/TuneOSS/freight_forwarder) | ||
|
||
#Freight Forwarder | ||
Freight Forwarder is a utility that organizes the transportation and distribution of docker images and containers from | ||
the developer to their applications consumers. It allows the developer to focus on building features while relying on | ||
Freight Forwarder for continuous integration. | ||
|
||
Documentation is available here: [Freight Forwarder Documentation](http://docs.ops.tune.com/ff/). | ||
|
||
##Description | ||
Freight Forwarder is an SDK and CLI that focuses on continuous integration and continuous delivery. | ||
|
||
At first glance it looks and feels a lot like Compose. However, Compose is very focused on the developers workflow and | ||
easing the pain of multiple container environments. Freight Forwarder can be used to accomplish that same task and much more. | ||
|
||
Freight Forwarder focuses on how Docker images are built, tested, pushed, and then deployed. The images being pushed to the registry | ||
are the artifacts being deployed. There should be no additional changes made to the images after being exported. In addition, | ||
the containers should be able to start taking traffic or doing work on initialization. | ||
|
||
When deploying from one environment to the next it is suggested to: | ||
|
||
1. Pull the image from the previous environment make configuration changes and commit those changes to a new image layer. | ||
2. Testing should be run with the new configuration changes. | ||
3. After the image is verified, it will be pushed up to the registry and tagged accordingly. | ||
4. That image will then be used when deploying to that environment. | ||
|
||
##Installation | ||
Follow these [instructions](http://docs.ops.tune.com/ff/introduction/install.html). | ||
|
||
##Contributing | ||
Want to write some code? Check out the [contributing documentation](http://docs.ops.tune.com/ff/contributing/overview.html). | ||
|
||
##Contributors | ||
* [abanna](http://github.com/abanna) - 2015-Current | ||
* [davidremm](http://github.com/davidremm) - 2015-Current | ||
* [fin09pcap](http://github.com/fin09pcap) - 2015-Current | ||
* [jyoung360](http://github.com/jyoung360) - 2015-Current | ||
|
||
## License | ||
See the [LICENSE](LICENSE.md) file for license rights and limitations (MIT). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Roadmap | ||
|
||
## Use freight forwarder as a SDK and build api. | ||
* could be useful for all | ||
|
||
## Improve search using filters. | ||
|
||
## Add docker networking code. | ||
|
||
## Add post and pre build hooks. | ||
* Move the injector into a plug in for both post and pre hook. | ||
* Move testing into post and pre hook. | ||
* Add hook for git container using that container and volumes to get access to source code. | ||
|
||
## Dry run display to the user exact service and hosts definitions being used for action being used. | ||
|
||
## Convert config file to a compose format and return to user or hand off to ecs or compose itself. | ||
|
||
## Allow the injection of configs for every service when running quality control. | ||
* should also build in support for puppet db, chef server, and ansible tower. This will allow for easy integration. | ||
|
||
## Catch term from jenkins when ff run is terminated early. | ||
|
||
## Review tagging while exporting. Should be using the previous environment tags when daisy chaining images. | ||
|
||
## travis integration as well as public docs | ||
|
||
## Build bill of lading objects to provide better info about container ships etc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8; -*- | ||
from __future__ import unicode_literals | ||
import argparse | ||
import time | ||
import sys | ||
import os | ||
|
||
sys.path.append(os.path.realpath(os.path.join(os.path.dirname(__file__), '..'))) | ||
from freight_forwarder.const import VERSION | ||
from freight_forwarder.cli.deploy import DeployCommand | ||
from freight_forwarder.cli.export import ExportCommand | ||
from freight_forwarder.cli.info import InfoCommand | ||
from freight_forwarder.cli.marshaling_yard import MarshalingYardCommand | ||
from freight_forwarder.cli.quality_control import QualityControlCommand | ||
from freight_forwarder.cli.test import TestCommand | ||
from freight_forwarder.cli.offload import OffloadCommand | ||
from freight_forwarder.utils import logger | ||
|
||
|
||
def main(): | ||
""" | ||
This is the main function to be executed when running the freight_forwarder cli. | ||
""" | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument('-v', '--version', | ||
action='version', | ||
version='%s is current on version : %s' % (parser.prog, VERSION), | ||
help='freight_forwarder version') | ||
# Create sub parser | ||
sub_parser = parser.add_subparsers( | ||
title='freight-forwarder', | ||
description='Freight Forwarder is an orchestration tool to help build test and deploy Docker images and containers.', | ||
help='additional help' | ||
) | ||
|
||
# Create deploy command. | ||
DeployCommand(sub_parser) | ||
# Create offload command. | ||
OffloadCommand(sub_parser) | ||
# Create export command. | ||
ExportCommand(sub_parser) | ||
# create quality-control command | ||
QualityControlCommand(sub_parser) | ||
# create test command | ||
TestCommand(sub_parser) | ||
# create info command | ||
InfoCommand(sub_parser) | ||
# create marshaling-yard command | ||
MarshalingYardCommand(sub_parser) | ||
|
||
# parse args | ||
args, extra_args = parser.parse_known_args() | ||
|
||
# call function set by defaults. | ||
if extra_args: | ||
msg = [] | ||
for item in extra_args: | ||
if '=' in item: | ||
msg.append(item.split('=')[0]) | ||
|
||
elif item.startswith('-') or item.startswith('--'): | ||
msg.append(item) | ||
|
||
raise AttributeError(logger.error("The following are not valid options: {0}".format(', '.join(msg)))) | ||
else: | ||
args.func(args) | ||
|
||
|
||
if __name__ == '__main__': | ||
start_time = time.time() | ||
main() | ||
logger.info("elapsed: {0} seconds".format(time.time() - start_time)) |
Oops, something went wrong.