Suse Studio: "How to create a live openSUSE image with OpenFOAM® and CFD tools"

64
How to create a live openSUSE image with OpenFOAM ® and CFD tools Alberto Passalacqua [email protected]

description

Una descripción de Suse Studio, además de una magnífica explicación de su utilización de la mano de Alberto Passalacqua. "How to create a live openSUSE image with OpenFOAM® and CFD tools"

Transcript of Suse Studio: "How to create a live openSUSE image with OpenFOAM® and CFD tools"

Page 1: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

How to create a live openSUSE image with OpenFOAM® and CFD tools

Alberto [email protected]

Page 2: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Introduction

Page 3: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

What is SUSE Studio?

● A web-service to build Linux appliances– Build a personalized distribution based on

● OpenSUSE● SUSE Linux Enterprise Desktop● SUSE Linux Enterprise Server

– Create the image once, with the software you need, and export in many formats:

● Live CD/DVD● Live USB● Hard disk image● Virtual machine image (XEN, VM Ware)

Page 4: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

What is OpenFOAM?● An open-source computational fluid dynamics toolbox

capable to simulate complex fluid flows involving heat transfer, turbulence, chemical reactions, solid dynamics, electromagnetics,... ● High level programming language for transport equations (based

on C++)

● Automatic parallelization using MPI

● Compatibility with a variety of tools for pre- and post-processing.

● Produced by OpenCFD Ltd: www.opencfd.co.uk

● Freely available under GPL.

Page 5: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

How can I use SUSE Studio?● SUSE Studio is available on-line at the

address: http://susestudio.com.● At the moment, SUSE Studio is in beta

stage:● Only invited people can use it to test it.● Everyone can apply for an invitation.● Current users can invite a limited number of

friends, to spread the voice. (I have a few invitations, ask if interested)

Page 6: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Building a live image with OpenFOAM

Page 7: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Preliminary steps● The following steps have to be done before proceeding

to build the live image:● Compile OpenFOAM on the version of openSUSE (in the

example 11.1) you will use to create the image.● In this process, use the system compiler.● Build Paraview using libqt4-devel from openSUSE.● Create a tar.gz archive containing:

– The OpenFOAM-1.5.x directory, complete of binaries.

– The ThirdParty directory, without gcc.

Page 8: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Access to SUSE Studio● Point your web browser to

http://susestudio.com

Page 9: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Let's login!● To login in SUSE Studio you can use

any OpenID provider. For example:● Novell login● Google account● Yahoo account

Page 10: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"
Page 11: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Template selection● In this example, we build the

OpenFOAM live image using:● OpenSUSE 11.1● GNOME● 64 bit architecture

● The appliance will be called OpenFOAM Live

Page 12: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"
Page 13: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"
Page 14: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Software selection● The main software repository for openSUSE 11.1 is

added by default, together with the repository containing updates.

● It is possible to ● Add all the repositories on the openSUSE buildservice.● Add external repositories (packman, videolan, …)● Add personalized repositories● Upload RPM's

Page 15: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Software selection main page

Summary

Add external repository and RPM's

Already selected packages

Page 16: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Software patterns (groups)

Page 17: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Adding software

Let's search for emacs...

...and add it by clicking here

Page 18: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Adding software● With the same

procedure, we can add● Mozilla Firefox● Evolution● OpenOffice● Gedit● Gnuplot, xmgrace● BLAS, lapack, gsl● Blender

● But we want more!

● Development pattern for C/C++● libqt4-devel (required by

paraview)

● CFD tools● enGrid and NETGEN

(science repository)● VLC (Videolan repository)

Page 19: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Adding the C/C++ pattern

Click on the Development pattern

Page 20: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Adding the C/C++ pattern

Locate the pattern in the list (it has a small icon) and click on Add. Compilers are added!

Page 21: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Adding libqt4-develLet's go back to the software search engine...

Search for libqt4...

Select libqt4-devel by clicking on Add

Page 22: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Installing enGrid and NETGEN● Engrid (www.engits.com) and NETGEN (

http://www.hpfem.jku.at/netgen/) are not in the default repository

● No worries! We do not need to know where they are!

● We can use the repository search, which:● Will search in all the repositories indexed on

SUSE Studio, even if not added to our appliance.● Will suggest which repository to add.

Page 23: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Search engrid here

The science repository is the suggested one, let's add it

Installing enGrid and NETGEN

Page 24: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Installing enGrid and NETGEN

Now we can add enGrid as usual using software search and adding it. Similarly we search for NETGEN and install it too.

Page 25: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Java, flash and multimedia● Java and flash browser plugins are in

the non-OSS repository.● It can be found searching for “sun” in

the repository search engine and added as done for engrid.

● VLC can be installed by searching for it in the repository search engine, and repeating the procedure used for enGrid.

Page 26: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Configuration

Languange selection: localize your image here (it requires additional space)

Network settings. Leave unchanged to testdrive without downloading. You can change them later once sure the image works.

Languange selection: localize your image here (it requires additional space)

Page 27: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Configuration

Users settings: add your users and set their passwords here

Firewall settings. Leave ports open if you want to use SUSE Studio Features (SSH access). You can change them later and rebuild.

Page 28: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Personalize!

Change logo and background here. You can upload your own

Page 29: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Startup settings

Select default runlevel

You can show your license agreement if required

Page 30: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Server configuration

We do not need any database configuration, so we leave this page unchanged

Page 31: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Desktop configuration

The user “geeko” is set to login automatically when the image is booted

Page 32: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Storage and memory

Settings for virtual machine images (we are building a live USB image, they won't be used)

Swap partition size: when the image is booted the first time it will create the swap partition

Page 33: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Scripts

We can run scripts at the end of the build process or when the image boots. In this example we don't use scripts.

Page 34: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Adding OpenFOAM

Page 35: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Overlay files

We can upload single files and compressed archives, from our computer or using a web URL.

We use a web URL where the OpenFOAM tar.gz was uploaded...

Page 36: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

OpenFOAM upload

We simply need to insert the URL where the archive is located, and SUSE Studio will download it.

Page 37: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

OpenFOAM upload

The compressed archive we used is of about 350MB, so it takes some time do download on SUSE Studio servers.

SUSE Studio offers a total space of 15GB per user at the moment. Images are compressed, so we can build many of them.

Page 38: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Uploads

OpenFOAM was downloaded, and we want it extracted in /home/geeko/OpenFOAM. Permissions are taken from the archive.

We also upload the .bashrc file for the user “geeko”, in /home/geeko, we set the owner to “geeko”, the group to “users” and permissions to 755.

Page 39: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Build and test-drive

Page 40: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Let's build!

Select the image format (in our case “disk image”, for the USB live), specify the version number (optional) and click on Build.

The build process start, and takes some time, as reported by the progress bar.

Page 41: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

It's ready: Testdrive!

When the image is ready (in the example the size is huge because I added a lot of packages to experiment!), you can testdrive the image without downloading it (flashplayer required)

Page 42: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Testrive...booting

The image boots. Your keyboard is fully functional as on a real system, and you can switch Linux console with the buttons on the sidebar.

Page 43: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

First login...it works!

At the first login, you have the default openSUSE GNOME desktop and menu

Page 44: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

There is YaST...

A full featured and fully functional YaST, SUSE configuration tool, is available

Page 45: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Development tools and games...

Page 46: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Graphics, internet and multimedia

Page 47: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Office suite and tools

Page 48: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

NETGEN

NETGEN running...

Page 49: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

enGrid

EnGrid, with both OpenFOAM and CGNS filters enabled

Page 50: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

OpenFOAM

The familiar OpenFOAM directory layout was reproduced correctly during the build...

Page 51: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Let's check if it works...

In GNOME terminal, let's run the simple (and small not to abuse of SUSE Studio resources) cavity tutorial.

First...blockmesh

Page 52: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

blockMesh works!

The mesh was generated correctly...

Page 53: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Let's run icoFoam...

The case run successfully, so we only have to check if paraView works...

Page 54: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

ParaView

Also paraFoam worked correctly, launching paraview without problems

Page 55: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Modified files

Let's check ~/.bashrc, make a small change...(I added one space :-)), and save it...

Page 56: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Modified filesClick on Modified files...

...deselect the Add filter...

...and refresh the list of changes.

The modified ~/.bashrc file appears at the top of the list...

Page 57: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Modified files

To do this, check the box...

And choose to add the changes to the image.

SUSE Studio allows the changes to be added to the final live image!

Page 58: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Networking functionalities

SUSE Studio offers networking functionalities to connect the the live image

Networking can be enabled by clicking here

Page 59: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

SSH access to the live image

Here we find the command to connect using SSH, with root access...

...and we type it in a terminal on my local machine...

Page 60: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

SSH access to the live image

Now we are logged into the live image running on SUSE Studio and we can make our changes using the terminal

Page 61: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Some final note● The image can be downloaded in

compressed form (tar.gz) to save time● Builds might be deleted from SUSE

Studio servers after seven days, but this does not represent a problem● Only the final image of the build is deleted.● The settings of the build are not lost, and it

is possible to rebuild the image with one click.

Page 62: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Conclusions● Building a live image with SUSE Studio is a

straightforward process, thanks to the clean, easy to use interface.

● Incorporating a complex software as OpenFOAM does not require other than a tar.gz archive containing the binary build of OpenFOAM on the target distribution.

● Additional software is available on OpenSUSE Buildservice (http://software.opensuse.org)

Page 63: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

Enjoy!

Page 64: Suse Studio: "How to create a live openSUSE image with  OpenFOAM® and CFD tools"

General DisclaimerThis document is not to be construed as a promise by any participating company to develop, deliver, or market a product. The author makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. All Novell marks referenced in this presentation are trademarks or registered trademarks of Novell, Inc. in the United States and other countries. All third-party trademarks are the property of their respective owners.

This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 2.5 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/2.5/.

For other licenses contact author.

OpenFoam is a registered trademark of OpenCFD Limited. All other brands and trademarks are property of their owners.The Author of this tutorial (Alberto Passalacqua) is not affiliated in any way to, and does not represent OpenCFD Limited. The Author of this tutorial is not a Novell employee and does not represent Novell..