mc_cloud_images / cloud images release managment & delivery

Please also have a look at the runner.

mc_states.modules.mc_cloud_images.build_docker_from_rootfs(image, rootfs, force=False, **kwargs)

All kwargs are forwarded to mc_cloud_images.rebuild_ms_docker

image
image to build
rootfs
lxc ROOTFS to package as a docker container
force
if lxc tarfile is present, redo it anyway
mc_states.modules.mc_cloud_images.default_settings()

cloudcontroller images templates settings

/

sftp_user
user to use to publish imgs via sftp
git_url
makina-states fork (git url (ssh based)) to publish new images to
lxc

specific lxc images settings

images
mapping of images informations
cron_sync
activate the img synchronnizer
cron_hour
hour for the img synchronnizer
cron_minute
minute for the img synchronnizer
mc_states.modules.mc_cloud_images.ext_pillar(id_, prefixed=True, ttl=32140800, *args, **kw)

Images extpillar

mc_states.modules.mc_cloud_images.pack_docker(image, destination_image=None, acls=None, tmpdir='/var/lib/docker')

Pack a docker image up to 1 or 2 layers, whith POSIX Acls support

First layer is the whole image Second layer contains the acls, restored.

Procedure:

  • Import an image from exporting this container
  • Run a container from this new image
  • Restore acls
  • Reexport / import
  • Update the docker image tag
mc_states.modules.mc_cloud_images.rebuild_ms_docker(image, destination_image=None, **kwargs)

Rebuild & pack an image, in one row

image
docker image to build from
destination_image
docker image to tag upon successfu build (default to image)
acls
if True: save/restore acls
refresh
if True: run the rebuild dance
pack
if True: pack the resulting image

Any kwargs will be forwarded to refresh_ms_docker.

mc_states.modules.mc_cloud_images.settings(ttl=60)

Images registry

mc_states.modules.mc_cloud_images.sf_release(images=None, flavors=None, sync=True)

Upload a prebuild makina-states layout in different flavors for various distributions to sourceforge.

For now this includes:

  • lxc container based on Ubuntu LTS
  • current ubuntu LTS based tarball containing the minimum vital to bring back to like makina-states without rebuilding it totally from scratch. This contains a slimed version of the containere files ffrom /salt-venv /srv/salt /etc/*salt /var/log/*salt /var/cache/*salt /var/lib/*salt /usr/bin/*salt

this is used in makina-states.cloud.lxc as a base for other containers.

pillar/grain parameters: see mc_cloud_images.settings & mc_cloud_images.complete_images to set appropriate parameters for git, sourceforce, & etc urls & users

Do a release:

salt-call -all mc_lxc.sf_release makina-states-trusty\
    [flavor=[lxc/standalone]] sync=True|False