Skip to content

Commit

Permalink
docs tided up a bit to show something useful
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeisstillgood committed Jan 18, 2016
1 parent e464afe commit b0fe310
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 21 deletions.
13 changes: 8 additions & 5 deletions docs/conf.py
Expand Up @@ -13,10 +13,11 @@

import sys, os

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory
# is relative to the documentation root, use os.path.abspath to make
# it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))

# -- General configuration -----------------------------------------------------

Expand All @@ -25,7 +26,9 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.viewcode']
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.viewcode']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down
11 changes: 10 additions & 1 deletion docs/holomaker.rst
Expand Up @@ -2,4 +2,13 @@
HoloMaker
=========

TBD
Imagine we want to guarantee a consistent deployment of a single Python package. PyHolodeck is designed to make this simple, but no simpler.



API Docs
========

.. automodule:: pyholodeck.maker
:members:

18 changes: 16 additions & 2 deletions docs/index.rst
Expand Up @@ -11,9 +11,12 @@ The build can occur on a spun up cloud server thus meaning the build
willcorrectly target the final destination OS, no matter what your
laptop runs.

Then we can spin up a destination cloud server and using saltstack / ansible (in transition) we can deploy the package, and configure it using holo-config)
Then we can spin up a destination cloud server and using saltstack /
ansible (in transition) we can deploy the package, and configure it
using holo-config)

I have introduced a Docker build after this, so the final artifact can be either .deb or a docker image.
I have introduced a Docker build after this, so the final artifact can
be either .deb or a docker image.

This .deb file can then be taken to another server, built in the cloud
using salt also, and installed. That way we can build our version of a
Expand Down Expand Up @@ -44,6 +47,15 @@ I hope this will facilitate more Python (web) packages in the


Contents
--------

.. toctree::
:maxdepth: 1

holomaker

Salt Notes
----------

.. toctree::
:maxdepth: 1
Expand All @@ -55,3 +67,5 @@ Contents
principles_of_immutable_salt
salt_and_state



Empty file added pyholodeck/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
46 changes: 33 additions & 13 deletions holo/maker.py → pyholodeck/maker.py
Expand Up @@ -17,6 +17,7 @@
import os
#import fabric
import pprint
import time

def gitfetch(url, parentfolder):
'''Given a git url, retrieve to `parentfolder`
Expand Down Expand Up @@ -44,6 +45,23 @@ class Deployment(object):
'''A big wrapper around different stages in making the
python package into a .deb
We are building a simple solution
1. We build on local disk, in the expected locations, a venv
representing the state of the venv we want eventually to deploy
2. We wrap that venv, with the python interpreter etc, into
a `.deb` file (tarball basically).
3. We define a `saltstack` file that will deploy the .deb file
artifact to our infrastructure. This file will define how to
create the .ini / .conf files that will be put into well-known
locations for the configuration of the package.
4. We define in the package the conf template for reference
Alternatively the artifact can be a Docker image that contains
our .deb file
'''
#: the root where the final .deb installed code will get put
#: it is also, for ease of building .debs, where we put the code
Expand Down Expand Up @@ -94,17 +112,19 @@ def prepare_venv(self):
):
self.cmds.append(cmd)

d = Deployment('pyhello',
'github:mikadosoftware/pyhelloworld.git')
d.prepare_venv()
import subprocess
for cmd in d.cmds:
print cmd
print
raw_input("?")
if not cmd.args:
print subprocess.check_call(cmd.cmdlist)
else:
cmd.pythonstmt.__call__(*cmd.args)

def demo():
d = Deployment('pyhello',
'github:mikadosoftware/pyhelloworld.git')
d.prepare_venv()
import subprocess
for cmd in d.cmds:
print cmd, "..."
time.sleep(1.5)
if not cmd.args:
print subprocess.check_call(cmd.cmdlist)
else:
cmd.pythonstmt.__call__(*cmd.args)

if __name__ == '__main__':
demo()

File renamed without changes.
9 changes: 9 additions & 0 deletions setup.py
@@ -0,0 +1,9 @@
# Always prefer setuptools over distutils
from setuptools import setup

#: Bare minimum setup for setup.py
setup(
name="pyholodeck",
version="0.0.1-dev",
packages=['pyholodeck',],
)

0 comments on commit b0fe310

Please sign in to comment.