ark::supervisor

Enums

Classes

  • ark::supervisor::ArkosUpdaterStage
    This class allows you to spawn an updater, which can be used for managing things like ArkOS updates. It’s different from the supervisor, which expects to not just do updates, but launch processes as well.

  • ark::supervisor::CommandStatusSubscriber
    This class allows you to construct a receiver for incoming status messages. They are queued and can be read at your leisure.

  • ark::supervisor::MountSingleton
    This singleton provides a thread that is capable of remounting shares. It’s kept in a separate thread for priveledge separation, so that the smallest footprint possible has access to mount commands.

  • ark::supervisor::ProcessTableModel
    This class can take in a SupervisorStatus and visualize the Process information in a table.

  • ark::supervisor::ScopedRemount
    This class will remount the given path as read/write (if possible, and if it is set) on construction, and unmount it on destruction.

  • ark::supervisor::Supervisor

  • ark::supervisor::SupervisorStage
    Wrapper for the Supervisor and Updater, intended to provide supervised execution and deployments of software releases.

  • ark::supervisor::SupervisorUtilityPlugin
    This plugin allows you to interact with a supervisor to query and control processes.

  • ark::supervisor::Updater
    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.

  • ark::supervisor::DeployArchiveRequest
    This is a ‘mock’ request that translates a HTTP message (referencing an on-disk path) into a deploy command.

  • ark::supervisor::MountPointEntry
    An entry in the /proc/mounts file. Returned from the parse_mounts() API.

  • ark::supervisor::PackagerRelease
    This structure is the result of creating a release.

  • ark::supervisor::PackagerReleaseConfig
    The configuration used to determine what is packaged up.

  • ark::supervisor::PackagerStorageConfig
    The configuration used for the remote storage of the packager.

  • ark::supervisor::QueryReleaseResult
    A structure that contains some information for a release stored in the catalog, intended to be returned when searching for releases.

  • ark::supervisor::ReleaseRegistrationConfig
    This structure is used to configure the registration of release packages.

Functions

Declared in “ark/supervisor/bootstrap.hh”:

  • void generate_service_unit_file(const std::filesystem::path & service_unit_file_path, const std::string & ark_dir_base_str, const std::string & catalog_url_str)
    Generate the systemd service unit file for the Ark Platform Supervisor service.

Declared in “ark/supervisor/deploy_archive_request.hh”:

Declared in “ark/supervisor/fallback.hh”:

  • void revert_to_fallback(const std::string & software_dir_str, const std::string & fallback_dir_str)
    Update symlinks for the current software release to the expected fallback path.

Declared in “ark/supervisor/mount_singleton.hh”:

  • std::vector< MountPointEntry > parse_mounts(std::string_view content)
    Parses the given contents of a /proc/mounts file, returning a list of mount point entries.

  • std::pair< int, std::string > split_mount_options(const std::vector< std::string > & options)
    Returns a pair of mount flags (fs-independent) and mount options (fs-dependent) form the list of options.

Declared in “ark/supervisor/packager.hh”:

  • SoftwareBundleConfig parse_deployable(const std::filesystem::path & path, const std::map< std::string, std::string > & definitions)
    This will parse the given path and return a ‘deployable’, which is used by the release packager.

    All definitions will be resolved. IE, strings that match ${key} will be replaced by value.

  • PackagerRelease create_release(const PackagerReleaseConfig & release_config, const PackagerStorageConfig & storage_config)
    Creates a release based on the given packager configuration. This release is then registered with the catalog server.

    This version of create_release is incapable of signing packages.

  • PackagerRelease create_release(const PackagerReleaseConfig & release_config, const PackagerStorageConfig & storage_config, catalog::CatalogApi & catalog_client)
    Creates a release based on the given packager configuration. This release is then registered with the catalog server.

    The catalog client is used for signing purposes if you aren’t signing anything, the client will not be used.

  • PackagerRelease create_release(const PackagerReleaseConfig & release_config, const PackagerStorageConfig & storage_config, std::optional< catalog::CatalogApi > & catalog_client)
    Creates a release based on the given packager configuration. This release is then registered with the catalog server.

    The catalog client is used for signing purposes if you aren’t signing anything, the client will not be used.

  • void register_release(catalog::CatalogApi & catalog_client, const PackagerStorageConfig & storage_config, const ReleaseRegistrationConfig & registration_config, const PackagerRelease & release)
    Registers the given release with the catalog.

  • std::vector< QueryReleaseResult > query_releases_by_name(catalog::CatalogApi & catalog_client, const std::string & search_string)
    Finds release(s) with the given name in the catalog. Does a partial name match.

Declared in “ark/supervisor/reboot.hh”:

  • void reboot_local_machine()
    Reboots the local machine by sending the appropriate signal to init. Requires CAP_KILL or this will fail.

Declared in “ark/supervisor/stages/utility.hh”:

  • void send_command_status(pipeline::PublisherPtr< SupervisorCommandStatus > & publisher, const core::Guid & command_id, SupervisorCommandState state, fmt::format_string< Args… > text, Args &&… args)
    Used to send a supervisor command status message out over the given publisher. A convenience routine meant to make formatting text and sending a complete message a bit easier.

Declared in “ark/supervisor/supervisor.hh”:

  • SupervisorConfig to_supervisor_config(const SoftwareReleaseConfig & release, const std::filesystem::path & working_directory)

Declared in “ark/supervisor/tools/utility.hh”:

  • SupervisorStatus query_latest_status(core::Url host_url)
    Queries the latest status on the given supervisor.

  • void start_all_processes(const core::Guid & command_id, const core::Url & host_url, const std::optional< std::string > & process_to_override, const std::vector< std::string > & override_flags)
    Starts all processes on the given supervisor.

  • void stop_all_processes(const core::Guid & command_id, const core::Url & host_url)
    Stops all processes on the given supervisor.

  • void deploy_archive_release(const core::Guid & command_id, const core::Url & host_url, const std::string & comms_namespace, const core::Guid & release_id, const std::filesystem::path & deploy_archive, std::chrono::seconds overall_timeout)
    Deploys the given archive release to the remote supervisor.

  • void send_supervisor_message(core::Url host_url, const std::string & channel_name, const Type & message)
    Sends the given message to the specified host and channel name.

  • void send_supervisor_file(core::Url host_url, const std::string & channel_name, const std::map< std::string, std::string > & query_parameters, const std::filesystem::path & path, std::chrono::seconds overall_timeout)
    Sends the given file to the specified host and channel name, tacking on the specified query parameters.