Skip to content

Latest commit

 

History

History
77 lines (51 loc) · 9.85 KB

shore-cli.md

File metadata and controls

77 lines (51 loc) · 9.85 KB

Shore CLI

High Level Diagram

Context

shore cli is an layer that embeds shore-core and adds interactions with files on disk.

This layer provides:

  1. A common project layout for pipeline development.
  2. Common Terms (english terms) for pipeline operations.
  3. Easy way to get started with Shore.

Commands

  1. project - Project related operations (currently only project init sub-command is supported)
  2. render - Render the project into a viewable representation (e.g. JSON/YAML), renderer dependent.
  3. save - Saves the project into the registered Backend. This operation calls the Renderer:Render() & Backend:SavePipeline() interfaces.
  4. exec - Calls the Backend:ExecutePipeline(). Optionally wait for the pipeline execution to finish via the Backend:WaitForPipelineToFinish()
  5. test-remote - Simple assertion based E2E/Integration test. Calls the Backend:TestPipeline() interface.

Project

The Project entity deals with files and directories on disk.

A set of files and directories the shore-cli depends on.

These files may vary between backend and/or renderer implementations but the building blocks are the same.

At the time of writing, a standard shore project follows this pattern:

my-awesome-pipeline/
├── .gitignore
├── main.pipeline.jsonnet
├── render.yaml
├── exec.yaml
|── E2E.yaml

The project handles the common files that are expected to be used such as render.yaml, exec.yaml, E2E.yaml and will validate their existence when invoking a command.

render.yaml

Parameters that need to be passed to the templating engine (Renderer dependent).

As an example, application & pipeline are required parameters to a pipeline, which should be defined at render time.

exec.yaml

Parameters to invoke the pipeline when developing locally.

These are backend dependent.

E2E.yaml

A schema that defines how to run E2E tests on pipelines.

tests:
  <Test Name>:
    execution_args:
      parameters:
        <parameters> | Object
    assertions:
      <Stage Name>:
        expected_status: String
        expected_output:
          <outputs> | Object

Implementation specific details

shore-cli uses spf13/cobra for all CLI interactions.