Treatment simpleStepWithInput
cicd/naive::simpleStepWithInput
Configuration
⬡ dispatcher: cicd/runners::CicdDispatchEngine
⬡ logger: log/logger::Logger
Parameters
↳ var arch: Option<Arch> = _ (work/resources/arch::Arch)
↳ var commands: Vec<Command> (process/command::Command)
↳ var cpu: u32 = 500
↳ var description: string = ""
↳ var github: bool = false
↳ var github_project: string = ""
↳ var github_sha: string = ""
↳ var github_token: string = ""
↳ var gitlab: bool = false
↳ var gitlab_pipeline_id: string = ""
↳ var gitlab_project_id: string = ""
↳ var gitlab_ref: string = ""
↳ var gitlab_root_url: string = "https://gitlab.com/api/v4"
↳ var gitlab_sha: string = ""
↳ var gitlab_token: string = ""
↳ var image: string
↳ var in_file: string
↳ var log_service_response: bool = false
↳ var max_duration: u32 = 3600
↳ var memory: u32 = 500
↳ var name: string
↳ var out_file: Option<string> = _
↳ var out_storage: Option<u32> = _
↳ var pull_secret: Option<string> = _
↳ var report: bool = true
↳ var service_containers: Vec<ServiceContainer> = [] (work/resources::ServiceContainer)
↳ var storage: u32 = 5000
↳ var variables: Option<StringMap> = _ (std/data/string_map::StringMap)
Inputs
⇥ data: Stream<byte>
⇥ trigger: Block<void>
Outputs
↦ completed: Block<void>
↦ data: Stream<byte>
↦ failed: Block<void>
↦ finished: Block<void>
↦ started: Block<void>
Run a step on a container.
This treatment manages creation and run of a container and runs commands inside it.
The runner configuration values are:
cpu: CPU amount requested for the worker, in millicores (1000means one full CPU,500half of it);memory: memory requested for the worker, in megabytes;storage: filesystem storage requested for the worker, in megabytes;max_duration: maximum duration for which the worker will be effective, in seconds;arch: hardware architecture the worker must have (should be none if nothing specific is required);service_containers: list of containers to instanciate alongside main container.
The container gets a volume mounted in /mnt/data (this volume size can be setup through out_storage parameter), where in_file and out_file can be written (in_file="some.txt" meaning file "/mnt/data/some.txt").
commands are run, and if they all succeed, the out_file is extracted and streamed through data (out_file="a-file.tar" meaning container wrote file "/mnt/data/a-file.tar").
This output is ignored if no out_file is set.
The trigger input signals the treatment to start, then:
started: emitted when the step effectively starts;completed: emitted when the step finished successfully;failed: emitted if the step failed;finished: emitted when the request finished, regardless of state.
The report and github_*/gitlab_* values are made available to report status in Github Actions and GitLab CI.