astro-run-protocol 0.1.0

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.
docs.rs failed to build astro-run-protocol-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: astro-run-protocol-0.1.6

Astro run

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

astro-run codecov MIT

Features

  • Workflow runtime for Docker
  • Support for gRPC server to coordinate multiple runner clients
  • Support for connecting to remote runners [WIP]

Example

Dependencies

Add the following to your Cargo.toml file:

[dependencies]
astro-run = "0.1"

Code Example

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

// Custom Runner
struct Runner {}

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

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

        // Send runtime logs
        tx.log(ctx.command.run);

        // Send run result
        tx.end(RunResult::Succeeded);

        Ok(rx)
    }
}

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

    // Workflow Configuration
    let workflow = r#"
jobs:
  job:
    name: Job
    steps:
      - timeout: 60m
        continue-on-error: false
        run: Hello World
  "#;

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

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

    // Run the 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.