Conducto for CI/CD
Rapid and Painless Debugging
Rapid and painless are rarely words associated with debugging real-world CI/CD pipelines. But with Conducto, they are a reality. When we switched our internal CI/CD pipeline from CircleCI to Conducto, our typical debug cycle dropped from 30+ minutes to less than 3 minutes. This is not an exaggeration.
This is because Conducto empowers you to:
- quickly identify errors in the web app,
- fix specification errors in-place,
- immediately reproduce an error in a shell,
- debug locally with your own editor and tools, and
- effortlessly push fixed code into a live pipeline.
To demonstrate, I will debug some real errors in Conducto’s internal CI/CD pipeline.
Check out our related Easy Error Resolution tutorial here.
Quickly Identify Errors
I have made some changes in the Conducto code base, and I want to run our CI/CD pipeline to make sure they are ok. I launch the pipeline, and soon after, I see an error in the left hand pipeline pane.
I quickly jump to the error by clicking the Next Error icon.
It turns out that we know app_test is a flaky, and we just have not gotten around to writing a robust fix for it yet. For now, I know that my changes have nothing to do with this part of the code, so I choose to skip the test. I select the app_test node and click the Skip button, which removes that node from the pipeline, allowing the pipeline to continue.
Fix Specification Errors In-place
My pipeline continues to run, and I finally encounter an real error related to my changes. I click the Next Error icon to jump to it.
The node pane on the right shows me detailed information, including the command it ran, execution parameters, and stdout and stderr if present.
Luckily, this is an easy bug. I removed the --tag
argument from build.py
and simply forgot to update the command in the pipeline script. I can quickly make an in-place modification to the command to fix this pipeline.
After clicking UPDATE, I see the change I have made in the node pane.
Now, I simply click Reset in the pipeline pane to re-run the node and see it succeed.
Note that this fix is local to this instance of the pipeline, and does not modify anything in our pipeline script. So, at this point, I also put the fix in my pipeline script so that future pipelines do not suffer from this error.
Immediately Reproduce an Error in a Shell
Finally, my pipeline fails on the run node, our final integration test.
The node pane stderr shows me that this is a code error in the file test_integration.py
. I actually need to debug this problem, so I click on the Live Debug lightning bug icon.
This copies a command like this to my clipboard.
conducto livedebug --id=ehb-xna --node=/integration/pipelines/run --timestamp=1586384556.384000
I can paste this into any shell with conducto
installed and drop into a container with my command and full execution environment.
As suggested in the instructions printed by livedebug, I can execute this command and see the exact stderr reported in the web app.
Debug Locally With Your Own Editor and Tools
This container has mounted my local code, which means that I can use my editor of choice (VSCode, PyCharm, and vim are all popular choices at Conducto) and any other debug tools on this problem. Once I fix the code, the livedebug container automatically sees my edits, and I can simply re-run the command to confirm that it works.
Effortlessly Push Fixed Code into a Live Pipeline
The final step is to push my fixed code into the pipeline and re-run any affected nodes. This is incredibly easy, I just click the Rebuild and Reset button in the node pane.
Rebuild and Reset re-builds the image with your latest code, then resets the node so that it runs again. The Timeline shows the previous failed run, and the new successful one. You can click on any run in the Timeline to see it’s command, execution parameters, stdout, and stderr to keep track of what has changed from run to run.
Why Are You Still Waiting?
And that is our typical test-debug-test cycle at Conducto. In prior jobs, I have used Jenkins and CircleCI, and I spent a lot of time painstakingly re-creating debug environments and waiting around when testing a fix required re-running an entire pipeline. Now, I test frequently and debug quickly and effortlessly. Simply put, using Conducto for CI/CD makes me more productive, by a lot.
Why are you still waiting? Get started with Conducto now. Local mode is always free and is only limited by the cpu and memory on your machine. Cloud mode gives you immediate scale. Use the full power of python to write pipelines with ease. And, experience rapid and painless debugging.