Elektrobit / flake-pilot

Registration/Control utility for applications launched through a runtime-engine, e.g containers
MIT License
9 stars 5 forks source link

Common configs #167

Closed Ichmed closed 10 months ago

Ichmed commented 10 months ago

A common Config struct to be used by all pilots. To make this easier to accomplish I reworked the yaml a bit, so all pilots can have a shared header

name: some_name # The name of the flake(!) not the container
host_app_path: some/path/here
include: ~ # List of includes, like before
engine: engine_name # e.g. "podman" or "firecracker"
runtime: <Runtime> # All data required by the specific engine. can be any yaml value, usually dict

This allows tools like flake-ctl to load any config, no matter what engine it is meant for.

Comparison of the old podman template with the new structure

Old (container)

include:
  tar: ~
container:
  name: name
  target_app_path: path/to/program/in/container
  host_app_path: path/to/program/on/host
  base_container: ~
  layers: ~
  runtime:
    runas: root
    resume: false
    attach: false
    podman:
      - "-ti"

New

name: my_podman_flake
host_path: /usr/bin/my_flake
include: []
engine: podman
runtime:
  base: ubuntu
  layers: []
  target: null
  resume: false
  attach: false
  runas: null
  args:
  - -ti

Old (Firecracker)

include:
  tar: ~
vm:
  name: name
  target_app_path: path/to/program/in/container
  host_app_path: path/to/program/on/host
  base_vm: ~
  layers: ~
  runtime:
    runas: root
    resume: false
    firecracker:
      boot_args:
        - "init=/usr/sbin/sci"
        - "console=ttyS0"
        - "root=/dev/vda"
        - "acpi=off"
        - "rd.neednet=1"
        - "ip=dhcp"
        - "quiet"
      overlay_size: ~
      rootfs_image_path: ~
      kernel_image_path: ~
      initrd_path: ~
      mem_size_mib: 4096
      vcpu_count: 2
      cache_type: ~

New (Firecracker)

name: my_firecracker_flake
host_path: /usr/bin/my_flake
include: []
engine: firecracker
runtime:
  base: ubuntu
  layers: []
  target: null
  resume: false
  vm:
    boot_args:
    - init=/usr/sbin/sci
    - console=ttyS0
    - root=/dev/vda
    - acpi=off
    - rd.neednet=1
    - ip=dhcp
    - quiet
    overlay_size: 2GiB
    rootfs_image_path: null
    kernel_image_path: null
    initrd_path: null
    mem_size_mib: 4096
    vcpu_count: null
    cache_type: null

Features

The test cases will be cleaned up before merge