Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Docker alpine Image - Forte & OPC UA - compiling errrors(I'm creating a Docker alpine image with Forte & OPC UA; however, I get Forte compiling errors)
Docker alpine Image - Forte & OPC UA - compiling errrors [message #1791465] Fri, 29 June 2018 20:16 Go to next message
Franklin Amador is currently offline Franklin AmadorFriend
Messages: 7
Registered: June 2018
Junior Member
Dear 4diac community,

I'm in need of running forte with OPC UA. I have created my Docker image build file (Dockerfile_alpine) as you can see from the Error.Log, there are several warnings, but the final error seems to be related to the following;

make[1]: *** [CMakeFiles/Makefile2:138: src/CMakeFiles/forte.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

This could be the result of using cmake directly as oppose to using the setup_posix.sh file. However, when I use the setup_posix.sh file. I receive the following error:

make: *** No targets specified and no makefile found. Stop.

Note: this Docker image is going to be publicly release for the community with future improvements on other communication protocols (MODBUS/MQTT).

Any help would greatly be appreciated. Thanks!

Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1791583 is a reply to message #1791465] Mon, 02 July 2018 15:47 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Hi,

the causing error is shown in line 818 of your log file. What compiler are you using. What is the target platform for your docker image. On recent pthread libraries you a recursive mutix should be available.

Cheers,
Alois

P.S.: We are working on getting rid of the ocndition sync. hopefully this will happen soon.
Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1791594 is a reply to message #1791583] Mon, 02 July 2018 16:52 Go to previous messageGo to next message
Franklin Amador is currently offline Franklin AmadorFriend
Messages: 7
Registered: June 2018
Junior Member
Thank you for your help,

Looks like during installation gnu gcc (6.4.0-r5) and gnu g++ (6.4.0-r5) is being installed. I checked the packages for pthread.c/h files and they are part of the musl-dev package (x86_64 arch).

I'm running Docker on Windows 10 (amd64) computer in linux container mode and my docker image is Apline:latest. I will try different images other than amd64/alpine for different results. Once fully installed and without errors, I plan remove all the dev packages to maintain a lean and clean alpine linux image hopefully less than 30MB!

Could the problem be that I'm trying to compile forte on a 64bit machine instead of 16/32 bit?

Regards,
Franklin
Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1791600 is a reply to message #1791594] Mon, 02 July 2018 17:15 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Hi,

My main development machines are a Debian 64bit and a Win10 64 bit machine. There I'm testing also forte. So I don't think it is a 64 bit issue. I think the problem is in the musl-dev library. For testing and until we got rid of the ConditionSynch I would try libc6-dev.

Alois
Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1792325 is a reply to message #1791600] Mon, 16 July 2018 07:20 Go to previous messageGo to next message
Franklin Amador is currently offline Franklin AmadorFriend
Messages: 7
Registered: June 2018
Junior Member
Ok, So I finally was able to compile forte on Alipine Linux @ 35MB! with the standard libraries (musl-dev).

In my investigation, I created an ubuntu and debian image and they installed just fine. After dealing with the libraries, I finally edited the following command line in your ConditionSynch.cpp line 30 code:

from:pthread_mutexattr_settype(&mutexAttr, PTHREAD_MUTEX_RECURSIVE_NP);
to: pthread_mutexattr_settype(&mutexAttr, PTHREAD_MUTEX_RECURSIVE);

Not sure why _Cygwin_ would only need the correct datatype as oppose to the rest of the system. Please advise if this is safe to do!!!

My final output for running my new container from the created image is as follows: See Attached Image

Here is my new Dockefile: See attached File.

NOTE: The copied forte directory has the /src/posix/arch/conditionSynch.cpp file modified as above.

Regards,
Franklin
Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1792330 is a reply to message #1792325] Mon, 16 July 2018 07:57 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

As pointed out in my last post this file will go and if you switch your docker file to the develop branch the conditionSynch.cpp has already be removed. In your setting it was anyhow not used. So any changes are save for you to test.
Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1792381 is a reply to message #1792330] Mon, 16 July 2018 16:55 Go to previous messageGo to next message
Franklin Amador is currently offline Franklin AmadorFriend
Messages: 7
Registered: June 2018
Junior Member
I appreciate your input and will use the develop branch for compiling and testing.

I'll post all my work in github then try to create an Alpine forte image (35MB) with OPC UA (9MB), Modbus (4MB) and MQTT (?MB) already preconfigured. I won't be able to install OPC DA since this is a linux image. Also, I'm not sure I want to install FBDK (default protocol) as it will push the image to over 200MBs with Java JDK, but people are more than welcome to create their own images.

To summarize, my goal is for this image to be small enough to run in embedded devices already capable of running docker ce, but without the overhead of needing to compile forte.

Regards,
Franklin

[Updated on: Mon, 16 July 2018 16:56]

Report message to a moderator

Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1792428 is a reply to message #1792381] Tue, 17 July 2018 17:06 Go to previous messageGo to next message
Franklin Amador is currently offline Franklin AmadorFriend
Messages: 7
Registered: June 2018
Junior Member
As promised, here is the new Dockerfile for Forte (develop). It has OPC UA, MODBUS and MQTT compiled and installed @ 50MB. Small embedded linux machines with Docker ce should be able to run this.

After running the container, forte should run immediately.

I would appreciate if you can tell me if the forte's cmake parameters look good.

Thanks!

[Updated on: Tue, 17 July 2018 17:10]

Report message to a moderator

Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1799807 is a reply to message #1791465] Fri, 14 December 2018 00:47 Go to previous messageGo to next message
Franklin Amador is currently offline Franklin AmadorFriend
Messages: 7
Registered: June 2018
Junior Member
I've come back to update the forte's Dockerfile but with the 1.10.0, develop and master branches I get the attached error compile logs regarding:

1) opcua_layer.cpp
2) opcua_handler.cpp
3) opcua_client_handler.cpp

I'm still using the version 3 of open62541.

The only noticeable changes are the 1) alpine openssl-dev package naming and 2) the move of the open62541.h file from /usr/local/include/open62541 to /usr/local/include.

Can you investigate and see what is wrong?

Note: the original Docker Image can still be pulled and deployed using the following command.

docker pull fdamador/forte:alpine

Thanks, F

[Updated on: Fri, 14 December 2018 00:49]

Report message to a moderator

Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1799829 is a reply to message #1799807] Fri, 14 December 2018 10:12 Go to previous messageGo to next message
Kirill Dorofeev is currently offline Kirill DorofeevFriend
Messages: 70
Registered: February 2016
Member
Hi

/forte/src/modules/opc_ua/opcua_client_handler.cpp:102:54: error: 'UA_Client_run_iterate' was not declared in this scope
             UA_Client_run_iterate((*iter)->client, 10);

UA_Client_run_iterate() is function from open62541 master. If you use 0.3 you should use UA_Client_runAsync()
Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1799944 is a reply to message #1799829] Mon, 17 December 2018 19:05 Go to previous messageGo to next message
Franklin Amador is currently offline Franklin AmadorFriend
Messages: 7
Registered: June 2018
Junior Member
This will sound silly, but where in compilation time do I force that?

I thought that this was IDE editable feature to run an OPC Client in Asynch mode or Synch mode.

Thanks,
Franklin
Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1800072 is a reply to message #1799944] Wed, 19 December 2018 15:03 Go to previous message
Kirill Dorofeev is currently offline Kirill DorofeevFriend
Messages: 70
Registered: February 2016
Member
This is not related to the opc ua client mode. Actually both functions start a client in a separate thread. To compile it, you could either use 0.3-rc4 version of the open62541 stack (so you need to recompile your open stack lib) or if you need to stay with the master branch version you can go to your opcua_client_handler.cpp:102:54 and manually change UA_Client_run_iterate() to UA_Client_runAsync()
Hope this helps
Kirill
Previous Topic:ECC algorithm and deploy
Next Topic:Export lua basic function block failed
Goto Forum:
  


Current Time: Thu Apr 25 11:02:14 GMT 2024

Powered by FUDForum. Page generated in 0.03964 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top