jaypore_ci.executors package

Submodules

jaypore_ci.executors.docker module

A docker executor for Jaypore CI.

class jaypore_ci.executors.docker.Docker[source]

Bases: Executor

Run jobs via docker. To communicate with docker we use the Python docker sdk.

Using this executor will:
  • Create a separate network for each run

  • Run jobs as part of the network

  • Clean up all jobs when the pipeline exits.

create_network()[source]

Will create a docker network.

If it fails to do so in 3 attempts it will raise an exception and fail.

delete_all_jobs()[source]

Deletes all jobs associated with the pipeline for this executor.

It will stop any jobs that are still running.

delete_network()[source]

Delete the network for this executor.

delete_old_containers()[source]
get_execution_order()[source]
get_job_name(job, tail=False)[source]

Generates a clean job name slug.

get_net(*, pipe_id=None)[source]

Return a network name based on what the curent pipeline is.

get_status(run_id: str) JobStatus[source]

Given a run_id, it will get the status for that run.

logging()[source]

Returns a logging instance that has executor specific information bound to it.

run(job: Job) str[source]

Run the given job and return a docker container ID. In case something goes wrong it will raise TriggerFailed

set_pipeline(pipeline)[source]

Set executor’s pipeline to the given one.

This will clean up old networks and create new ones.

setup()[source]

This function is meant to perform any work that should be done before running any jobs.

teardown()[source]

On exit the executor must clean up any pending / stuck / zombie jobs that are still there.

Module contents