Home > On-Demand Archives > Talks >
Why Should I Care About CI/CD?
Shawn Prestridge - Watch Now - EOC 2021 - Duration: 41:20
What a perspicacious observation! So many people forget that eventually you have to debug, and if all you have are code breakpoints and printf statements, it can be difficult (and sometimes nearly impossible) to debug things like exceptions, code profiling, nested interrupt issues, and more. There is a way where you can take the output of a CI/CD pipeline and debug it in Embedded Workbench. If you are already developing code in Embedded Workbench, you can just take the .out file output of the CI/CD and replace the one in your project's directory structure. If your build configuration is, say, "Flash debug", then your project directory will have a folder called "Flash debug" and under that will be a directory called "Exe" that contains the .out file. On the other hand, you can take the .out file from your CI/CD pipeline and in the Embedded Workbench choose the Project menu, then Create New Project and choose Externally-Built Executable as the type. There will be a how-to document that pops up and tells you how to add the .out file to the project. Once you set the device type and the hardware debugger in the Project settings, you can do source-level debugging of the output file (assuming the directory structure of the source on your machine matches the structure on the build pipeline). If you have any issues, you can contact us at support@iar.com. By the way, I am running a webinar tomorrow called "Practical Debugging Techniques" that shows how to leverage some of the debugging functionality in our tools to do things like finding hard faults, stack overflows, and several other common programming glitches!
Thanks a lot for the detailed answer.
This sounds like I still need to install IAR (in the correct version) manually on my PC, i.e. not within Docker to enable debugging with a GUI (using JTAG and my embedded hardware or import the .out file as you mention). Is that correct?
It would become a no-brainer if everything could go within Docker and the same toolchain could be used for all developer-PCs (incl. GUI) and CI.
Stay tuned. 8-)
Thanks for a really good presentation and Q&A session. Good to know that my existing setup is very similar: Jenkins, Github, IARBuild tools. I?m using the Jenkins pipeline and it?s running on a Windows server. I?m not sure why this wasn?t mentioned as an alternative to a VM or Docker? It was simple to setup and installation steps documented to be repeatable if ever needed. My other question is you didn?t seem to cover the deployment aspect of CI/CD, particularly for embedded devices. Do the binaries typically get uploaded to a website automatically, so that customers of the product to update if they wish?
You're correct, Windows Server is an alternative way to approach CI/CD. My intention was to approach CI/CD in ways that are considered "lighter weight" than a full server in order to minimize overhead/expense with adopting more modern build techniques...but you're right, it is easier to setup! On the deployment side, there are a number of ways that CD can be performed. The ones that we see used most often are AWS Code Deploy, GitLab, Bamboo, Team City, and Jenkins, though there are many more. After passing all the checks, the code is typically encrypted and uploaded to a CD server to be either auto-magically deployed to the client devices (e.g. in the case of a critical security update), or a notification delivered to the customer that an update is available. Usually that upload process is automated, but the actual mechanics of how that happens varies depending on the CD strategy you choose to employ.
Thanks Shawn. Good to know there's a better way. I've only worked in places that still use the manual approach - copy the file by hand after weeks of chasing for signatures in archaic tools or on paper, which creates bottlenecks and admin.
Does the CI/CD server require a license for the build toolchain? For example if I have a node-locked license for my developer workstation, would I have to get a second license for the CI/CD server? Or if I'm using a floating license server then would the CI/CD server be able to share the license with my developer workstation?
Hi Kevin, to do what I demonstrated, you would also need a license of BXARM (IAR Linux Build Tools for Arm) for your CI/CD server. If you'd like, we can discuss it further offline.
Can you link to the google paper on ACM you referenced please?
Hi Niall, my original paper (with footnoted reference) can be found here:
https://www.iar.com/knowledge/learn/code-quality/move-fast-and-break-things-not-so-fast-in-embedded/
Whats the benefit of "self hosted runner" over jenkins, or is it the same. We do the same with jenkins.
Hi Stefan, the simple (and perhaps overly simplistic) answer is that a self-hosted runner is a lighter-weight way to accomplish most CI processes. Jenkins typically requires more resources, but it also has far more plugins that allow you to customize your CI/CD process to your exact needs.
Thanks for clarifying docker vs vm. I have a better feel for the differences now.
Also, didn't know about self-hosted runner. Very interesting. We have a good deal of CI/CD implemented, but it looks like there's more we can do.
Yes, there are always, ALWAYS more things to learn...but to me, that's what makes being an embedded engineer fun and exciting!
Does anyone know if it's possible to access programs installed on the host system from a docker container?
I've seen a few ways to do it, but none of them are elegant. One way that I have bookmarked is this: https://zpz.github.io/blog/connect-to-localhost-from-container/
GitHub (now owned by Microsoft) and GitLab (GitLab Inc) are two different companies, who provide hosting for git repositories and build a product "around" this, like managing issues, pull requests, CI/CD etc.
Hi Gerhard, you are absolutely right - my mistake. Apologies for conflating the two!
Hi Shawn
Thanks for the interesting presentation. I also watched the Docker presentation of Akbar Dhanaliwala which is of course also related to CI/CD. In addtion to CI, he uses Docker also as a developer for building locally which is a very good argument to go this way. For me the question is how to debug such a system. Akbar states he only develops with open-source tools, such as GCC/GDB. However, in my opinion it is not convenient to debug a hardware system over JTAG with GDB commands. I very much prefer a GUI where I can see all local variables, the code, set breakpoints, etc. Is this possible with IAR or other commercial or open-source debuggers in Docker?
Best, Roman