From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI Linux Real-Time Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Installing Docker on a cRIO-903X

Overview

 

This document is intended to help the user install Docker (Refer to the webpage: What is Docker? for more information), on an x86_64 cRIO. 

 

Disclaimer:

Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at http://ni.com/samplecodelicense.

 

Description

 

The following guide provides instructions on the necessary steps for installing Docker on a cRIO-903X. However, the process is currently not officially supported by National Instruments, since it requires to modify the NI Linux Real-Time Kernel.  

 

So far Docker has been installed in a cRIO-9033 and a cRIO-9035. Only basic functionality has been tested and we are not sure it will affect the functionality of existing drivers or software. No issues have been found so far.

 

Hardware and Software Requirements

 

cRIO-903X

Ubuntu 14.04 LTS PC or similar.

NI CompactRIO 17.0 May 2017

 

Steps to Implement or Execute Code

 

This is a long process and for simplicity, it was compiled in the pdf document attached.

 

Additional Information or References

 

For building the kernel you can use the following documents as reference:

NI Linux Real-Time Kernel cdlsSource README. This document explains the process for building the kernel version 15.0/3.14 for an ARM-based system.

Working with the Linux Kernel on NI LabVIEW RT targets - Exercise 1. In this forum post, you can find a video detailing the kernel building process with default configuration. It is a great resource for users that want to understand which one is being done in all the steps.

Note: The previous documents were used as a guide for building the kernel version 17.0/4.6.

 

If you have questions, please do not hesitate in making a post.

 

Important Files attached

 

Randy @Rscd27@
Comments
stalemate
Member
Member
on

Could it affect the real-time capabilities of cRIO?

Rscd27
Active Participant
Active Participant
on

Hello Stalemate, 

 

We are not sure. We have not run benchmarks.

Randy @Rscd27@
AndyLeonard
Member
Member
on

Hi Randy (@Rscd27) 

 

a couple years into the future, I am attempting this. This guide is great and well documented, thank you. I could follow though well enough, and now I'm up to the stage of running docker. 

 

I'm running into some more general linux RT memory issues and thought that you may be able to help (maybe)

 

Some differences in my setup:

Running on cRIO 9053

NI CompactRIO 19.0

 

successfully compiled my kernel for nilrt/19.0/4.14 branch and meet the same requirements that you have listed in your screengrabs (with the same "missing" components also). 

 

Whilst docker can run fine, the container that I'm planning to install pretty sure is only supported by a newer version of docker. 

I have downloaded the latest stable version of docker (19.03.9) from x86_64 binaries, and un-tared them into the /sbin directory on the cRIO. 

 

When the docker daemon is running I attempt to run the hello-world container as outlined in the docker install steps under install static binaries (https://docs.docker.com/engine/install/binaries/#install-daemon-and-client-binaries-on-linux), as well as attempting the install script of the container that I'm after, and it always fails right when it tries to untar the downloaded container file. Always hits a memory error, specifically:

 

Attempting next endpoint for pull after error: failed to register layer: Error processing tar file(exit status 2): fatal error: out of memory allocating heap arena map

 

I've had a quick look at the memory status (using free -m), and getting the following:

Mem: Total: 879 used: 823 Free: 56

(without the docker daemon running I have about 82 MB free). 

When using top I can see that most of the hungriest memory processes are (top for some reason doesn't show memory usage on nirt linux):

  1. niroco
  2. NIWebServiceContainer
  3. niDAQmxRemoteService
  4. {MainAppThread} ./lvrt
  5. usr/local/natinst/bin/tagsrv -start
  6. /usr/local/natinst/share/mxs64/nimxs -d

etc. I have attached a screengrab. 

Interestingly, via the cRIO webpage the memory usage is way different. on the webpage (silverlight), I get the following:

Total physical Memory: 879 MB

Free physical Memory: 576 MB

Total Virtual Memory: 809 MB

Free Virtual Memory: 473 MB

 

Currently the RT Startup App is disabled, so that shouldn't be using any memory. 

Is the labview runtime engine basically taking up/bookmarking a lot of memory, so it's available (and free) via labview, but not free to the underlying linux OS?

 

Why is there such a discrepancy between what's reported via linux and what's reported by the cRIO webpage. Is there a way to adjust the allocation?

 

Let me know if this isn't the right location, or some other resources you could point me to?

 

Many thanks in advance. 

-Andy

 

top memory usage. Sorted by memory use (descending)top memory usage. Sorted by memory use (descending)

Rscd27
Active Participant
Active Participant
on

Hi AndyLeonard,

 

There is a known issue with the memory reporting on Linux RT OS. You should trust the information that you get out of the "free" command. The information that you get out of the system configuration API, which is what is used by MAX, the Distributed System Manager, and the Web Configuration page use on the background, is not able report a proper memory value. Please refer to this KB: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P9usSAC&l=en-US

Randy @Rscd27@
Contributors