Home > On-Demand Archives > Talks >

Why Should I Care About CI/CD?

Shawn Prestridge - Watch Now - EOC 2021 - Duration: 41:20

Continuous Integration and Continuous Deployment (CI/CD) are all the rage today…but what does it actually mean and what can it really do for you? In this session, we’re going to talk about how it differs from traditional embedded development and what advantages CI/CD can give you, all backed up by research. We will show you how it can easily help you improve code quality and why, helping you to foreshorten your time-to-market. We’ll also tell you who all the major players are in CI/CD and finish the session by showing you how you can quickly get into the CI/CD game!
M↓ MARKDOWN HELP
italicssurround text with
*asterisks*
boldsurround text with
**two asterisks**
hyperlink
[hyperlink](https://example.com)
or just a bare URL
code
surround text with
`backticks`
strikethroughsurround text with
~~two tilde characters~~
quote
prefix with
>

Roman
Score: 1 | 3 years ago | 1 reply

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

ShawnSpeaker
Score: 0 | 3 years ago | 1 reply

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!

Roman
Score: 0 | 3 years ago | 1 reply

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.

ShawnSpeaker
Score: 0 | 3 years ago | no reply

Stay tuned. 8-)

SimonSmith
Score: 0 | 3 years ago | 1 reply

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?

ShawnSpeaker
Score: 0 | 3 years ago | 1 reply

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.

SimonSmith
Score: 0 | 3 years ago | no reply

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.

Kevin.Kramb
Score: 0 | 4 years ago | 1 reply

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?

ShawnSpeaker
Score: 0 | 4 years ago | no reply

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.

Niall
Score: 0 | 4 years ago | 1 reply

Can you link to the google paper on ACM you referenced please?

ShawnSpeaker
Score: 1 | 4 years ago | no reply

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/

d.stefan
Score: 0 | 4 years ago | 1 reply

Whats the benefit of "self hosted runner" over jenkins, or is it the same. We do the same with jenkins.

ShawnSpeaker
Score: 1 | 4 years ago | no reply

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.

mgaron
Score: 0 | 4 years ago | 1 reply

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.

ShawnSpeaker
Score: 0 | 4 years ago | no reply

Yes, there are always, ALWAYS more things to learn...but to me, that's what makes being an embedded engineer fun and exciting!

Cleo
Score: 0 | 4 years ago | 1 reply

Does anyone know if it's possible to access programs installed on the host system from a docker container?

ShawnSpeaker
Score: 0 | 4 years ago | no reply

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/

Gerhard
Score: 2 | 4 years ago | 1 reply

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.

ShawnSpeaker
Score: 0 | 4 years ago | no reply

Hi Gerhard, you are absolutely right - my mistake. Apologies for conflating the two!

OUR SPONSORS

OUR PARTNERS