pub struct Runner { /* private fields */ }Expand description
The runner.
Implementations§
Source§impl Runner
impl Runner
Sourcepub async fn adopt(
&self,
manifest: &Path,
adoption: Adoption,
) -> Result<RunRecord>
pub async fn adopt( &self, manifest: &Path, adoption: Adoption, ) -> Result<RunRecord>
Takes over the Terraform deployment adoption describes as a run of the manifest at
manifest (pub async fn adopt(&self, manifest: &Path, adoption: Adoption) -> Result<RunRecord>): its state moves into the run’s state folder, and the run is recorded
as up, with the manifest’s params among adoption.params. A run whose record an earlier
down left absent (its state gone with it) is taken over too, its record replaced. Once
taken over, the old folder holds no state: taking it over again is refused, never a second
copy.
§Errors
Fails with adopt_refused when the manifest isn’t a Terraform one, when the run already
has a record that isn’t absent or a state, or when the old folder holds no state; with locked while
another operation holds the run; with manifest_invalid or io when the manifest can’t
be read; and with io when a file can’t be moved or the record written (the state is
put back then).
Source§impl Runner
impl Runner
Sourcepub fn expired(&self, now: SystemTime) -> Result<Vec<RunRecord>>
pub fn expired(&self, now: SystemTime) -> Result<Vec<RunRecord>>
The recorded runs whose expiry passed at now and whose last operation didn’t leave them
absent: the reaper’s input. Reads files only.
§Errors
Fails with io when a record can’t be read.
Sourcepub async fn orphans(
&self,
cloud: Cloud,
place: &Place,
now: SystemTime,
) -> Result<Orphans>
pub async fn orphans( &self, cloud: Cloud, place: &Place, now: SystemTime, ) -> Result<Orphans>
What cloud holds in place tagged with an expiry past now that no recorded run’s
Terraform state covers. A command line that is missing or fails is said in
Orphans::unread, never an error: the sweep goes on.
§Errors
Fails with io when a record or a run’s state can’t be read.
Source§impl Runner
impl Runner
Sourcepub fn new(config: RunnerConfig) -> Result<Runner>
pub fn new(config: RunnerConfig) -> Result<Runner>
A runner with config; its home’s runs/ folder is created owner-only.
§Errors
Fails with io when the home’s runs/ folder can’t be created.
Sourcepub fn add_hooks(&mut self, hooks: Arc<dyn Hooks>)
pub fn add_hooks(&mut self, hooks: Arc<dyn Hooks>)
Adds the embedder’s hooks around lifecycle edges.
Sourcepub fn open(
&self,
manifest: &Path,
name: Option<RunName>,
) -> Result<Running<'_>>
pub fn open( &self, manifest: &Path, name: Option<RunName>, ) -> Result<Running<'_>>
Reads and checks the manifest at manifest, as run name (default: the run’s name).
§Errors
Fails as load_manifest does; with run_name when the run’s name
can’t name a run; with unsupported when this runner can’t run the manifest (its driver, a
delivery, this host).
Sourcepub fn runs(&self) -> Result<Vec<RunRecord>>
pub fn runs(&self) -> Result<Vec<RunRecord>>
Every recorded run, with the state its last operation left it in. Reads files only.
§Errors
Fails with io when a record can’t be read.
Sourcepub fn events(&self, name: &RunName) -> Result<Vec<Event>>
pub fn events(&self, name: &RunName) -> Result<Vec<Event>>
Run name’s logged events, oldest first.
§Errors
Fails with io when the run’s event log can’t be read.
Sourcepub async fn ssh_public_key(&self) -> Result<String>
pub async fn ssh_public_key(&self) -> Result<String>
The public half of the runner’s SSH key, one line: what an embedder authorizes where a run’s SSH goes (a Proxmox node it jumps through). The key is made when the runner has none.
§Errors
Fails with tool_missing when ssh-keygen isn’t installed, tool_failed or timeout
when it can’t make the key, and io when the runner’s ssh/ folder can’t be created.