Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Real-time debugging in Tekton pipelines

May 26, 2021
Vibhav Bobade
Related topics:
CI/CDDeveloper toolsKubernetes
Related products:
Red Hat OpenShiftRed Hat OpenShift Container Platform

    Debugging CI/CD pipelines isn't always easy. This is especially true when a pipeline takes a long time to run, and the failing part you want to debug runs at the end of the pipeline. A feature introduced in a recent Tekton enhancement proposal (TEP) would let users stop the pipeline at any Step and debug in real time.

    This article looks at debugging TaskRuns in Tekton, the open source framework that integrates with Kubernetes to create cloud-native CI/CD pipelines. You can learn more about the basics of Tekton in this article by Joel Lord.

    The proposal, TEP-0042, outlines this feature with a proof of concept that describes how Tekton's composability and container support enable this functionality. For a thorough overview of these concepts, watch the talk, Russian Doll: Extending Containers with Nested Processes by Christie Wilson (Google) and Jason Hall (Red Hat).

    Debugging TaskRuns: TL;DR

    Debugging TaskRuns in Tekton is possible because of the composability provided by container-based pipelines it helps the user create. A Task runs as a Pod, and each Step in a Task runs in a container. With each Step running in a container, we can be sure that the delta of change in the container environment (which is not shared between Steps) is directly associated with the Step itself and nothing else. Anything else that might happen is a side effect, e.g., due to the injection of a sidecar container to the TaskRun. This makes Tekton great for debugging pipelines, as the cost to spin up a container is definitely far less than spinning up a cloud virtual machine (VM).

    With this in mind, TEP-0042 would extend the TaskRun Step life cycle (responsible for orchestrating TaskRun containers to run serially) and add capabilities to pause a TaskRun Step after a failure occurs.

    Modifying the life of a Step

    The life of a Step currently looks something like Figure 1.

    Diagram showing the life of a Step in Tekton: e.Go(), Wait for postFile, write err postFile, return err, exit.
    Figure 1: The life of a Step in Tekton.

    The Step starts running when e.Go() runs. This is where Tekton invokes the entry point of the Step in the TaskRun and the child process (which is the actual Step) runs. If the child process runs successfully, we write a postFile that is used as a flag to convey the same. If it fails, we write an err postFile, which conveys a similar message.

    To halt this Step on failure, we must understand which parts of the Step react when the failure occurs; this is the write err postFile and exit shown in Figure 1. When a Step fails, the failure is marked by writing a <step-no>.err file to /tekton/tools/ directory in the Step container, which is shared with other containers in the Pod. This file is written by the background job in the entry point. The <step-no>.err file also lets the subsequent Steps know that there has been a failure, and eventually exits the TaskRun.

    This mechanism needs to be updated to support the discovery of Step failures and the ability to stop the Steps before it exits. This requires disabling the write err postFile. Instead of exiting the Step, it will wait for a flag that would exit the Step from the suspended state. The updated flow would look something like the diagram shown in Figure 2.

    Diagram showing proposed Step life cycle in Tekton when TaskRun failure occurs: e.Go(), Wait for postFile, return err, Wait for breakpoint exit.
    Figure 2: The proposed update to the Step life cycle in Tekton when TaskRun failure occurs.

    Once the Step is halted, the client can access the container environment for debugging.

    Conclusion

    In practice, the debugging solution is more nuanced than the overview provided here. Read the full TEP-0042 proposal for details.

    This topic is also the subject of a cdCon 2021 talk: Houston, We've Got a Problem!: How to Debug your Pipeline in Tekton.

    The debugging feature is expected to be available in Tekton later this year, with support across different Tekton clients, including the Red Hat OpenShift Pipelines command-line interface (tkn) and the Tekton dashboard. Get ready to debug Tekton pipelines in real time.

    Last updated: October 31, 2023

    Related Posts

    • Creating Pipelines with OpenShift 4.4’s new Pipeline Builder and Tekton Pipelines

    Recent Posts

    • Preventing GPU waste: A guide to JIT checkpointing with Kubeflow Trainer on OpenShift AI

    • How to manage TLS certificates used by OpenShift GitOps operator

    • Configure a split disk on OpenShift Container Platform

    • Red Hat Enterprise Linux 10.2 and 9.8: Top features for developers

    • What GPU kernels mean for your distributed inference

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.