#workflow #runner #automation #docker #ci

astro-run-scheduler

AstroRun is a highly customizable workflow orchestrator that allows users to define their own core runners. Whether it's Docker or other platforms, AstroRun empowers users to run workflows with ease and flexibility.

3 releases

0.1.2 Oct 1, 2023
0.1.1 Sep 1, 2023
0.1.0 Aug 23, 2023

#6 in #grpc-server

Download history 12/week @ 2023-11-04 17/week @ 2023-11-11 24/week @ 2023-11-18 31/week @ 2023-11-25 18/week @ 2023-12-02 21/week @ 2023-12-09 19/week @ 2023-12-16 22/week @ 2023-12-23 8/week @ 2023-12-30 12/week @ 2024-01-06 17/week @ 2024-01-13 15/week @ 2024-01-20 36/week @ 2024-01-27 11/week @ 2024-02-03 31/week @ 2024-02-10 79/week @ 2024-02-17

160 downloads per month
Used in 3 crates

MIT license

120KB
3.5K SLoC

Astro run

Astro Run is a highly extensible runner that can execute any workflow.

astro-run CI codecov MIT

Features

Example

Dependencies

Add the following to your Cargo.toml file:

[dependencies]
astro-run = "0.1"

Code Example

use astro_run::{stream, AstroRun, RunResult, Workflow};

struct Runner;

impl Runner {
  fn new() -> Self {
    Runner
  }
}

#[astro_run::async_trait]
impl astro_run::Runner for Runner {
  async fn run(&self, ctx: astro_run::Context) -> astro_run::RunResponse {
    let (tx, rx) = stream();

    tokio::task::spawn(async move {
      // Send running log
      tx.log(ctx.command.run);

      // Send success log
      tx.end(RunResult::Succeeded);
    });

    Ok(rx)
  }
}

#[tokio::main]
async fn main() {
  // Create astro run
  let astro_run = AstroRun::builder().runner(Runner::new()).build();

  // Workflow
  let workflow = r#"
jobs:
  job:
    name: Job
    steps:
      - run: Hello World
  "#;

  // Create workflow
  let workflow = Workflow::builder()
    .config(workflow)
    .build(&astro_run)
    .unwrap();

  // Create a new execution context
  let ctx = astro_run.execution_context().build();

  // Run workflow
  let _res = workflow.run(ctx).await;
}

Astro Run only defines the interface for Runners. Users can implement their own desired Runners, e.g., Docker runner.

More Examples

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to improve the project.

License

This project is licensed under the MIT License.

Dependencies

~15–30MB
~555K SLoC