Terminate a Job

πŸ‘

What you'll learn

  • Terminating a Job

This is a guide for terminating jobs via servicefoundry and TrueFoundry Dashboard.

Terminate a Job Programmatically

You can terminate your job programmatically by using the terminate_job_run function as shown below:

from servicefoundry import terminate_job_run

# Terminate a Job Run
print(terminate_job_run(job_fqn="<your-job-fqn>", job_run_name="<name-of-your-currentjob-run>"))

servicefoundry.terminate_job_run

Arguments:

  • job_fqn (str): Fully Qualified Name of the Deployed Job (without the version number)

  • job_run_name (str): Run Name of the currently running Job.

Terminate a Job Through CLI

  • To terminate the job through cli first Install the servicefoundry through pip install servicefoundry
  • Then Run the below command
servicefoundry terminate job --job-fqn <your-job-fqn> --job-run-name <your-job-run-name>

You can also use servicefoundry terminate job --help to see what more arguments can be passed.

Terminate a Job Through Dashboard

This guide will help you simply cancel or terminate a running job by UI.

  • First, you need to go to the Deployments section on the platform.
  • Then go to the Job tab and select the job which is running currently and you want to terminate
  • Then there is a button for Job Termination as shown in the figure below, clicking which will terminate a running job.