Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AS Docker Buildcontainer planned? #1

Open
zeehans opened this issue Sep 13, 2023 · 13 comments
Open

AS Docker Buildcontainer planned? #1

zeehans opened this issue Sep 13, 2023 · 13 comments

Comments

@zeehans
Copy link

zeehans commented Sep 13, 2023

For our CI pipelines it would be really useful to be able to use Docker containers to build and deploy PLC images (in our case RUC and PIPs). Right now we use a shell executor that uses the BR command line tooling to sequentially build our deploy images however it would be really nice to be able to parallelise this process. We are building about 15 different configurations and it takes quite a while to build. If we were able to build each configuration in an isolated container we could easly parallelise this process. We tried pulling relevant tools and dependencies into a Docker Windows container but never got it to build. Surely we are missing some steps here. Is it possible to get instructions as to how to build such a container, preferably a Dockerfile?

@knetsooj
Copy link

We have the same question/ challenge. In the presentation 'Automation & Build Server' slide 35 there is also mentioned that B&R uses a docker container on their Jenkins server

@langstonb
Copy link
Contributor

Hi @zeehans - thank you for the suggestion, it is a good one. As @knetsooj mentioned, we do indeed have docker containers set up on our internal server. Therefore, we will add some explanation into the PPT for how you can set this up on your side. We will also add our docker file to the template files. We plan to have this information added by the end of October.

@zeehans
Copy link
Author

zeehans commented Sep 18, 2023

@langstonb that's great. Please post an update in this issue when you have added that info.

wesleybuchanan added a commit that referenced this issue Oct 27, 2023
add dockerfile for installing Automation Studio and the jenkins agent.
wesleybuchanan added a commit that referenced this issue Oct 27, 2023
…docker container running Automation Studio
@wesleybuchanan
Copy link
Collaborator

@zeehans @knetsooj, I've just committed the Dockerfile and added instructions to the presentation for creating a Jenkins node and creating the docker container installing Automation Studio and the Jenkins agent.

@zeehans
Copy link
Author

zeehans commented Oct 30, 2023

@wesleybuchanan that's great. We'll try that out shortly.

@zeehans zeehans closed this as completed Oct 30, 2023
@zeehans
Copy link
Author

zeehans commented Nov 29, 2023

@wesleybuchanan we tried building the Docker image using your Dockerfile but are getting stuck at importing the fieldbus devices. I believe that's how far we got the first time around last year as well with our own dockerfile. When we attempt a build of a project using a CP1585 PLC for instances we get the following error messages:

C:\source.plc\Micro\Physical\CP1585_1\Hardware.hw: (Ln: 637, Col: 33) error 4821:Support for hardware module type FBE.0000001D_CPX_FB40 is not available. Please install the corresponding upgrade. C:\source.plc\Micro\Physical\CP1585_1\Hardware.hw: (Ln: 637, Col: 62) warning 4821:Required version '1.0' for hardware module 'FBE.0000001D_CPX_FB40' is not installed currently. Please install the corresponding upgrade. C:\source.plc\Micro\Physical\CP1585_1\Hardware.hw: (Ln: 690, Col: 45) error 4821:Support for hardware module type FBE.00000230_UR20_8DI_P_2W is not available. Please install the corresponding upgrade. C:\source.plc\Micro\Physical\CP1585_1\Hardware.hw: (Ln: 690, Col: 79) warning 4821:Required version '1.0' for hardware module 'FBE.00000230_UR20_8DI_P_2W' is not installed currently. Please install the corresponding upgrade.

On a regular installation of AS the fieldbus dependencies would just be requested to be installed upon opening a project file. Unfortunately we can't seem to run AS out of the container - it just crashes. Can the fieldbus module files simply be copied across from a bare-metal installation or is there another way to install them without going through the UI?

@zeehans zeehans reopened this Nov 29, 2023
@wesleybuchanan
Copy link
Collaborator

Hi @zeehans ,

If you place the needed upgrades into the AS_Upgrades directory before creating the docker container then they should be installed after Automation Studio is installed. Specifically the lines 94 - 101 of the docker file handle this.

If there are upgrades that need to be installed after the container has been created you could mount a volume into the container and run the commands.

To mount a volume in docker first stop your container
docker stop as_412
then run it with the -v to specify a volume.
docker run -v /C/AS_Upgrades:/C/Temp/AS_Upgrades as_412
Then open a powershell command prompt on the container
docker exec -it as_412 powershell
Then run the following command in powershell
C:\Temp\AS_Upgrade.exe -G='C:\BrAutomation' -V='C:\BrAutomation\AS412' -R | Out-Null;
where AS_Upgrade.exe is the upgrade file that you want to install

Once the install is finished you can exit or install additional upgrades.

@zeehans
Copy link
Author

zeehans commented Nov 30, 2023

@wesleybuchanan in this case it's about third party device description files (extension .xdd). For example the file FBE.0000001D_CPX_FB40 refers to a FESTO Powerlink compatible bus node. These are xml files that are imported via the 3rd Party Device Manager. Is it possible to simply mount the corresponding folder into the container from a bare-metal AS installation?

@JobFranken
Copy link

@zeehans Please check the contents of the "C:\ProgramData\BR\AS412\Hardware\Modules" of your local installation. You should see the 3e party FBE.0000001D_CPX_FB40 subfolder. When you copy this to the docker installation it should build correctly.

@wesleybuchanan
Copy link
Collaborator

@zeehans can you confirm that copying the FBE.0000001D_CPX_FB40 folder into your docker container allowed you to build your project succesfully?

We plan on updating the package with this information shortly.

@zeehans
Copy link
Author

zeehans commented Jan 11, 2024

@wesleybuchanan we haven't got around to trying that yet. My colleague who is tasked with building the docker image is still on leave at the moment. I'll let you know as soon as I know more.

@zeehans
Copy link
Author

zeehans commented Jan 12, 2024

@wesleybuchanan my colleague got around to testing your suggestion. We can build the docker image now and the error messages relating to the description files disappear but when we try to compile a configuration, the build just hangs after a while and never completes.

In the container we build a configuration using the following commands:

  • BR.AS.Build.exe C:\source.plc\Micro\Micro.apj -cleanAll
  • BR.AS.Build.exe C:\source.plc\Micro\Micro.apj -c CP1585_1 -all -o C:\build -buildMode "Build" -buildRUCPackage

As base images we tried:

  • mcr.microsoft.com/dotnet/framework/runtime:3.5-windowsservercore-ltsc2019
  • mcr.microsoft.com/dotnet/framework/runtime:3.5-windowsservercore-ltsc2022

We built container images using AS Versions 4.11 and 4.12. The behaviour described above occurs in all build setups and the build hangs here:

Generating BR-Module "Visu.br" ...

I attached two build logs:

  • log-shell.txt shows the output of a successful build executing the build from a regular bare metal installation of AS in powershell
  • log-container.txt shows the output of attempting the build in the container

We'd be grateful if you could provide some help as to how to proceed.

log-container.txt
log-shell.txt

@Zoornwork

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants