Welcome to the forums. Please post in English or French.

You are not logged in.

#1 2018-05-31 23:07:36

tianyikillua
Member
From: Paris
Registered: 2017-11-06
Posts: 69

Code_Aster inside a Docker container available for everyone

Using Docker you can directly use Code_Aster on virtually any platform (Linux, Mac, Windows, ...) and WITHOUT having to compile yourself the whole package. I've read some posts but I forget why Code_Aster is not (yet) distributed using something like Docker.

I provide here the Docker images that can be downloaded from https://quay.io/user/tianyikillua by anyone. The parallel version (of the latest stable version) works out-of-the-box (using the quay.io/tianyikillua/code_aster image)

Anyway the work is still in progress, but two versions of Code_Aster are now available for use :

1. the latest version of salome_meca (only sequential) (maybe less useful than the following image)

To download (~ 8 GB, -_-):

docker pull quay.io/tianyikillua/salome_meca

2. GCC-based build of the latest stable version (sequential AND parallel)

To download (~ 4 GB):

docker pull quay.io/tianyikillua/code_aster

The source codes (Dockerfiles) that generate these images, and some documentation, are on Github

https://github.com/tianyikillua/code_aster_on_docker

Any contributions are welcome.

Work to be done

1. Provide also the latest development version (sequential and MPI)
2. Report testcases qualification results
3. Report performance results

Offline

#2 2018-06-01 12:16:10

mathieu.courtois
Administrator
From: France
Registered: 2007-11-21
Posts: 1,183

Re: Code_Aster inside a Docker container available for everyone

Great! Thank you for this contribution.

I hope that it helps some users to test the parallel version.

MC


Code_Aster release : last unstable on Ubuntu 16.04 64 bits - GNU Compilers

Please do not forget to tag your first post as *SOLVED* when it is!

Offline

#3 2018-06-03 15:25:32

Thomas DE SOZA
Guru
From: EDF
Registered: 2007-11-23
Posts: 3,066

Re: Code_Aster inside a Docker container available for everyone

Congratulations for this great work!

TdS

PS : I've edited the post to highlight the links and the command lines.

Offline

#4 2018-06-06 18:21:49

tianyikillua
Member
From: Paris
Registered: 2017-11-06
Posts: 69

Re: Code_Aster inside a Docker container available for everyone

Good news. Now the parallel version also works with PETSc, and MUMPS are compiled against ParMETIS and ptscotch (by default it's not).

I'll run the testcases with the parallel version and report results again on the Github page. Apparently PETSc works fine!

Tianyi

Offline

#5 2018-06-08 15:05:35

tianyikillua
Member
From: Paris
Registered: 2017-11-06
Posts: 69

Re: Code_Aster inside a Docker container available for everyone

The following performance (strong scaling) results are obtained with the parallel version, under Windows

41157663-dfb66bc8-6b26-11e8-8706-98c186812d71.png

41162091-2b9c7506-6b35-11e8-9808-d02c99358ff7.png

As indicated on the Github page, since back-end virtualization may still be used by Docker under Mac and Windows, performance should be better under a native Linux environment using Docker.

Offline

#6 2018-06-09 07:11:48

Ioannis
Member
Registered: 2016-04-01
Posts: 67

Re: Code_Aster inside a Docker container available for everyone

Excellent piece of work!
Thanks for this contribution!


Aether Engineering
- aethereng.com -

Offline

#7 2018-06-27 22:36:24

MateoMartinez123
Member
Registered: 2018-01-12
Posts: 17

Re: Code_Aster inside a Docker container available for everyone

Hi,

I was wondering if there is any chance to use python modules (like pandas or numpy) in the Docker container,

Thank you so much!

regards

Offline

#8 2018-06-28 12:36:58

tianyikillua
Member
From: Paris
Registered: 2017-11-06
Posts: 69

Re: Code_Aster inside a Docker container available for everyone

Hi,

Yes you can either install pandas by running

sudo apt-get update
sudo apt-get install python-pandas

Note that numpy is already installed.

Otherwise you can create your own Docker image based on this one, and install the needed packages. A sample Dockerfile

FROM quay.io/tianyikillua/code_aster:latest
USER root

RUN apt-get update && \
    apt-get upgrade -y --with-new-pkgs -o Dpkg::Options::="--force-confold" && \
    apt-get install -y \
    python-pandas && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

USER root

And then build this image

docker build -t code_aster_with_pandas:latest .

Last edited by tianyikillua (2018-06-28 16:00:25)

Offline

#9 2018-06-28 19:00:11

MateoMartinez123
Member
Registered: 2018-01-12
Posts: 17

Re: Code_Aster inside a Docker container available for everyone

Thank you! that works. I have another question, I am trying to run a export document by using the command "as_run --vers stable_mpi export", and it runs but my computer seems to use only 1 processor, at firts I thought that my export file was wrong and I need to include how many processor I want to use, like this:
P mpi_nbcpu 2
P mpi_nbnoeud 2
but when I try to execute it, I got this:
<F>_INVALID_PARAMETER /home/aster/aster/13.4/share/aster is not a MPI version of Code_Aster. The number of nodes/processors must be equal to 1.

What am I doing wrong?

thank you so much,

Regards

Offline

#10 2018-06-29 08:35:10

tianyikillua
Member
From: Paris
Registered: 2017-11-06
Posts: 69

Re: Code_Aster inside a Docker container available for everyone

To your 1st question, make sure that you allocate enough CPU to your Docker environment. You can go to the settings and allocate the number of CPU's you want to have in your Docker containers.

To your 2nd question, you need to add

P version stable_mpi

in your export file.

Offline

#11 2018-06-29 09:45:12

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 4,049

Re: Code_Aster inside a Docker container available for everyone

hello

i had like to have a try
but what do i do to overcome this issue

~> docker pull quay.io/tianyikillua/code_aster
Using default tag: latest
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

jean pierre aubry


consider reading my book
freely available here https://framabook.org/beginning-with-code_aster/

Offline

#12 2018-06-29 09:51:05

tianyikillua
Member
From: Paris
Registered: 2017-11-06
Posts: 69

Re: Code_Aster inside a Docker container available for everyone

Hi Jean Pierre,

Please refer to, for instance, these two discussions :

https://stackoverflow.com/questions/446 … the-docker

https://stackoverflow.com/questions/494 … -sock-is-t

I'm not sure, but you may need to have sudo privileges in order to use Docker. I intended once to use Docker on a Calibre machine when I was at EDF but then I abandonned for a reason I don't recall now.

Offline

#13 2018-06-29 10:17:12

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 4,049

Re: Code_Aster inside a Docker container available for everyone

one answer at
https://stackoverflow.com/questions/446 … the-docker
looks like doing the job

service docker stop
cd /var/run/docker/libcontainerd
rm -rf containerd/*
rm -f docker-containerd.pid
service docker start

it is downlaoding now on


consider reading my book
freely available here https://framabook.org/beginning-with-code_aster/

Offline

#14 2018-06-29 10:46:17

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 4,049

Re: Code_Aster inside a Docker container available for everyone

next question
downloading looks like being successful

Status: Downloaded newer image for quay.io/tianyikillua/code_aster:latest

where are all the code_aster files so i can a have a try ?
or
what do i have to do now ?

Last edited by jeanpierreaubry (2018-06-29 10:49:58)


consider reading my book
freely available here https://framabook.org/beginning-with-code_aster/

Offline

#15 2018-06-29 11:02:56

tianyikillua
Member
From: Paris
Registered: 2017-11-06
Posts: 69

Re: Code_Aster inside a Docker container available for everyone

you may follow the steps indicated at https://github.com/tianyikillua/code_aster_on_docker

To open a testing shell, just do

docker run -ti --rm quay.io/tianyikillua/code_aster

and then

as_run --test forma02a

Offline

#16 2018-07-02 08:14:14

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 4,049

Re: Code_Aster inside a Docker container available for everyone

hello

i really get a lot of trouble with your setup
this does work

docker run -ti --rm quay.io/tianyikillua/code_aster
and then
as_run --test forma02a

but when i try to run a real life case, as suggest in the terminal i get the following

<F>_PROFILE_COPY   error during copying /dedalus/arbeit/2018/betrieb/lgt/thyeste/fe/th1.export to /tmp/astk_aster/aster-f91d5490f341-profil_astk.46
message : cp: cannot stat '/dedalus/arbeit/2018/betrieb/lgt/thyeste/fe/th1.export': No such file or directory

what does this means
it looks like there simply is no /tmp/astk_aster/ directory on my tree

and i repeat my question where are are installed the code_aster relevant files

more generally i an afraid i do not understand whet is exactly the aim of this docker install


jean pierre aubry


consider reading my book
freely available here https://framabook.org/beginning-with-code_aster/

Offline

#17 2018-07-02 09:00:34

tianyikillua
Member
From: Paris
Registered: 2017-11-06
Posts: 69

Re: Code_Aster inside a Docker container available for everyone

Hi Jean Pierre,

You can regard this Docker container as a vitual machine in which Code_Aster is preinstalled for you. In comparison to real vitual machines (e.g. a Ubuntu one) where you have a real operating system, in a Docker container many unnecssary systemwise services (display, audio, bluetooth..) are removed, reducing hence the size of such images and increasing somehow the performance.

To launch your real-world case, you need to make sure that all your Code_Aster files on the host, i.e. those you can directly see and use on your computer, can be shared into this Docker container, via the directory /home/aster/shared. This Docker container can operate files on your host, only via this folder.

Thus

1. You need to copy all the necessary files in a single folder on your host, for instance /home/haha/test
2. Use relative paths in the export file, like

F comm test.comm D  1

and NOT like

F /home/haha/wow/opps/test.comm D  1

where /home/haha/wow/opps/ is a path on your host.

3. Go to this folder where all your files are, i.e. /home/haha/test, and open the Docker container that shares this folder

docker run -ti --rm -v $(pwd):/home/aster/shared quay.io/tianyikillua/code_aster
# docker run -ti --rm -v /home/haha/test:/home/aster/shared quay.io/tianyikillua/code_aster

3bis. In the Docker parameter you should make sure that the folder /home/haha/test can indeed be exploited by Docker, for instance all the files/folders within /home/haha. This is a precaution of Docker that avoids Docker containers operating for instance you system files in /usr.

3ter. In particular in your case. Verify that /dedalus can be shared into your host, by going to the parameter settings of Docker. Under Windows you have something like this

42152152-97c6a21c-7ddf-11e8-9142-343743fe8b71.png

So only files in the D drive have the possibility of being used by Docker.

4. In the Docker container, make sure that all your files are indeed shared into the Docker, by going to /home/aster/shared.

5. Launch as_run there. Again, you need to use relative path of your export file, by doing directly

as_run test.export

and NOT

as_run /home/haha/wow/oops/test.export

Let me know if you need further information. I must say that at first these Docker jargons are indeed a bit difficult to follow.

Last edited by tianyikillua (2018-07-02 09:18:18)

Offline

#18 2018-07-02 10:54:53

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 4,049

Re: Code_Aster inside a Docker container available for everyone

thanks

but i am afraid i do not understand much more

3bis. In the Docker parameter you should make sure that the folder /home/haha/test 

i repeat my question
where are are installed the code_aster relevant files
and where are these Docker parameter
ps
i just want to test this and include it as a possible option in the new edition of my book


consider reading my book
freely available here https://framabook.org/beginning-with-code_aster/

Offline

#19 2018-07-02 11:12:33

tianyikillua
Member
From: Paris
Registered: 2017-11-06
Posts: 69

Re: Code_Aster inside a Docker container available for everyone

The Code_Aster program along with its prerequisites are installed into the Docker image (like a virtual machine image) stored somewhere on your hard drive. The exact location depends on your operating system and Docker parameters.

Under Windows & Mac

If you have Docker opened, you can do a right click and go to "Parameters" or something like that, and set parameters relative to shared drives.

Under Linux

According to github.com/rocker-org/rocker/wiki/Sharing-files-with-host-maching

As docker runs natively on Linux, you can always link any volume to the container with the -v or --volume flag, as described in the docker documentation.

So...You don't need to do anything. You just run an export file which specifies everything in relative paths and do as_run on this file directly.

Last edited by tianyikillua (2018-07-02 11:17:17)

Offline

#20 2018-07-02 11:35:54

Ioannis
Member
Registered: 2016-04-01
Posts: 67

Re: Code_Aster inside a Docker container available for everyone

Hi Jean Pierre and Tianyi,

I just want to share my experience with using successfully the docker image with Windows 10 Home Edition, which I guess is the most common version of the potential users that can take advantage of this great way of using code_aster. Again kudos to Tianyi for this contribution.

So, for the latest Docker for Windows - Community Edition (CE) Microsoft Windows 10 Professional or Enterprise 64-bit is required, otherwise, the user has to download the legacy desktop solution Docker Toolbox that uses VirtualBox for a Linux VM inside where Docker is used.

Once Docker Toolbox is installed you will have the Docker Quickstart Terminal to launch the commands and if desired and chosen also the Kitematic App (in Alpha version) that has a UI to perform some of the operations with docker.

The steps I followed to run a case study where I have in a single folder (C:\Users\user_name\Documents\study_folder) the .med, .comm and .export files is:

1. Launch the Docker Quickstart Terminal

2. Change the directory  (cd) to the folder of my study

[Edited]: It is important to write correctly in terms of capital and small letters the path to the folder. If it is not exactly the same you will not get an error but then the folder will not be mounted in the docker image.

3. Initiate the docker image associating the current working directory to the /home/aster/shared folder of the docker image

docker run -ti --rm -v $(pwd):/home/aster/shared quay.io/tianyikillua/code_aster

4. Run code_aster giving the full path of the export file in the docker image

as_run /home/aster/shared/my_study.export

   [Edited]: or

cd /home/aster/shared
as_run my_study.export

In the export file I use the full path with regard to the docker image so for example:

F comm /home/aster/shared/my_study.comm D  1

[Edited]: I can also specify the relative path for the files as

F comm my_study.comm D  1

but then I see that the file is modified automatically and the full path as shown above is written

Regarding the parallel version, I can successfully run it using

P version stable_mpi

instead of

P version stable

and by specifying the "mpi_nbcpu" greater than 1.

I hope this can be of help to anyone that wants to use it for Windows Home Edition although the information already given by Tianyi in this post and in his GitHub page is more than complete. Let's say that my intention is to encourage people to try it.

Best,
Ioannis

Last edited by Ioannis (2018-07-08 10:20:09)


Aether Engineering
- aethereng.com -

Offline

#21 2018-07-02 13:23:16

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 4,049

Re: Code_Aster inside a Docker container available for everyone

this what gives my latest try

dedalus@dedalus:~/test/fe> docker run -ti --rm -v $(pwd):/home/aster/shared quay.io/tianyikillua/code_aster
# Code_Aster latest stable version

Welcome to Code_Aster!

This image provides a GCC-based build of the latest
stable release of Code_Aster containing the following
components:

- hdf5 1.8.14
- med 3.2.1
- gmsh 2.12.0
- grace 5.1.23
- gibi 2000
- scotch 6.0.4
- astk 1.13.10
- metis 5.1.0
- mfront 3.0.0
- mumps 5.1.1
- homard 11.7
- aster 13.4.0

To execute an "export" file, just run

    as_run foo.export

aster@bff18a649141:~$ as_run  /home/dedalus/test/fe/th1.export 

<F>_PROFILE_COPY   error during copying /home/dedalus/test/fe./th1.export to /tmp/astk_aster/aster-bff18a649141-profil_astk.26
message : cp: cannot stat '/home/dedalus/test/fe/th1.export': No such file or directory

note
file /home/dedalus/test/fe/th1.export  does exist
directory /tmp/astk_aster/   does not exist

what can i do

Last edited by jeanpierreaubry (2018-07-02 13:38:08)


consider reading my book
freely available here https://framabook.org/beginning-with-code_aster/

Offline

#22 2018-07-02 13:36:43

Ioannis
Member
Registered: 2016-04-01
Posts: 67

Re: Code_Aster inside a Docker container available for everyone

Try this, it should work

as_run  /home/aster/shared/th1.export

Aether Engineering
- aethereng.com -

Offline

#23 2018-07-02 14:06:49

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 4,049

Re: Code_Aster inside a Docker container available for everyone

Try this, it should work
as_run  /home/aster/shared/th1.export

it does thanks Ioannis
but i do not know why !
i must say that i do not like to run this type of poorly documented black box


consider reading my book
freely available here https://framabook.org/beginning-with-code_aster/

Offline

#24 2018-07-02 14:20:17

Ioannis
Member
Registered: 2016-04-01
Posts: 67

Re: Code_Aster inside a Docker container available for everyone

That is great Jean Pierre, my pleasure to help.

It works because the commands you are writing refer to the docker image and not to your pc.

By using the "-v $(pwd):/home/aster/shared" command you associated (or mounted better) your local folder (pwd) to the "/home/aster/shared" folder of the docker image. So everything you would do with reference to your folder you have to do now with reference to the associated folder.

Best,
Ioannis


Aether Engineering
- aethereng.com -

Offline

#25 2018-07-02 14:21:22

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 4,049

Re: Code_Aster inside a Docker container available for everyone

NO
i claimed victory too quickly
the problem  runs but
i am unable to find out where are located the results files


consider reading my book
freely available here https://framabook.org/beginning-with-code_aster/

Offline