VxWorks

Adding VxWorks-7 Containers Support

by | Jun 10, 2021 | VxWorks

1 Introduction

Containers are a way for you to package up an application that is isolated from the rest of the system, and easily portable and shareable between different VxWorks target boards. VxWorks Container support is OCI compliant.

VxWorks is a Real Time Operating System built by Wind River. This blog describes how to configure VxWorks with Container support, and deploy a container to the VxWorks ROMFS file system. While remote container management is supported, this blog does not show how to deploy and retrieve containers from Docker Hub, Amazon, or Harbor. This is covered in another blog.

 

2 Prerequisites

These instructions assume that you are using:

An Intel x86 target that is:
– networked
– configured to boot VxWorks

A Windows workstation with the following installed on it:
– Wind River VxWorks 7, SR21.03

They also assume you have configured your workstation with the buildah utility. This is used to build OCI compliant containers. For details, refer to the VxWorks Container Programmer’s Guide, Configure the Build Workstation for Containers.

 

3 Related Documentation

For more information on these topics, refer to:

Wind River documentation:
VxWorks Container Programmer’s Guide

 

4 Prepare the Containers Enabled VxWorks Projects

4.1 Create and Build the Containers VxWorks Source Build (VSB) Project

Open a Windows command shell, configure the build environment, and then add the Containers libraries to a newly created VxWorks source build (VSB) project:

cd <WIND_HOME>                  // your installation directory
wrenv -p vxworks\21.03 C:\Windows\sysnative\cmd.exe
cd <YOUR_WORKSPACE>             // your workspace
vxprj vsb create -S -bsp itl_generic -smp -lp64 containersVSB
cd containersVSB                // your VSB directory
                                // add the Containers runtime
vxprj vsb layer add CONTAINER_RUNTIME 
                                // add the Containers manager
vxprj vsb layer add CONTAINER_MANAGER      
                                // add the Containers Examples
vxprj vsb layer add PYTHON 
vxprj vsb layer add CONTAINER_EXAMPLES
vxprj vsb config -s -add _WRS_CONFIG_CONTAINER_PYTHON_WEB_SERVER=y 

                                // Build the VSB
make -j 16
cd ..       

4.2 Create and Build the Containers VxWorks Image Project (VIP)

Create the VxWorks image project (VIP) as follows:

vxprj vip create -vsb containersVSB itl_generic llvm -profile PROFILE_DEVELOPMENT containersVIP
cd containersVIP

// enable VIP container components
vxprj vip component add INCLUDE_CONTAINER_RUNTIME INCLUDE_CONTAINER_SHELL_CMD
vxprj vip component add INCLUDE_DISK_UTIL INCLUDE_RAM_DISK
vxprj parameter set RAM_DISK_SIZE 0x4000000

// enable PYTHON and ROMFS
vxprj component add INCLUDE_PYTHON_SUPPORT INCLUDE_ROMFS
mkdir romfs

4.3 Copy Example Container to the VIP

robocopy /s ..\containersVSB\usr\containers\web_server romfs

4.4 Build the VIP

vxprj build


5
Run the Example VxWorks Container

5.1 Boot a target with the VIP vxWorks image file

Deploy the VxWorks kernel image you just built to your target in the normal way. Boot VxWorks on the target.

5.2 Identify the target network IP address

From the VxWorks kernel shell:

-> ifconfig
.
.
.
gei0      Link type:Ethernet HWaddr 7a:7a:9a:00:00:02
          inet 10.0.10.2 mask 255.255.255.0 broadcast 10.0.10.3
.
.
.

value = 0 = 0x0
->

5.3 Unpack and Run the Web Server VxWorks container

From the VxWorks kernel shell:

-> cmd
[vxWorks *]# vxc unpack --image /romfs/web_server.oci /ram0/bundle
[vxWorks *]# vxc run --detach --bundle /ram0/bundle web_server
Starting server using port 8888

5.4 Open a Web Browser from your Workstation to Verify Example Container is Running

Assuming a target ip address of 10.0.10.2, navigate in your browser bar to http://10.0.10.2:8888 and view the example Wind River web page displayed in your browser.

Download Our VxWorks Cheat Sheet

Download our VxWorks Cheat Sheet; a handy little tool to improve your workflow.

Got A Project In Mind?

Our levels of professionalism and commitment to our clients results in a long waiting list for projects. Let us know in advance if you might need us.