Giter Site home page Giter Site logo

ianmiell / shutit Goto Github PK

View Code? Open in Web Editor NEW
2.1K 66.0 111.0 15.28 MB

Automation framework for programmers

Home Page: http://ianmiell.github.io/shutit/

License: MIT License

Python 99.09% Shell 0.44% C 0.46% Dockerfile 0.01%
python vagrant pexpect docker

shutit's Introduction

Join the chat at https://gitter.im/ianmiell/shutit

A versatile automation framework.

ShutIt is an automation tool that models a user's actions on a terminal.

It can automate any process that can be run by a human on the command line with little effort.

It was originally written to manage complex Docker builds, but is a now general-purpose automation tool that supports bash, Docker, Vagrant, ssh and arbitrary build contexts.

ShutIt can also be used as an educational tool, as it can produce videos of demos, capture reproducible steps required to set environments up, and even challenge you to get the right output (see grep-scales).

If you want to know more about Docker, see the official site or take a look at the book by the creators of ShutIt - Docker in Practice.

Really Quick Overview

Some use cases:

  • You like bash, want to automate tasks, have structure and support, but don't want to learn a configuration management framework that takes you away from the command line you know and love.

  • Want to create complex Vagrant environments to model clusters of machines.

  • Want to create instructive walkthroughs:

  • Are interested in "phoenix deployment".

  • Want to take your scripts and turn them into stateless containers quickly, without needing to maintain (or learn) a configuration management solution designed for moving-target systems.

  • You're programmer who wants highly configurable stateless containers development, testing, and production.

  • Want to build everything from source in a way that's comprehensible and auditable.

What Does it Do (bash Builds)?

ShutIt acts as a modular and easy to use wrapper around pexpect.

Here is a simple example of a script that creates a file and a directory if they are not there already:

Simple Example

What Does it Do (Tutorials)?

This builds on the docker features (see below), but allows you to interrupt the run at points of your choosing with 'challenges' for the user to overcome.

Two types of 'challenge' exist in ShutIt:

  • scales
  • free form

Scales tell you to run a specific command before continuing. This is useful when you want to get certain commands or flags 'under your fingers', which does not happen without dedicated and direct practice.

grep Scales

Free form exercises give you a task to perform, and free access to the shell. This is to give the user a realistic environment in which to hone their skills. You can check man pages, look around the directories, search for useful utils (even install new ones!). When you are finished, a pre-specified command is run to check the system is in an appropriate state. Here's an example for the basics of git:

git 101 Tutorial

If you use a Docker-based tutorial and you mess the environment up, the state can be restored to a known one by hitting CTRL-G.

What Does it Do (Vagrant)?

Uses a bash build to set up n vagrant machines, and uses Landrush to give them useful hostnames accessible from the hosts and in the guest VMs.

It supports both Virtualbox and Libvirt providers.

This allows another kind of contained environment for more infrastructural projects than Docker allows for.

This example demonstrates a reproducible build that sets up Docker on an Ubuntu VM (on a Linux host), then runs a CentOS image within Docker within the Ubuntu VM.

It deposits the user into a shell mid-build to interrogate the environment, after which the user re-runs the build to add a directive to ensure ps is installed in the image.

Docker on Ubuntu VM running a CentOS image

Auto-Generate Modules

ShutIt provides a means for auto-generation of modules (either bare ones, or from existing Dockerfiles) with its skeleton command. See here for an example.

Known Issues

Since a core technology used in this application is pexpect - and a typical usage pattern is to expect the prompt to return. Unusual shell prompts and escape sequences have been known to cause problems. Use the shutit.setup_prompt() function to help manage this by setting up a more sane prompt. Use of COMMAND_PROMPT with echo -ne has been seen to cause problems with overwriting of shells and pexpect patterns.

ScreenShot

Licence

The MIT License (MIT)

Copyright (C) 2014 OpenBet Limited

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.

shutit's People

Contributors

0xmohit avatar aidanhs avatar ashkulz avatar florianludwig avatar fpietka avatar gitter-badger avatar ianmiell avatar inthecloud247 avatar javier-gs avatar joaompinto avatar lathonez avatar madnight avatar marcelloromani avatar mromaniob avatar timgates42 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  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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shutit's Issues

Hanging on prompt setup

This happens to me occasionally. Why?

imiell@lp01728:/space/ashhardie$ /space/git/shutit/shutit build -m /space/git/shutit/library --debug
LOG: 2014-06-12 21:03:34 Working directory path not included, adding...
ubuntu:12.04
LOG: 2014-06-12 21:03:35 Loading source for: /space/git/shutit/setup.py
LOG: 2014-06-12 21:03:35 ShutIt module paths now: 
LOG: 2014-06-12 21:03:35 ['/space/git/shutit/library', '.']
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/phantomjs/phantomjs.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/vnc/vnc.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/ssh_server/ssh_server.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/casperjs/casperjs.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/docker/docker.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/get_iplayer/get_iplayer.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/composer/composer.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/jenkins/jenkins.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/squid_deb_proxy/squid_deb_proxy.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/postgres/postgres.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/adduser/adduser.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/shutit/shutit.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/mysql/mysql.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/git_server/git_server.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/win2048/win2048.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/apache_proxypass/apache_proxypass.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/memcache/memcache.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/git/shutit/library/wordpress/wordpress.py
LOG: 2014-06-12 21:03:36 Loading source for: /space/ashhardie/ashhardie.py
LOG: 2014-06-12 21:03:36 PHASE: base setup
Running: sudo docker --version


Command being run is:

sudo docker run --cidfile=/tmp/imiell_cidfile_lp01728_imiell_1402603414.17 --privileged=true -h=mycontainerhostname -v=/space/git/shutit/resources:/resources -t -i ubuntu:12.04 /bin/bash


This may download the image, please be patient


LOG: 2014-06-12 21:03:37 Creating host child
LOG: 2014-06-12 21:03:37 Setting up default prompt on host child
here
LOG: 2014-06-12 21:03:37 ================================================================================
LOG: 2014-06-12 21:03:37 Sending>>>SHUTIT_BACKUP_PS1_real_user_prompt=$PS1 && PS1='SHUTIT_REAL_USER#gEtgi>' && unset PROMPT_COMMAND<<<
LOG: 2014-06-12 21:03:37 Expecting>>>
SHUTIT_REAL_USER#gEtgi><<<
SHUTIT_BACKUP_PS1_real_user_prompt=$PS1 && PS1='SHUTIT_REAL_USER#gEtgi>' && unset PROMPT_COMMAND
SHUTIT_BACKUP_PS1_real_user_prompt=$PS1 && PS1='SHUTIT_REAL_USER#gEtgi>' && unset PROMPT_COMMAND
Traceback (most recent call last):
  File "/space/git/shutit/shutit", line 553, in <module>
    shutit_main()
  File "/space/git/shutit/shutit", line 507, in shutit_main
    conn_container(shutit)
  File "/space/git/shutit/shutit", line 184, in conn_container
    list(shutit.conn_modules)[0].build(shutit)
  File "/space/git/shutit/shutit_module.py", line 53, in wrapper
    ret = func(self, shutit)
  File "/space/git/shutit/setup.py", line 211, in build
    shutit.setup_prompt('real_user_prompt','REAL_USER')
  File "/space/git/shutit/shutit_global.py", line 556, in setup_prompt
    fail_on_empty_before=False,timeout=5)
  File "/space/git/shutit/shutit_global.py", line 215, in send_and_expect
    expect_res = child.expect(expect,timeout)
  File "/usr/lib/python2.7/dist-packages/pexpect.py", line 1311, in expect
    return self.expect_list(compiled_pattern_list, timeout, searchwindowsize)
  File "/usr/lib/python2.7/dist-packages/pexpect.py", line 1325, in expect_list
    return self.expect_loop(searcher_re(pattern_list), timeout, searchwindowsize)
  File "/usr/lib/python2.7/dist-packages/pexpect.py", line 1409, in expect_loop
    raise TIMEOUT (str(e) + '\n' + str(self))
pexpect.TIMEOUT: Timeout exceeded in read_nonblocking().
<pexpect.spawn object at 0x17ce6d0>
version: 2.3 ($Revision: 399 $)
command: /bin/bash
args: ['/bin/bash']
searcher: searcher_re:
    0: re.compile("
SHUTIT_REAL_USER#gEtgi>")
buffer (last 100 chars): SHUTIT_BACKUP_PS1_real_user_prompt=$PS1 && PS1='SHUTIT_REAL_USER#gEtgi>' && unset PROMPT_COMMAND

before (last 100 chars): SHUTIT_BACKUP_PS1_real_user_prompt=$PS1 && PS1='SHUTIT_REAL_USER#gEtgi>' && unset PROMPT_COMMAND

after: <class 'pexpect.TIMEOUT'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 6555
child_fd: 4
closed: False
timeout: 30
delimiter: <class 'pexpect.EOF'>
logfile: <open file '<stdout>', mode 'w' at 0x7f43422531e0>
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: 1024
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1

error handling

change a config file to insecure and run build.

ERROR!

Traceback (most recent call last):
File "../../shutit", line 474, in
shutit_main()
File "../../shutit", line 418, in shutit_main
util.load_configs(shutit)
File "/space/git/shutit/util.py", line 481, in load_configs
cfg_parser = get_configs(configs)
File "/space/git/shutit/util.py", line 92, in get_configs
fail(fail_str)
File "/space/git/shutit/util.py", line 50, in fail
raise ShutItFailException(msg)
NameError: global name 'ShutItFailException' is not defined

get non-core config after we've determined what's actually being built

These two lines should be got once we've gathered whether to build something (based on dep calculations):

            if not shutit_map[mid].get_config(shutit):
                    shutit.fail(mid + ' failed on get_config')

so should be separated out and deferred.

Otherwise we pick up all sorts of core configs that aren't needed (privileged, mostly). I think Aidan's already thought about this.

Once this is sorted, we can look at getting rid of build.cnf.

Rework configs

The current config situation is acceptable, but not ideal.

Some thoughts:

  • get rid of defaults.cnf and inline it directly in python code
  • the lack of a ~/.shutit.cnf file will be used to detect a first run of shutit.
  • shutit will have sane defaults for most config items. If it really can't progress without some piece of information, it will prompt for it. Anything that's been prompted for will be saved in ~/.shutit.cnf (either the value itself, or a note specifying it should never be saved).
  • additional config files will work as they currently do.

This PR says nothing about build.cnf or defaults.cnf. Something needs to be done about them, but it can wait until another time.

Documentation

We need it. Example:

A user was confused by what send_and_expect returned.
I explained like so

shutit.send_and_expect('echo aaa', expect=["aaa", "bbb","ccc"]) == 0
shutit.send_and_expect('echo bbb', expect=["aaa", "bbb","ccc"]) == 1
shutit.send_and_expect('echo ccc', expect=["aaa", "bbb","ccc"], exit_values=['0','1']) == 2
shutit.send_and_expect('echo aaa', expect=["aaa", "bbb","ccc"], exit_values=['2','3']) -> explodes

more dupe module errors

imiell@lp01728:/space/git/shutit/test/3$ ../../shutit build -m ..
ERROR!

Error while executing: Duplicated module id: shutit.tk.test.test3

[container]/docker_image should be configable

User had a confusion today that you currently cannot put [container]/docker_image in a config file - it must be specified as --image_tag on the command line.

Probably should be configable, but it raises a more general question about ordering of configs etc...probably not worth worrying about right now though.

Configs sourced even if not used

If generic module paths used then configs are apparently sourced even if they are not part of the build.

How I discovered this was running:

set -e
python ../../../../shutit/shutit_main.py --shutit_module_path ..:../../../../shutit/library

in KS.

server for demo

http://themortgagemeter.com:8080/

It occurred to me this morning that this would be awesome for weds demo and then recruiting people to work on it.

Need to get the build/push arguments on that page so people can push their built containers to the docker repo.

Also need to set up n of these servers so people can get their own.

ShutIt is slightly painful to get started with

Docker is approximately zero-dep. Compare with shutit:

sudo apt-get install python-virtualenv
git clone https://github.com/ianmiell/shutit.git
cd shutit
virtualenv .
. bin/activate
pip install bottle pexpect
vim configs/defaults.cnf

Variations exist (no virtualenv and apt-get the deps instead, create a new config rather than editing the existing one), but the general idea remains the same - there's too much friction.

wrap get output in a helper function

            shutit.send_and_expect('lsb_release -c -s',check_exit=False)
            release_name = shutit.get_re_from_child(shutit.get_default_child().before,'(.*)')

wrap this kind of nonsense into a function.

push, export and save

"push" and "export" and "save" commands which mirror docker's

They all imply build, and will make for cleaner separation between config and invocation.

Get rid of defaults.cnf

and inline it into a new config.py file.

Inline the libraries to their get_config files.

Remove it from skeleton and references from shutit.

Reduce export memory consumption

86.163.190.19 - - [27/May/2014 11:28:45] "GET /export/cd49d0bb68bc023e7da88b4fffab3bb139d70e7b4611a908da53300dac8e89a9.tar.gz HTTP/1.1" 200 90112
Traceback (most recent call last):
File "/usr/lib/python2.7/wsgiref/handlers.py", line 86, in run
self.finish_response()
File "/usr/lib/python2.7/wsgiref/handlers.py", line 128, in finish_response
self.write(data)
File "/usr/lib/python2.7/wsgiref/handlers.py", line 217, in write
self._write(data)
File "/usr/lib/python2.7/socket.py", line 324, in write
self.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe

86.163.190.19 - - [27/May/2014 11:28:45] "GET /export/cd49d0bb68bc023e7da88b4fffab3bb139d70e7b4611a908da53300dac8e89a9.tar.gz HTTP/1.1" 500 59

Exception happened during processing of request from ('86.163.190.19', 56589)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 651, in init
self.finish()
File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
self.wfile.close()
File "/usr/lib/python2.7/socket.py", line 279, in close
self.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])

error: [Errno 32] Broken pipe

reuse of container name when running tests

/space/git/shutit/library/jenkins/bin
/space/git/shutit/library/bin
/space/git/shutit/library/memcache/bin /space/git/shutit/library/bin

Command being run is:

sudo docker run --cidfile=/tmp/imiell_cidfile_lp01728_imiell_1401005125.77 --privileged=true --name=shutit_test_container_e72873e8ca9b795aa12d7ebd138d5fc1 -h=mycontainerhostname -v=/space/git/shutit/resources:/resources -t -i ubuntu:12.04 /bin/bash

This may download the image, please be patient

Traceback (most recent call last):
File "../../shutit", line 474, in
shutit_main()
File "../../shutit", line 433, in shutit_main
conn_container(shutit)
File "../../shutit", line 155, in conn_container
list(shutit.conn_modules)[0].build(shutit)
File "/space/git/shutit/shutit_module.py", line 42, in wrapper
ret = func(self, shutit)
File "/space/git/shutit/setup.py", line 158, in build
if container_child.expect(['assword',cfg['expect_prompts']['base_prompt'].strip()],9999) == 0:
File "/usr/lib/python2.7/dist-packages/pexpect.py", line 1311, in expect
return self.expect_list(compiled_pattern_list, timeout, searchwindowsize)
File "/usr/lib/python2.7/dist-packages/pexpect.py", line 1325, in expect_list
return self.expect_loop(searcher_re(pattern_list), timeout, searchwindowsize)
File "/usr/lib/python2.7/dist-packages/pexpect.py", line 1396, in expect_loop
raise EOF (str(e) + '\n' + str(self))
pexpect.EOF: End Of File (EOF) in read_nonblocking(). Exception style platform.
<pexpect.spawn object at 0x10f5450>
version: 2.3 ($Revision: 399 $)
command: /usr/bin/sudo
args: ['/usr/bin/sudo', 'docker', 'run', '--cidfile=/tmp/imiell_cidfile_lp01728_imiell_1401005125.77', '--privileged=true', '--name=shutit_test_container_e72873e8ca9b795aa12d7ebd138d5fc1', '-h=mycontainerhostname', '-v=/space/git/shutit/resources:/resources', '-t', '-i', 'ubuntu:12.04', '/bin/bash']
searcher: searcher_re:
0: re.compile("assword")
1: re.compile(".*[@#$]")
buffer (last 100 chars):
before (last 100 chars): to be able to assign shutit_test_container_e72873e8ca9b795aa12d7ebd138d5fc1 to a container again.

after: <class 'pexpect.EOF'>

I get this when running tests occasionally. Not sure why.

Feed a Dockerfile, get a ShutIt module

As title:

Here's an example:

https://github.com/kstaken/dockerfile-examples/blob/master/couchdb/Dockerfile

FROM ubuntu
MAINTAINER Kimbro Staken

RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get install -y g++
RUN apt-get install -y erlang-dev erlang-manpages erlang-base-hipe erlang-eunit erlang-nox erlang-xmerl erlang-inets

RUN apt-get install -y libmozjs185-dev libicu-dev libcurl4-gnutls-dev libtool wget

RUN cd /tmp ; wget http://www.bizdirusa.com/mirrors/apache/couchdb/source/1.3.1/apache-couchdb-1.3.1.tar.gz

RUN cd /tmp && tar xvzf apache-couchdb-1.3.1.tar.gz
RUN apt-get install -y make
RUN cd /tmp/apache-couchdb-* ; ./configure && make install

RUN printf "[httpd]\nport = 8101\nbind_address = 0.0.0.0" > /usr/local/etc/couchdb/local.d/docker.ini

EXPOSE 8101

CMD ["/usr/local/bin/couchdb"]

Dockerfile Harvest

Still problems with bogus duplication of modules

imiell@lp01728:/space/git/shutit/library/win2048$ ./test_build.sh
ERROR!

Error while executing: Duplicated module id: shutit.tk.win2048.win2048
imiell@lp01728:/space/git/shutit/library/win2048$ cat test_build.sh
set -e
../../shutit build --shutit_module_path ..

Display config

../../shutit sc

Debug

../../shutit build --debug

Tutorial

../../shutit build --tutorial

Repository handling with serve mode

Need a better way to handle this, as when we do serve mode we are not in the root dir (ie could be anywhere), Therefore relative

Repro: try building win2048 in serve mode:

SHUTIT_ROOT#F8zOA>Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 504, in run
self.__target(_self.__args, *_self.__kwargs)
File "/space/git/shutit/shutit_srv.py", line 45, in build_shutit
shutit_main.do_build(shutit)
File "/space/git/shutit/shutit_main.py", line 366, in do_build
build_module(shutit, module)
File "/space/git/shutit/shutit_main.py", line 323, in build_module
if not module.build(shutit):
File "/space/git/shutit/shutit_module.py", line 42, in wrapper
ret = func(self, shutit)
File "library/win2048/win2048.py", line 34, in build
shutit.send_file('/root/start_win2048.sh',file.read(file('resources/start_win2048.sh')))
IOError: [Errno 2] No such file or directory: 'resources/start_win2048.sh'

Also, the error was not reported on the FE.

ShutIt Web UI improvements

Umbrella ticket for my thoughts. This comment will be updated as things change.

Vital:

  • Actually print the container id of the container we build.
  • Allow a user to start a new build without restarting the server.
  • Give user an interface for manipulating config in the browser.
  • Long polling and/or websockets to throttle requests
  • Allow multiple simultaneous builds (this is impossible while things are still using the old util.* functions...can we detect and degrade?).
  • More robust container cleanup.

Nice to have:

  • Provide a link to download the container as a gzip (only useful where shutit is being used on a 'build box', do we care about this kind of environment?)
  • Show number of connected users on server.
  • Warning when disconnected from server.
  • Request queue to make sure the server isn't being spammed if it's slow to respond.
  • Integrate with docker terminal.

Needs thought:

Markdown docs

Would be nice if docs were in markdown.

E.g. http://aidanhs.github.io/shutit/index.html which github auto-generates from the branch at https://github.com/aidanhs/shutit/tree/gh-pages.

You can see the markdown for that page at https://raw.githubusercontent.com/aidanhs/shutit/gh-pages/index.md

Unfortunately I can't open a PR for this as it involves creating a new branch. So if you're interested you can do

<make sure no uncommitted changes>
git checkout --orphan gh-pages
git rm -rf .
git remote add aidanhs https://github.com/aidanhs/shutit.git
git pull aidanhs gh-pages
git push origin gh-pages

You can then create a file called CNAME (https://help.github.com/articles/setting-up-a-custom-domain-with-pages) containing the text

shutit.tk

and set up the dns as per the instructions in the article above.

Ease of debug when building on bespoke base container

Problem:
eg container with shutit.tk.mysql.mysql on it
we build another container that depends on above
password config is different, so tests fail when trying to connect

Solutions:
Skip test (don't like this)
Don't have things that depend on password in tests (not ideal)
Store "reserved for test" configs as one-way hash (insecure?)
Store alphabetized-order rep'n of per module as one-way hash
Store alphabetized-order rep'n of complete config as one-way hash
Store all configs in container manifest (means having passwords in there, insecure)

interaction vs debug

Interaction levels, not tutorial/debug

Debug is the verbose output, and should be a separate option

Need to clean up create_skeleton.sh output

  • No need for ./bin/README.md or ./bin/create_skeleton.sh
  • There probably shouldn't be any OB copyright notices (in single line readmes, single line scripts and generated configs)?
  • ./resources/README.md has a '\n' instead of a literal newline
  • Shell scripts should be runnable with posix shell.

ShutIt in dockerfiles

Dockerfiles are (for better or worse) first class of the docker world.
Once we have the sane defaults and ~/.shutit.cnf file from #58, we can put shutit directly in dockerfiles and ease adoption significantly. It might look something a bit like tihs:

FROM blah
ADD https://someserver.com/binaries/shutit /usr/bin/shutit
RUN shutit get modules https://github.com/me/mymodules.git
RUN shutit get configs https://github.com/me/myconfigs.git
RUN shutit build -m mymodules -s com.aa.module1
#15 requires 3, 4, 5
RUN shutit build -m mymodules -s com.aa.module15

This doubles as a first stab at #41 - people can just rearrange lines and let shutit deal with deps, starting and stopping applications for running in data.

Tests broken

unit tests switched off following latest config change from AHS.

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.