Packaging tools for shanty services.

Related tags

Miscellaneousparcel
Overview

parcel

Packaging tools for shanty services.

What?

Services are docker containers deployed by shanty on a hosting appliance. Each service consists of the main parts:

  • A docker image
  • A service definition (.yml file used by docker)
  • Metadata, a name, description, dependencies and author information
  • Configuration, variable declarations to be used in the service defition.

A service is packaged as a tarball, minimal tarball contents would be:

/
- manifest.json
- service.yml
/.signatures/
- manifest.json.sig
- service.yml.sig

manifest.json contains metadata about the service, service.yml contains the docker service definitions. Variable substitution is performed on service.yml before it is deployed. Variables can be sourced from manifest.json or can include values from the hosting appliance settings. an example manifest.json might look like:

{
  "name": "example",
  "author": "[email protected]",
  "version": "0.9.8",
  "image": "shantysocial/echo",
  "image_tag": "12934324",
  "service_definition": "service.yml",
  "variables": {
  },
  "settings": [
    "SHANTY_OAUTH_TOKEN"
  ],
  "options": {
    "OPTION_A_ENABLED": {
      "type": "boolean",
      "description": "Toggles option A",
      "default": true
    }
  },
  "files": [
    "foo_config.cfg"
  ]
}

NOTE: The author email address is significant in that it defines the PGP key used to sign and verify the parcel file.

Settings are pulled from the shanty appliance global configuration. Options are obtained from the user at installation time. Options are private to the service while settings are global.

The corresponding service.yml file might look like this:

version: "3"

services:
  example:
    image: this_value_is_ignored_and_can_be_omitted
    environment:
      - ENV_VAR0_NAME=${SHANTY_OAUTH_TOKEN}
      - ENV_VAR1_NAME=${OPTION_A_ENABLED}
  configs:
    - source: foo_config
      target: /etc/foo_config/foo_config.cfg
      mode: 0444

configs:
  foo_config:
    file: foo_config.cfg

How?

You must first write a manifest.json file and service.yml if the service.yml refers to any configuration files, the must be named in the manifest.json so that they are bundled. File names must be unique.

Once you have your manifest, you can package it by running shanty-parcel

$ shanty-parcel lint manifest.json
$ shanty-parcel build --lint manifest.json

Which will first check for common errors, and then produce the parcel file example.pcl.

Library

This package can also be used as a library, for loading, verifying and preparing pacels for deployment.

from pprint import pprint
import docker
import shanty_parcel


p = shanty_parcel.load('example.pcl', verify=True)

# You can also lazily check the signature.
p.verify()

# Print the contents.
pprint(p.files)

# Configure the service.
config = {}
for option in p.options:
    value = input(f"Please enter a value of type {option.type} for {option.name} [enter for default: {option.default}] ")
    config[option.name] = value

print("Example needs the following settings:")
for setting in p.settings:
    print(f" - {setting.name}")

p.configure(config, settings)

# Save the .yml and supporting files in given directory.
p.write('/path/for/output/')

# Deploy the service.
docker.swarm.deploy('/path/for/output/example.yml')
This is a batch script created to WEB-DL.

widevine-L3-WEB-DL-Script This is a batch script created to WEB-DL. Works well with .mpd files , for m3u8 please use n_m3u8 program (not included in t

Paranjay Singh 312 Dec 31, 2022
adbsync - An ADB syncing helper

adbsync - An ADB syncing helper What's this? Everytime I wanted to make a backup of my phone, or restore those files onto it, I had to use everytime t

Giovanni Gualtieri 3 Aug 05, 2022
A python trivium implemention

A python trivium implemention

tnt2402 1 Nov 12, 2021
Open source book about making Python packages.

Python packages Tomas Beuzen & Tiffany Timbers Python packages are a core element of the Python programming language and are how you create organized,

Python Packages 169 Jan 06, 2023
bamboo-engine 是一个通用的流程引擎,他可以解析,执行,调度由用户创建的流程任务,并提供了如暂停,撤销,跳过,强制失败,重试和重入等等灵活的控制能力和并行、子流程等进阶特性,并可通过水平扩展来进一步提升任务的并发处理能力。

bamboo-engine 是一个通用的流程引擎,他可以解析,执行,调度由用户创建的流程任务,并提供了如暂停,撤销,跳过,强制失败,重试和重入等等灵活的控制能力和并行、子流程等进阶特性,并可通过水平扩展来进一步提升任务的并发处理能力。 整体设计 Quick start 1. 安装依赖 2. 项目初始

腾讯蓝鲸 96 Dec 15, 2022
Module to align code with thoughts of users and designers. Also magically handles navigation and permissions.

This readme will introduce you to Carteblanche and walk you through an example app, please refer to carteblanche-django-starter for the full example p

Eric Neuman 42 May 28, 2021
All solutions for the 2021 Advent of Code event.

Advent of Code 2021 Solutions All solutions for the 2021 Advent of Code event. Setup Create a file called .session. Go to adventofcode.com and copy th

Bruce Berrios 6 Dec 26, 2021
Python screenshot library, replacement for the Pillow ImageGrab module on Linux.

tldr: Use Pillow The pyscreenshot module is obsolete in most cases. It was created because PIL ImageGrab module worked on Windows only, but now Linux

455 Dec 24, 2022
A python script that fetches the grades of a student from a WAEC result in pdf format.

About waec-result-analyzer A python script that fetches the grades of a student from a WAEC result in pdf format. Built for federal government college

Oshodi Kolapo 2 Dec 04, 2021
python3 scrip for case conversion of source code files writen in fixed form fortran

convert_FORTRAN_case python3 scrip for case conversion of source code files writen in fixed form fortran python3 scrip for case conversion of source c

7 Sep 20, 2022
RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information.

RDFLib RDFLib is a pure Python package for working with RDF. RDFLib contains most things you need to work with RDF, including: parsers and serializers

RDFLib 1.8k Jan 02, 2023
A faster copy of nell's comet nuker

Astro a faster copy of nell's comet nuker also nell uses external libraries like it's cocaine man never learned to use ansi color codes (ily nell) (On

horrid 8 Aug 15, 2022
LINUX-AOS (Automatic Optimization System)

LINUX-AOS (Automatic Optimization System)

1 Jul 12, 2022
The code submitted for the Analytics Vidhya Jobathon - February 2022

Introduction On February 11th, 2022, Analytics Vidhya conducted a 3-day hackathon in data science. The top candidates had the chance to be selected by

11 Nov 21, 2022
This is a menu driven Railway Reservation Project which is mainly based on the python-mysql connectivity.

Online-Railway-Reservation-System This is a menu driven Railway Reservation Project which is mainly based on the python-mysql connectivity. The projec

Ananya Gupta 1 Jan 09, 2022
VirtualBox Power Driver for MAAS (Metal as a Service)

vboxpower VirtualBox Power Driver for MAAS (Metal as a Service) A way to manage the power of VirtualBox virtual machines via the MAAS webhook driver.

Saeid Bostandoust 131 Dec 17, 2022
This tool don't used illegal ativity

ETHICALTOOL This tool for only educational purposes don't used illegal ativity @onlinehacking this tool for pkg update && pkg upgrade && pkg install g

Mrkarthick 4 Dec 23, 2021
Suite of tools for retrieving USGS NWIS observations and evaluating National Water Model (NWM) data.

Documentation OWPHydroTools GitHub pages documentation Motivation We developed OWPHydroTools with data scientists in mind. We attempted to ensure the

36 Dec 11, 2022
Metal Gear Rising: Revengeance's DAT archive (un)packer

DOOMP Metal Gear Rising: Revengeance's DAT archive (un)packer

Christopher Holzmann Pérez 5 Sep 02, 2022
奇遇淘客服务器端

奇遇淘客 APP 服务器端 警告 正在使用 v0.2.0 版本的用户,请尽快升级到 v0.2.1。 v0.2.0 版本的 Docker 镜像中包含了有问题的 aiohttp。 奇遇淘客代码库 奇遇淘客 iOS APP 奇遇淘客 Android APP 奇遇淘客文档 服务器端文档 Docker 使用

奇遇科技 92 Nov 09, 2022