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

Preview:

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"

Citation preview

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

Alberto Passalacquaalbert.passalacqua@gmail.com

Introduction

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)

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.

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)

Building a live image with OpenFOAM

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.

Access to SUSE Studio● Point your web browser to

http://susestudio.com

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

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

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

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

Software selection main page

Summary

Add external repository and RPM's

Already selected packages

Software patterns (groups)

Adding software

Let's search for emacs...

...and add it by clicking here

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)

Adding the C/C++ pattern

Click on the Development pattern

Adding the C/C++ pattern

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

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

Search for libqt4...

Select libqt4-devel by clicking on Add

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.

Search engrid here

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

Installing enGrid and NETGEN

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.

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.

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)

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.

Personalize!

Change logo and background here. You can upload your own

Startup settings

Select default runlevel

You can show your license agreement if required

Server configuration

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

Desktop configuration

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

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

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.

Adding OpenFOAM

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...

OpenFOAM upload

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

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.

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.

Build and test-drive

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.

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)

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.

First login...it works!

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

There is YaST...

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

Development tools and games...

Graphics, internet and multimedia

Office suite and tools

NETGEN

NETGEN running...

enGrid

EnGrid, with both OpenFOAM and CGNS filters enabled

OpenFOAM

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

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

blockMesh works!

The mesh was generated correctly...

Let's run icoFoam...

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

ParaView

Also paraFoam worked correctly, launching paraview without problems

Modified files

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

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...

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!

Networking functionalities

SUSE Studio offers networking functionalities to connect the the live image

Networking can be enabled by clicking here

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...

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

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.

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)

Enjoy!

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..

Recommended