View Source AntikytheraCore.Version.History (antikythera v0.5.1)

Functions to get information from "history" files.

Antikythera uses history files to detect new deployable versions of antikythera instance and gears. Each of antikythera instance and gears has its own history file. The files reside in AntikytheraCore.Path.history_dir/0.

When deploying a new version, after successfully generated a compiled artifact (tarball), antikythera's deploy script instructs the ErlangVM nodes by appending a line to the history file of the target OTP application. Each line takes either of the following forms:

format of lineinstallableupgradable
deploy with hot code upgrade<version>truetrue
deploy with hot code upgrade (canary)<version> canary=<hosts>falsehost in hosts
deploy without hot code upgrade<version> noupgradetruefalse
deploy without hot code upgrade (canary)<version> noupgrade_canary=<deadline>now < deadlinefalse
  • "installable" means that the version can be installed into a node that doesn't have the OTP application.
    • See also script/in_cloud/erl/boot_impl.sh, which chooses an appropriate version of OTP release of the antikythera instance at startup of a newly created host.
  • "upgradable" means that the version can be applied by hot code upgrade to a node that has a previous version of the OTP application.

Versions in a history file are expected to monotonically increase.

Summary

Functions

Link to this function

all_deployable_gear_names()

View Source
@spec all_deployable_gear_names() :: [Antikythera.GearName.t()]
Link to this function

find_all_modified_history_files(since)

View Source
@spec find_all_modified_history_files(Antikythera.SecondsSinceEpoch.t()) ::
  {boolean(), [Antikythera.GearName.t()]}
Link to this function

latest_installable_gear_version(gear_name)

View Source
@spec latest_installable_gear_version(Antikythera.GearName.t()) ::
  nil | Antikythera.VersionStr.t()
Link to this function

next_upgradable_version(app_name, current_version)

View Source
@spec next_upgradable_version(
  :antikythera | Antikythera.GearName.t(),
  Antikythera.VersionStr.t()
) :: nil | Antikythera.VersionStr.t()