Home > On-Demand Archives > Q&A Sessions >

Live Q&A - Why Should I Care About CI/CD?

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

Live Q&A with Shawn Prestridge for the talk titled Why Should I Care About CI/CD?
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 | 4 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 | 4 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 | 4 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!

15:40:48	 From  Leandro Pérez : Hello Shawn from Colombia
15:40:52	 From  Leandro Pérez : It was a good talk... I need see it to 2X speed but I understand all... I knew CI/CD in the software world, but is a new concept for me in embedded field.. I will try to implement your laboratory in a new project... I have a question... I know a static code analyzer quality tool called SonarQube, to analize the quality in code like Java or Node.js... What tool apply to embedded systems in C specifically?
15:44:57	 From  Jose E. : Is CI/CD more successful on bigger or smaller teams?
15:45:23	 From  Tom Davies : In the example given in the presentation, would the developer then not run unit tests locally before committing and pushing the code up or would there typically be different tests running at each stage?
15:46:31	 From  Leandro Pérez : I have another question... Do you know a CD/CI workflow what use Serverless technologies? Because have a VM 24/7 cost much that upload a Docker container only when a commit is make?
15:46:52	 From  Gopinath : We are a small team where each one of us builds code on our own local PCs. Do we need to have a common build machine in order to deploy CI / CD?
15:47:05	 From  enrico : What is a recommended simple CI/CD server to start with ? Jenkins can be complex with all the customization and plugins.
15:47:13	 From  Gopinath : For development builds, that is.
15:47:51	 From  JackW : My team is small (three developers) and we use a jenkins CI server for running unit tests and production builds. I find it a bit difficult to maintain all of our jobs.
Do you have any recommendations for really easy to use CI systems?
15:48:59	 From  Michael Kirkhart : "People with targets and jobs dependent upon meeting them will probably meet the targets - even if they have to destroy the enterprise to do it." W. Edwards Deming

15:50:38	 From  karosuo : Thanks Michael.
15:50:48	 From  JackW : @Gopinath the self hosted runner in the video appeared to be running on the developers machine.
15:51:19	 From  JackW : Shawn, For the purposes of archiving build environment, would you recommend archiving entire docker images or using a version number of a dockerfile?
15:51:41	 From  Jeremy Overesch : clang-tidy is a good tool for static analysis as well.
15:52:33	 From  Michael Kirkhart : https://clang.llvm.org/extra/clang-tidy/
15:52:45	 From  karosuo : cpp-check static analysis, have been enough for my small projects (more for learning than for industry)
15:52:53	 From  Tim Michals : Sorry I missed the talk, I have you used QEMU to do embedded CI/CD testing?
15:54:08	 From  Leandro Pérez : Thanks @Shawn
15:56:36	 From  Michael Kirkhart : Link to aforementioned Dilbert comic on "bug bounties": https://dilbert.com/strip/1995-11-13
15:57:53	 From  Leandro Pérez : lol @Michael
15:58:25	 From  Paul : @JackW look into pipelines since they body of the job resides in the repository
15:58:44	 From  Jeremy Overesch : That was the exact question I was going to ask.
16:00:04	 From  Gopinath : Thanks, @Shawn. Excellent presentation.
16:01:22	 From  Tom Davies : Thank you Shawn, great presentation
16:01:32	 From  Gerhard : Thanks!
16:01:33	 From  karosuo : Thank you Shawn.
16:01:45	 From  Leandro Pérez : Thnaks Shawn! A new approach
16:01:50	 From  Vim : thanks shawn!
16:01:58	 From  JackW : Thanks!
16:02:01	 From  Sam : thx

OUR SPONSORS

OUR PARTNERS