A docker executor for Jaypore CI.
- class jaypore_ci.executors.docker.Docker
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.
Will create a docker network.
If it fails to do so in 3 attempts it will raise an exception and fail.
Deletes all jobs associated with the pipeline for this executor.
It will stop any jobs that are still running.
Delete the network for this executor.
- get_job_name(job, tail=False)
Generates a clean job name slug.
- get_net(*, pipe_id=None)
Return a network name based on what the curent pipeline is.
Returns a logging instance that has executor specific information bound to it.
- run(job: Job) str
Run the given job and return a docker container ID. In case something goes wrong it will raise TriggerFailed
Set executor’s pipeline to the given one.
This will clean up old networks and create new ones.
This function is meant to perform any work that should be done before running any jobs.
On exit the executor must clean up any pending / stuck / zombie jobs that are still there.