ark::supervisor::Updater

Defined in header “ark/supervisor/updater.hh”.


The Updater is responsible for downloading, extracting and removing releases.

The Updater manages a directory structure under the configured release directory: ├── downloads ├── releases │ ├── e98f826b-a6fb-4094-9a9a-04251d0a3287 │ │ ├── c │ │ │ └── c_stage_config.yml │ │ ├── pipeline │ │ ├── pipeline.yml │ │ ├── .ark-release-metadata/package_manifest.json │ │ └── .ark-release-metadata/software_configuration.json │ └── faea926a-7757-43cd-ae85-5b40a3a29618 │ ├── a │ │ └── config.yml │ ├── b │ │ └── b_stage_config.yml │ ├── pipeline │ ├── pipeline.yml │ ├── .ark-release-metadata/package_manifest.json │ └── .ark-release-metadata/software_configuration.json └── active -> releases/e98f826b-a6fb-4094-9a9a-04251d0a3287 downloads - Directory used while downloading/extracting new releases. Empty except during an update. releases - Directory containing the extracted releases. Each release in contained in a directory named after its gui id. It contains the software release bundle configuration and the extracted release image in a directory named after the hash of the release archive. software - A symlink to the current active release. This is the release that is run on startup.

Typedefs

  • using ExtractionMode =
    Possible modes when extracting releases.

Methods

  • Updater(UpdaterConfig config)
    Initializes the updater with this configuration.

  • ~Updater()
    Destructor.

  • std::optional< core::Guid > active_release()
    Get the currently active release. Return nullopt if no release is active.

  • std::optional< SoftwareReleaseConfig > get_release_config(core::Guid id)
    Get the software release configuration for the given release.

  • std::vector< core::Guid > list_releases()
    Return a list of all available releases.

  • core::Guid lookup_release_identifier_from_release_ring(const std::string & ring_name, const std::string & package_type, const std::string & bearer_token)
    Get the release id for the given ring from the catalog.

  • void download_and_extract_release(const core::Guid & id, ExtractionMode mode, const std::string & bearer_token)
    Download and extract a release.

  • void download_release(const core::Guid & id, const std::filesystem::path & path, const std::string & bearer_token)
    Download a release and writes it out to the given path.

  • void manual_extract(const core::Guid & id, const core::ByteBuffer & archive, ExtractionMode mode)
    Manually extract the given release, this will not perform any network calls and only uses the provided config and archived contents.

  • void manual_extract(const core::Guid & id, const std::filesystem::path & archive_path, ExtractionMode mode)
    Manually extract the given release, this will not perform any network calls and only uses the provided config and archive pointed to by the path.

  • void activate_release(const core::Guid & id)
    Activate a new release. The last release reference is always saved in a standalone symlink as the last active release.

  • std::filesystem::path release_binary_dir(const core::Guid & id)
    Returns the binary directory for the given release.

  • void remove_release(const core::Guid & id)
    Remove/delete the release from the release directory.

  • void remove_all_releases()

  • void verify_release(const core::Guid & id)
    Verify the release file hashes match the expected values.

  • std::optional< core::Guid > last_release()
    Return the id of the last release; return nullopt if not present.