Skip to content
Vanshdeep Singh edited this page Sep 24, 2020 · 13 revisions

Welcome to the control-node wiki!

Development

Stage 1

Assumptions

  • Elixir release tar.gz file is available

Registry

A registry will allow users to upload an archive as a new release. This archive can then later be used to deploy the version.

Local registry

In the first iteration support only local registry i.e. an archive is directly uploaded to control node which then stores it locally onto the filesystem.

%ControlNode.Registry.Local{
  path: "/path/to/local/archive/folder"  
}

Application deployment config

Host

Host is a machine where the release is deployed.

SSH host

SSH is used to upload the release to the host

%ControlNode.Host.SSH{
  host: "host-vm",
  user: "username"
}

Application deployment config

Application configuration defines the deployment configuration for the releases of a given application.

%ControlNode.ApplicationSpec{
  name: :my_production_app,
  registry: %ControlNode.Registry.Local{},
  boot_strategy: :restart,
}

rollout_strategy : Directs how to deploy the release and remove the existing nodes.

  • :incremental_replace will deploy the release using the boot_strategy one-by-one to existing nodes.

boot_strategy : defines how the service is to be upgraded to the new version.

Namespace configuration

A logical unit which contains an application deployment definition for the given Namespace. It mainly defines the hosts where the application should be deployed to and the environment variables.

%ControlNode.NamespaceSpec{
  tag: :staging,
  host_path_prefix: "/opt/some/path",
  hosts: [%ControlNode.Host.SSH{}],
  release_type: :incremental_replace,
  release_trigger: :manual,
  environment: "TODO",
  application_spec: %ControlNode.ApplicationSpec{},
}

deployment_trigger :: :manual | :new_release

Checks

It is essential to ensure that there is only 1 release config for an application per namespace

Environment variables

TODO

API

API

@type tar_file :: binary

@spec upload_release(%DeploymentConfig{}, host, tar_file) :: :ok | {:error, term()}