GithubHelp home page GithubHelp logo

iarsystems / bx-docker Goto Github PK

View Code? Open in Web Editor NEW
42.0 8.0 6.0 133 KB

Build embedded applications with the IAR Build Tools on Docker Containers

Home Page: https://iar.com/bx

License: MIT License

Dockerfile 5.98% C 3.63% Shell 53.31% PowerShell 37.09%
docker linux ubuntu devops server ci continuous-integration risc-v riscv iar

bx-docker's People

Contributors

anderssjolund avatar felipe-iar avatar jonathangjertsen avatar sharpgeek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bx-docker's Issues

A new CI/CD friendly product line with new licenses and no cloud support?

I am sorry to be so pessimistic but I have reported this issue several times with very little follow-up. How does the bx* product line help anyone when the licensing models does not allow builds in the cloud?

As the readme states:

An IAR LMS2 License Server
    with activated license(s) for the product in the .deb package,
    reachable from the Linux machine.

This is not feasible in any cloud use case. Then the build is strictly local on owned machines the switch to linux has marginal benefits imo.

setup-license

Hi ,

environnement jenkins/docker

I have create a docker that contains IAR bxramfs compiler.
I have a network license.
I have no problem into the container when I use : lightlicensemanager setup -s myhost
but I try to setup the license in a docker volume like in the setup script.
I create a volume
I run/exec a container with lightlicensemanager setup -s myhost
I remove the container.
than I launch my jenkins pipeline that used the IAR docker image and add in argument -v LMS2:/usr/local/etc/IARSystems
the first time it works, but now I have an error message License already in use.
I check I have no other pipeline / docker image running.

How can I share the network license over several docker image ?
If I used lightlicensemanager setup in my container, and launch a new build , it failed because the license is not release.

thank you
Sohphie

Clarification between run and aliases-set

Problem

  • The run script displays a final message to source the aliases-set script using the ${CONTAINER_ID}.

Proposal

  • Provide explicit directions for sourcing the aliases-set script before moving to the section "Running the build tools".

useradd requires --no-log-init option in images/Dockerfile as a workaround for https://github.com/moby/moby/issues/5419

See: moby/moby#5419

Without useradd --no-log-init and while user has very large user id value (e.g. 200000000), the docker build will hang until all hard disk space on the host is consumed.

Here is a fix proposal:

diff --git a/images/Dockerfile b/images/Dockerfile
index 5053cb5..6bf059c 100644
--- a/images/Dockerfile
+++ b/images/Dockerfile
@@ -43,8 +43,9 @@ ENV IAR_BUILD_PATH="/build"
ENV PATH="${IAR_BX_PATH}/${BX_ARCH}/bin:${IAR_BX_PATH}/common/bin:$PATH" # Create the image with an user named iaruser using the same UID from the host's user
-# For convenience, the user iaruser will be added to the "sudo" group
-RUN useradd --create-home --uid ${USER_ID} iaruser &&
+# For convenience, the user iaruser will be added to the "sudo" group
+# --no-log-init is needed due: moby/moby#5419
+RUN useradd --no-log-init --create-home --uid ${USER_ID} iaruser &&
echo "iaruser:iaruser" | chpasswd &&
adduser iaruser sudo

LightLicenseManager does not show Network Licenses from a Windows Container

This issue started to be discussed in #20 by @ambativ.
Since it is a different topic, I moved the discussion to this specific issue.

Summary

The command LightLicenseManager nwlics returns an empty table when invoked from a Windows container as below:

PS C:\workspace\Embedded Workbench 9.0\common\bin> .\LightLicenseManager.exe nwlics
Product Ver Used Ch out Server Expires License Number
------- --- ---- ------ ------ ------- --------------

PowerShell build script string expansion error

New known issue when creating the image tag via string expansion in build.ps1:

PS C:\sandbox> .\bx-docker\build.ps1 C:\sandbox\bxarm\bxarm-9.32.1.deb
-- Building the Docker image for bxarm-9.32.1...
[+] Building 0.0s (0/0)
ERROR: invalid tag "iarsystems/bxarm\\:9.32.1": invalid reference format

Problem setting up bxarmfs-9.20.3.45671.deb on Ubuntu 20.04

When installing sudo in line with the bx*.deb, there are some corner cases in which our package gets installed before sudo setup is finished:

Setting up bxarmfs-9.20.3.45671 (9.20.3.45671) ...
sudo: unable to stat /etc/sudoers: No such file or directory
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
dpkg: error processing package bxarmfs-9.20.3.45671 (--configure):
 installed bxarmfs-9.20.3.45671 package post-installation script subprocess returned error exit status 1
Setting up sudo (1.8.31-1ubuntu1.4) ...

This happens because some post-installation scripts are using sudo for performing system-level changes. However, the package itself does not explicitly mark sudo as a pre-requisite package.

Future versions of the bxinstaller packages will have such sudo dependency removed [TOOL-336].

What are the external package dependencies for?

The Dockerfile has apt-get install sudo libxml2 libicu66 tzdata libsqlite3-0.

libicu66 is not available on Ubuntu 20.04 but has to be retrieved manually (Stackoverflow). It doesn't really seem to be needed though, I just removed it and that worked fine.
sudo seems to be required for the post-install script.

That leaves libxml2, tzdata and libsqlite3-0, it would be nice with some clarification on what these external packages are needed for.

Also note that the .deb should declare these dependencies in the control file (Depends and Build-Depends fields). This allows for the dependencies to be installed automatically when installing with apt. bxarm-9.10.2 actually does this for libsqlite3 but not any of the others.

iarbuild tries to create /.iar directory but it lacks permission; segmentation fault

Using IAR build tools 9.30.1 for ARM.

When I try to run 'iarbuild' (even without arguments), it prints nothing and just exits. What's happening is that it is trying to create a /.iar directory but can't because it is running as UID 1000, so it just segfaults.

gdb trace:

Reading symbols from /opt/iarsystems/bxarm/common/bin/iarbuild...
(No debugging symbols found in /opt/iarsystems/bxarm/common/bin/iarbuild)
(gdb) run
Starting program: /opt/iarsystems/bxarm-9.30.1/common/bin/iarbuild 
warning: Error disabling address space randomization: Operation not permitted
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007f9f2965d7e0 in IfPersistentStorage::operator IfPersistentStorageI&() const () from /opt/iarsystems/bxarm-9.30.1/common/bin/libIdeFrameworkX_shared.so
(gdb) bt
#0  0x00007f9f2965d7e0 in IfPersistentStorage::operator IfPersistentStorageI&() const () from /opt/iarsystems/bxarm-9.30.1/common/bin/libIdeFrameworkX_shared.so
#1  0x00007f9f29666e69 in If::TraceLog(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
   from /opt/iarsystems/bxarm-9.30.1/common/bin/libIdeFrameworkX_shared.so
#2  0x00007f9f29668f30 in If::ScopedLogTask::ScopedLogTask(char const*) () from /opt/iarsystems/bxarm-9.30.1/common/bin/libIdeFrameworkX_shared.so
#3  0x00007f9f29bd776a in PmiToolChainManager::Initialize() () from /opt/iarsystems/bxarm-9.30.1/common/bin/libProjectManagerEngine.so
#4  0x00007f9f29b47e35 in PmToolChainManager::Instance() () from /opt/iarsystems/bxarm-9.30.1/common/bin/libProjectManagerEngine.so
#5  0x000055b4e949e393 in wmain(int, wchar_t**, wchar_t**) ()
#6  0x000055b4e9497d63 in main ()

strace:

...
getrandom("\xa8\xde\xc9\x15", 4, 0)     = 4
getrandom("\x2b\xee\xf1\xbf", 4, 0)     = 4
getrandom("\xab\x91\xd4\x8a", 4, 0)     = 4
uname({sysname="Linux", nodename="laplante-lm-19", ...}) = 0
readlink("/proc/self/exe", "/opt/iarsystems/bxarm-9.30.1/com"..., 4096) = 48
stat("/.iar", 0x7ffcdd7a5820)           = -1 ENOENT (No such file or directory)
stat("/.iar", 0x7ffcdd7a57c0)           = -1 ENOENT (No such file or directory)
stat("/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
mkdir("/.iar", 0777)                    = -1 EACCES (Permission denied)
stat("/.iar", 0x7ffcdd7a56e0)           = -1 ENOENT (No such file or directory)
futex(0x7fa4c8b301e0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x8} ---
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)

I was able to fix it by doing docker exec -it <CONTAINER> bash and manually creating /.iar as root.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.