nmag-project / project-tasks

NMAG - Micromagnetic modelling tool based on finite elements
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Provide nmag in container #6

Closed fangohr closed 4 years ago

fangohr commented 4 years ago

It would be beautiful to provide Nmag in a container (such as Docker or Singularity). Once done, installation and use of Nmag is simplified as only the container is needed to be downloaded. Further compilation would not be necessary.

Instead of calling "nsim script.py" one would do something like "docker run nsim script.py" and mount the local directory into the container. (see [1] for basic introduction).

I have tried to compile Nmag in a Docker container but didn't succeed (and then ran out of time); see https://github.com/fangohr/nmag-containers

[1] https://github.com/fangohr/containers-for-science

fangohr commented 4 years ago

A good step forward has been made in https://github.com/fangohr/nmag-containers/pull/2 - this provides a singularity container in which nsim can be executed.

mhanberry1 commented 4 years ago

The singularity image is hosted in the syslabs.io cloud library now: https://cloud.sylabs.io/library/mhanberry1/default/nmag

@fangohr I think this issue can be closed now since there is a separate issue open for continuous integration (https://github.com/fangohr/nmag/issues/7). Please verify.

Venkat004 commented 4 years ago

Nmag at syslabs.io cloud is verified and working fine with the test run as shown below with screen shot.

image

image

SUDO is not needed here as you can see the command used is the following in the above screen shot.

$ singularity exec nmag_0.2.1.sif nsim sphere1.py

fangohr commented 4 years ago

Regarding HLIB: is it still the case that one needs to request a license to use it? In that case, we cannot include it in the container. We could ask the owners if they care about the old version we presumably need, or wether it would be okay to include that, but we would need permission. (Maybe distributing the binary would be okay? Needs checking, and probably a new issue.)

Venkat004 commented 4 years ago

Do we need to implement the hlib package before making the container image file (.sif). Otherwise, it will be limited to non-hlib simulations. The users themselves can not keep the hlib library within sif file at later stage.

We can make a note for such requirements, users can add the hlib package into the respective path soon after unzipping the source tar file, before building the nmag-sandbox.

Another option would be get the permission from Hlib authors http://hlib.org/license.html, for deployment purpose in the form of .sif (end binary file) only but neither at sandbox nor at source tar file levels.

fangohr commented 4 years ago

Regarding closing this issue: We should have continuous integration somewhere that runs all tests whenever (if?) we change the nmag / nsim source code. My initial thinking was that this should be associated to a different repo (maybe nmag-src).

Here, I was thinking that we should have a simplified version of testing: once the container is built, it would be nice to run a one simple example through the container - just to demo that this is basically okay.

Now, I don't know if we get nmag compiled in the nmag-src continuous integration without singularity. If we need singularity, then the question if we should build it in the nmag-src continuous integration, and not do it in the nmag-containers repo. But for now, my recommendation would be to extend nmag-containers to

We would then either later merge this with the CI for nmag-src, or keep both CIs going.

@mhanberry1 - what do you think?