Commit b50d73c1 authored by eric pellegrini's avatar eric pellegrini
Browse files

fixed regression when importing packme

reformatted README.rst
added README.md file
updated package info
parent 9056a544
packme
======
overview
~~~~~~~~
`packme` is a python3 application for generating and running `packer` templates.
It works by generating *manifest.json* files out of *manifest.yml* files which contain the packer settings for the image to build. The *manifest.yml* files will be searched in a directory which contains as subdirectories the images to be built using `packer`. That directory has to be defined from the CLI (`-t/--templates-dir option`) and has the following structure:
```shell
my_templates_directory/
image1/
manifest.yml
...
imageN/
manifest.yml
```
Each manifest.yml has the following structure:
```shell
---
parameters:
param1: value1
...
paramN: valueN
packer:
description: packer description string
variables: packer variables dict
builders: packer builders list
provisioners: packer provisioners list
post-processors: packer post processors list
```
The packer section is strictly the YAML representation of a packer json file with the standards description, variables, builders, provisioners and post-processors packer fields. Those fields can contain Jinja2 templates which can be of two flavors: `parameters` or `environment`. `parameters` will be defined in the `parameters` section of the YAML file while `environment` will be either environment variables or variables passed through the `packme` CLI.
In order to run `packme`, an input configuration file has to be provided. This file is a YAML file which declares the list of the images for which *manifest.json* file will be built and run after with packer. It has the following structure:
```shell
---
templates:
image1:
packages: [package1, ..., packageN]
...
imageN:
extends: image1
```
where `packages` defines non standard packages that will added as extra provisioners when generating the *manifest.json* file for the corresponding image.
An image can extend another one by starting its building from another image. This is the aim of `extends` keyword which allows to declare that dependency.
Documentation
~~~~~~~~~~~~~
[packme documentation](<https://packme.readthedocs.io/en/latest/)
Prerequesites
~~~~~~~~~~~~~
- packer
- QEMU
Installation
~~~~~~~~~~~~
see [here](<http://code.ill.fr/si/packer) for complementary info
.. code:: shell
pip install packme
Overview
========
**packme** is a python3 application for generating and running packer templates.
packme
======
.. overview-begin
overview
~~~~~~~~
It works by generating *manifest.json* files out of *manifest.yml* files which contain the packer settings for the image to build. The *manifest.yml* files will be searched in a directory which contains as subdirectories the images to be built using packer. That directory has to be defined from the CLI (-t/--templates-dir option) and has the following structure:
``packme`` is a python3 application for generating and running ``packer`` templates.
*my_templates_directory/*
*image1/*
manifest.yml
It works by generating *manifest.json* files out of *manifest.yml* files which contain the packer settings for the image to build. The *manifest.yml* files will be searched in a directory which contains as subdirectories the images to be built using ``packer``. That directory has to be defined from the CLI (``-t/--templates-dir option``) and has the following structure:
.
.. code:: shell
.
*imageN/*
manifest.yml
my_templates_directory/
image1/
manifest.yml
...
imageN/
manifest.yml
Each manifest.yml has the following structure:
*---*
*parameters:*
*param1: value1*
.
*paramN: valueN*
*packer:*
*description: packer description string*
*variables: packer variables dict*
*builders: packer builders list*
*provisioners: packer provisioners list*
.. code:: shell
*post-processors: packer post processors list*
---
parameters:
param1: value1
...
paramN: valueN
The packer section is strictly the YAML representation of a packer json file with the standards description, variables, builders, provisioners and post-processors packer fields. Those fields can contain Jinja2 templates which can be of two flavors: **parameters** or **environment**. **parameters** will be defined in the *parameters* section of the YAML file while *environment* will be either environment variables or variables passed through the **packme** CLI.
packer:
description: packer description string
variables: packer variables dict
builders: packer builders list
provisioners: packer provisioners list
post-processors: packer post processors list
In order to run **packme** , an input configuration file has to be provided. This file is a YAML file which declares the list of the images for which *manifest.json* file will be built and run after with packer. It has the following structure:
The packer section is strictly the YAML representation of a packer json file with the standards description, variables, builders, provisioners and post-processors packer fields. Those fields can contain Jinja2 templates which can be of two flavors: ``parameters`` or ``environment``. ``parameters`` will be defined in the ``parameters`` section of the YAML file while ``environment`` will be either environment variables or variables passed through the ``packme`` CLI.
*---*
In order to run ``packme``, an input configuration file has to be provided. This file is a YAML file which declares the list of the images for which *manifest.json* file will be built and run after with packer. It has the following structure:
*templates:*
.. code:: shell
*image1:*
packages:
*\- package1*
---
templates:
image1:
packages: [package1, ..., packageN]
...
imageN:
extends: image1
*\- package2*
where ``packages`` defines non standard packages that will added as extra provisioners when generating the *manifest.json* file for the corresponding image.
*\- package3*
An image can extend another one by starting its building from another image. This is the aim of ``extends`` keyword which allows to declare that dependency.
Documentation
~~~~~~~~~~~~~
*image2:*
extends: image1
.
.
where *packages* defines non standard packages that will added as extra provisioners when generating the *manifest.json* file for the corresponding image.
An image can extend another one by starting its building from another image. This is the aim of *extends* keyword which allows to declare that dependency.
.. overview-end
`packme documentation <https://packme.readthedocs.io/en/latest/>`__
Prerequesites
=============
- packer application must be installed
~~~~~~~~~~~~~
- packer
- QEMU
Installation
============
see [`here <http://code.ill.fr/si/packer>`_] for complementary info
~~~~~~~~~~~~
see `here <http://code.ill.fr/si/packer>`__ for complementary info
.. code:: shell
- `cd` to the directory where lies the `setup.py` file
- pip3 install --user .
pip install packme
......@@ -12,7 +12,7 @@ import os
import shutil
import sys
from packman import Packman
from packme import Packman
def clean_templates_dir(templates_dir):
"""Removes all manifest.json files, packer_cache and builds directories found in
......
......@@ -6,7 +6,7 @@ __copyright__ = "Copyright 2019, Institut Laue Langevin"
__credits__ = []
__description__ = "Heler app for building and running packer templates"
__description__ = "Helper app for building and running packer templates"
__license__ = "MIT"
......@@ -16,7 +16,7 @@ __maintainer_email__ = "pellegrini@ill.fr"
__status__ = "Prototype"
__url__ = "https://code.ill.fr/si/packer"
__url__ = "https://code.ill.fr/panosc/data-analysis-services/packme"
__version__ = "0.0.0"
__version__ = "0.0.1"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment