https://www.cac.cornell.edu/wiki/api.php?action=feedcontributions&user=Crm17&feedformat=atomCAC Documentation wiki - User contributions [en]2024-03-28T20:29:08ZUser contributionsMediaWiki 1.35.5https://www.cac.cornell.edu/wiki/index.php?title=Red_Cloud_Linux_Instances&diff=3957Red Cloud Linux Instances2022-09-02T17:08:09Z<p>Crm17: </p>
<hr />
<div>Linux Instances can be created and maintained on [[Red_Cloud|Red Cloud]] using the [https://redcloud.cac.cornell.edu OpenStack Web Interface]. This documentation assumes a basic understanding of [[OpenStack]], so please review that page as needed. If you are '''new to Linux''', you may want to read the [[Linux Tutorial]] first. It is also a good idea to be familiar with the [[Linux Tutorial]] if you have not previously done '''Linux system administration''', which is an assumed prerequisite to managing Linux Instances. Additionally, you may find the [https://cvw.cac.cornell.edu/Linux/ Introduction to Linux] topic on the [https://cvw.cac.cornell.edu/topics Cornell Virtual Workshop] helpful.<br />
<br />
__TOC__<br />
<br />
== Creating a New Linux Instance ==<br />
<br />
You can boot an instance with most modern Linux distributions. Currently Red Cloud offers pre-made VM images running the following Linux distributions:<br />
<br />
:* Red Hat Enterprise Linux-based distributions:<br />
:** CentOS 7<br />
:** Rocky Linux 8: [[ How To Migrate Existing Hosts from CentOS to Rocky Linux 8 ]]<br />
:* Ubuntu (including [https://wiki.ubuntu.com/LTS LTS])<br />
<br />
=== Steps ===<br />
# Log in to the [https://redcloud.cac.cornell.edu OpenStack Web Interface] (check out [[OpenStack#Logging_In|how to log in]] if you need to)<br />
# If you have not already, [[OpenStack Key Pairs#Creating_a_Passphrase-Protected_Key_Pair_(Recommended)|create a key pair]]<br />
# If you have not already, [[OpenStack Security Groups#Creating a Security Group|create a security group]]. Note that your security group should include the inbound SSH rule so you can connect to it.<br />
# '''Optional:''' [[Networks#Private Networks|Set up a Private Network]]<br />
# Select <tt>Launch Instance</tt> from the [https://redcloud.cac.cornell.edu/dashboard/project/instances/ Instances] page<br />
# Follow the instructions about [[OpenStack#Launch an Instance|launching a new instance]], and select one of the a CentOS or Ubuntu [[Images|images]] under the <tt>Source</tt> tab<br />
# '''Optional:''' [[Volumes#Create and Attach a Volume|Create and attach a Volume]]<br />
# '''Optional:''' [[Networks#Floating IP Addresses|Associate a Floating IP address]]<br />
<br />
Now that you have created and launched an instance, your next steps will be to [[#Accessing_Instances|connect to it]] and set up a new user account. See the [[Linux_Tutorial#Initial_User_Setup_2|CentOS steps]] or [[Linux_Tutorial#Initial_User_Setup|Ubuntu steps]] for more information on how to set up a new user, update, and install software for each distribution.<br />
<br />
== Accessing Instances ==<br />
<br />
First, establish access to your instance using [[Connect_to_Linux#Using_Secure_Shell|Secure Shell (ssh)]], possibly including [[Connect_to_Linux#Using_X-Windows|X Windows]] for remote graphical display. If you are at all unfamiliar with Linux, we recommend following the [[Linux Tutorial]]. If you would like to have a desktop environment (not available by default for Linux instances), then you may want to follow the steps for [[XFCE Desktop on CentOS]]. Establishing an SSH connection is a prerequisite for creating a Linux desktop environment such as XFCE.<br />
<br />
=== Secure Shell (SSH) ===<br />
<br />
The main requirements for logging in to your instance using secure shell are:<br />
:* The [[OpenStack Security Groups|security group]] for your instance must permit SSH connections (TCP port 22) from your current IP address.<br />
<br />
:* You must use the private key that matches the public key in the [[OpenStack Key Pairs|key pair]] you specified when launching the instance.<br />
<br />
:* You must log in to your instance using the correct initial username:<br />
:** For CentOS 7, the username is <tt>centos</tt>,<br />
:** For Rocky Linux 8 and CentOS 8, the username is <tt>cloud-user</tt>, and<br />
:** For Ubuntu, it is <tt>ubuntu</tt>.<br />
<br />
To log in through SSH, specify the key pair file (for example <tt>my_key.pem</tt>),<br />
username and IP address as follows:<br />
<br />
ssh -i my_key.pem <username>@<IP address of your instance><br />
<br />
For more information on how to use SSH, see the [[Connect to Linux]] page.<br />
<br />
Note: Transferring files can also be done over <code>ssh</code>. See the <code>scp</code> and <code>sftp</code> commands, or programs like [//winscp.net/eng/index.php WinSCP] and [//apple.stackexchange.com/questions/25661/whats-a-good-graphical-sftp-utility-for-os-x similar software for Mac OS X].<br />
<br />
==== Troubleshooting ====<br />
<br />
There are several common error messages you may see when trying to access your Linux instance using SSH.<br />
These are the most likely causes for each common message.<br />
<br />
:* '''"Connection timed out"''' means that your SSH command can't communicate at all with the instance.<br />
:** Note: It may take a while for the connection time out to occur, so it may seem that the system is not responding at all initially. However, this is still likely a "Connection timed out" error.<br />
:** Has the instance been started? Check the instance's console in the [[OpenStack|OpenStack Web Interface]]. Did the instance boot successfully?<br />
:** Do the [[OpenStack Security Groups|security group's]] rules allow incoming ssh connections (TCP port 22) from ''an address range (CIDR) that includes your current IP address''? Double check that you followed the [[OpenStack Security Groups|instructions for security groups]].<br />
:** Remember, if you are not on campus but the security group is configured for ingress from 10.0.0.0/8 and 128.84.32.0/22, you would need to be connected to the [https://it.cornell.edu/cuvpn Cornell VPN] in order to SSH into the instance.<br />
:** Is your instance on the [[Networks#Public Network|public network]]? If not, does it have an associated [[Networks#Floating IP Addresses|floating IP address]] and are you using the correct address?<br />
:** Here is a tool for finding your current [https://whatsmyip.com IP address]. There are also port connection tools like ping and telnet you can use for troubleshooting. (To use ping, make sure your security group has the "ALL ICMP" rule enabled for an address range that includes your current IP.)<br />
<br />
:* An error like '''"Permissions <4-digits> for <key-file-name> are too open"''' means you can reach the instance, but your private key file has improper permissions.<br />
:** Make sure your private key file is saved as a ".pem" extension and that it has the proper permissions: <p><code>chmod 600 <key name>.pem</code></p><br />
<br />
:* '''"Permission denied (<some details>)"''' means that the combination of the username and SSH key you are providing are not correct for this instance.<br />
:** Make sure you are using the correct username:<br />
:*** If you are using Ubuntu, did you login as the '''ubuntu''' user? For more information on that, see the [[Linux_Tutorial#The_.22ubuntu.22_User|Linux Tutorial]].<br />
:*** If you are using CentOS 7, did you login as the '''centos''' user?<br />
:*** If you are using Rocky Linux 8 or CentOS 8, did you login as the '''cloud-user''' user?<br />
:*** If you are using a CentOS MATLAB instance, did you login as the '''root''' user?<br />
:** Did you [[OpenStack_Key_Pairs#Creating_a_Key_Pair|create a key pair]] and make sure to [[OpenStack_Key_Pairs#Selecting_a_Key_Pair_When_Creating_an_Instance|select it when creating the instance]]?<br />
:** Are you supplying your key pair in the command? See the [[#Secure_Shell_.28SSH.29|SSH]] instructions above for an example.<br />
:* If you get an '''unexpected password prompt''':<br />
:** Did you use the correct user name? See suggestions above.<br />
:** Make sure your private key matches the public key of the [[OpenStack Key Pairs|key pair]]. <br />
:**# On your computer, run: <code>ssh-keygen -y -f <private key file></code><br />
:**# Confirm that the output matches the public key on Red Cloud at [https://redcloud.cac.cornell.edu/dashboard/project/key_pairs https://redcloud.cac.cornell.edu/dashboard/project/key_pairs]/<your keypair name>.<br />
<br />
=== VNC with XFCE Desktop ===<br />
<br />
In case you would prefer a desktop environment over a command-line, your Linux instance needs to have a VNC (Virtual Network Computing) server and a desktop environment installed on it. Red Cloud's "gpu-accelerated" images come with the TigerVNC server preinstalled, as well as the [https://xfce.org/ XFCE Desktop Environment], making it relatively easy to use a VNC client to connect to a Linux instance that is based on one of the "gpu-accelerated" images.<br />
<br />
For Linux instances based on other images, certain packages must be installed on the instance first. This section details the steps to setting up an XFCE desktop environment for use with VNC on a CentOS 7.4 instance. Other typical Linux desktop environments, such as GNOME, are also available, but XFCE is used as an example here. Setting up a desktop environment should work similarly on Ubuntu instances as well, with some differences. Once the environment is set up, you can launch a VNC server on the instance and connect to it using a VNC client through an ssh tunnel.<br />
<br />
==== VNC and XFCE Installation on CentOS ====<br />
<br />
# Log in as root via ssh as [[#Secure_Shell_.28ssh.29 | described above]].<br />
# Install needed packages:<br />
#* <code>yum install tigervnc-server</code><br />
#* <code>yum groupinstall xfce</code><br />
# Install some additional software that most users will want. These are only suggestions, and this is not a comprehensive list<br />
#* <code>yum install gedit</code><br />
#* <code>yum install firefox</code><br />
#* [https://www.tecmint.com/install-libreoffice-on-rhel-centos-fedora-debian-ubuntu-linux-mint/ LibreOffice]<br />
<br />
==== VNC and XFCE User Setup ====<br />
<br />
For each user that will want to use the XFCE Desktop, you will need to set up VNC capability. To do this, follow the directions below. Alternatively, there is also an [https://linuxtechlab.com/secure-vnc-server-tls-encryption/ Easy guide to secure VNC server with TLS encryption].<br />
<br />
# Open a shell as that user<br />
# <code>vncpasswd</code><br />
#* Sets the user's VNC password<br />
#* This step is '''not necessary''' for read-only VNC<br />
#* This creates a ~/.vnc folder<br />
# <code>vim ~/.vnc/xstartup</code><br />
#* Do not change this file on "gpu-accelerated" instances (as commands in it prevent Anaconda from interfering with dbus)<br />
#* On other instances, paste this text into the file: <br /><tt>#!/bin/bash<br />xrdb $HOME/.Xresources<br />startxfce4 &<br /></tt><br />
# <code>chmod 775 ~/.vnc/xstartup</code><br />
# <code>mkdir ~/bin</code><br />
# <code>vim ~/bin/start_vncserver.sh</code><br />
#* Paste this text into the file: <br /><tt>#!/bin/bash<br />vncserver -geometry 1680x1050<br /></tt><br />
# <code>chmod 775 ~/bin/start_vncserver.sh</code><br />
<br />
==== Using VNC ====<br />
<br />
A brief overview for users is provided here, and for more information please see the [[Getting_Started#Using_VNC|Using VNC section on our Getting Started page]].<br />
<br />
===== Manage the VNC Server =====<br />
<br />
Whenever an instance gets rebooted, you can '''restart''' the VNC server by doing the following<br />
# ssh into the instance<br />
# run <code>~/bin/start_vncserver.sh</code><br />
<br />
To find the port, you can run e.g. <code>ps gxu | grep vnc</code>.<br />
<br />
You can '''stop''' the VNC server by running <code>vncserver -kill :1</code>. If this doesn't work,<br />
you can try <code>pkill Xvnc</code>.<br />
<br />
To '''change or reset the VNC password''', you can simply run <code>vncpassword</code><br />
<br />
To '''change the screen resolution''':<br />
:* Permanently: edit the script <code>~/.vnc/xstartup</code><br />
:* For this session only: use Applications->Display<br />
<br />
===== View the Desktop =====<br />
<br />
# Open a local shell and ssh to establish the tunnel (recommended local port 10000):<br />
#* <code>ssh -L 10000:localhost:5901 <username>@<remote_ip></code><br />
#* '''Note:''' When this shell is closed, the VNC viewer will have to close, too, though VNC is still running.<br />
# In a VNC viewer app, connect to the VNC server <code>localhost:10000</code> (or whichever port you chose above).<br />
#* This should open a window showing the desktop<br />
#* The '''first time''' you do this:<br />
#** For the remote computer, you may have to dismiss a warning dialog<br />
#** You will need to initialize a "panel". Click "Use default config"<br />
<br />
'''Note for Windows users:''' You can also find useful instructions on the [[VNC Tunnel Windows]] page. You may also want to look into [https://fossbytes.com/enable-built-windows-10-openssh-client/ OpenSSH] or [https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10 Bash on Ubuntu on Windows].<br />
<br />
== Instance Maintenance ==<br />
<br />
All self-managed desktops, laptops, servers, and Red Cloud instances, both Windows and Linux, should be updated with Operating System and Acrobat Reader critical and security updates on a '''''monthly''''' basis. <br />
<br />
For Linux instances:<br />
# Check for updates<br />
#* Ubuntu: <code>sudo apt update</code><br />
#* CentOS 7: <code>sudo yum check-update</code><br />
#* CentOS 8: <code>sudo dnf check-update</code><br />
# Install updates<br />
#* Ubuntu: <code>sudo apt upgrade</code><br />
#* CentOS 7: <code>sudo yum update</code><br />
#* CentOS 8: <code>sudo dnf upgrade</code><br />
# Reboot the instance with <code>sudo reboot</code> on both Ubuntu and CentOS<br />
<br />
Before rebooting make sure to save all active work. Rebooting will disconnect you from the instance. Wait a minute or two to allow the instance to restart before reconnecting. When you reconnect, you should verify that the updates were applied by repeating step 1.<br />
<br />
== Initialize and Mount a Volume ==<br />
<br />
WARNING: FILE SYSTEM INITIALIZATION OVERWRITES AND DESTROYS PREVIOUS DATA.<br />
<br />
The instructions here are for formatting and mounting [[Volumes|attached volumes]], though steps like these can only be performed if you have [[Volumes#Create_and_Attach_a_Volume|allocated and attached the volume]] through OpenStack, which can be done while the instance is running.<br />
<br />
'''Note:''' These instructions assume you are the [[Linux_Tutorial#Definitions|root user]]. If you are not (such as on [[Linux_Tutorial#The_.22ubuntu.22_User|Ubuntu]]), then you may need to prepend <code>sudo</code> where appropriate.<br />
<br />
# Identify the device name of the drive you wish to format and mount.<br />
#* Run <code>lsblk</code> to see which /dev/vdX is the likely candidate (for some character 'X'). The following directions assume you identified <code>vdb</code> as the drive of interest.<br />
# Set up file system:<br />
#* <code>sudo mkfs.ext4 /dev/vdb</code><br />
# Make a directory where the device will be mounted, for example "<tt>mountpoint</tt>" in the "<tt>/mnt</tt>" directory:<br />
#* <code>sudo mkdir /mnt/mountpoint</code><br />
# Protect the mount point directory from accidental writes (Optional, but prevents a common user error): <br />
#* <code>sudo chattr +i /mnt/mountpoint</code><br />
# Mount the device:<br />
#* <code>sudo mount /dev/vdb /mnt/mountpoint</code><br />
# To have the mount automatically renewed after reboot, add an <code>fstab</code> entry (this is a little dangerous)<br />
#* <code>sudo nano /etc/fstab</code><br />
#* Add a line with tab separations between four fields: disk device, mounted location, "ext4", "defaults":<br />
#** <code>/dev/vdb /mnt/mountpoint ext4 defaults,nofail</code><br />
<br />
{{Migrate leadout}}</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=Red_Cloud_Linux_Instances&diff=3956Red Cloud Linux Instances2022-09-02T17:06:39Z<p>Crm17: </p>
<hr />
<div>Linux Instances can be created and maintained on [[Red_Cloud|Red Cloud]] using the [https://redcloud.cac.cornell.edu OpenStack Web Interface]. This documentation assumes a basic understanding of [[OpenStack]], so please review that page as needed. If you are '''new to Linux''', you may want to read the [[Linux Tutorial]] first. It is also a good idea to be familiar with the [[Linux Tutorial]] if you have not previously done '''Linux system administration''', which is an assumed prerequisite to managing Linux Instances. Additionally, you may find the [https://cvw.cac.cornell.edu/Linux/ Introduction to Linux] topic on the [https://cvw.cac.cornell.edu/topics Cornell Virtual Workshop] helpful.<br />
<br />
__TOC__<br />
<br />
== Creating a New Linux Instance ==<br />
<br />
You can boot an instance with most modern Linux distributions. Currently Red Cloud offers pre-made VM images running the following Linux distributions:<br />
<br />
:* Red Hat Enterprise Linux-based distributions:<br />
:** CentOS 7<br />
:** Rocky Linux 8: [[ How To Migrate Existing Hosts from CentOS to Rocky Linux 8 ]]<br />
:* Ubuntu (including [https://wiki.ubuntu.com/LTS LTS])<br />
<br />
=== Steps ===<br />
# Log in to the [https://redcloud.cac.cornell.edu OpenStack Web Interface] (check out [[OpenStack#Logging_In|how to log in]] if you need to)<br />
# If you have not already, [[OpenStack Key Pairs#Creating_a_Passphrase-Protected_Key_Pair_(Recommended)|create a key pair]]<br />
# If you have not already, [[OpenStack Security Groups#Creating a Security Group|create a security group]]. Note that your security group should include the inbound SSH rule so you can connect to it.<br />
# '''Optional:''' [[Networks#Private Networks|Set up a Private Network]]<br />
# Select <tt>Launch Instance</tt> from the [https://redcloud.cac.cornell.edu/dashboard/project/instances/ Instances] page<br />
# Follow the instructions about [[OpenStack#Launch an Instance|launching a new instance]], and select one of the a CentOS or Ubuntu [[Images|images]] under the <tt>Source</tt> tab<br />
# '''Optional:''' [[Volumes#Create and Attach a Volume|Create and attach a Volume]]<br />
# '''Optional:''' [[Networks#Floating IP Addresses|Associate a Floating IP address]]<br />
<br />
Now that you have created and launched an instance, your next steps will be to [[#Accessing_Instances|connect to it]] and set up a new user account. See the [[Linux_Tutorial#Initial_User_Setup_2|CentOS steps]] or [[Linux_Tutorial#Initial_User_Setup|Ubuntu steps]] for more information on how to set up a new user, update, and install software for each distribution.<br />
<br />
== Accessing Instances ==<br />
<br />
First, establish access to your instance using [[Connect_to_Linux#Using_Secure_Shell|Secure Shell (ssh)]], possibly including [[Connect_to_Linux#Using_X-Windows|X Windows]] for remote graphical display. If you are at all unfamiliar with Linux, we recommend following the [[Linux Tutorial]]. If you would like to have a desktop environment (not available by default for Linux instances), then you may want to follow the steps for [[XFCE Desktop on CentOS]]. Establishing an SSH connection is a prerequisite for creating a Linux desktop environment such as XFCE.<br />
<br />
=== Secure Shell (SSH) ===<br />
<br />
The main requirements for logging in to your instance using secure shell are:<br />
:* The [[OpenStack Security Groups|security group]] for your instance must permit SSH connections (TCP port 22) from your current IP address.<br />
<br />
:* You must use the private key that matches the public key in the [[OpenStack Key Pairs|key pair]] you specified when launching the instance.<br />
<br />
:* You must log in to your instance using the correct initial username:<br />
:** For CentOS 7, the username is <tt>centos</tt>,<br />
:** For Rocky Linux 8 and CentOS 8, the username is <tt>cloud-user</tt>, and<br />
:** For Ubuntu, it is <tt>ubuntu</tt>.<br />
<br />
To log in through SSH, specify the key pair file (for example <tt>my_key.pem</tt>),<br />
username and IP address as follows:<br />
<br />
ssh -i my_key.pem <username>@<IP address of your instance><br />
<br />
For more information on how to use SSH, see the [[Connect to Linux]] page.<br />
<br />
Note: Transferring files can also be done over <code>ssh</code>. See the <code>scp</code> and <code>sftp</code> commands, or programs like [//winscp.net/eng/index.php WinSCP] and [//apple.stackexchange.com/questions/25661/whats-a-good-graphical-sftp-utility-for-os-x similar software for Mac OS X].<br />
<br />
==== Troubleshooting ====<br />
<br />
There are several common error messages you may see when trying to access your Linux instance using SSH.<br />
These are the most likely causes for each common message.<br />
<br />
:* '''"Connection timed out"''' means that your SSH command can't communicate at all with the instance.<br />
:** Note: It may take a while for the connection time out to occur, so it may seem that the system is not responding at all initially. However, this is still likely a "Connection timed out" error.<br />
:** Has the instance been started? Check the instance's console in the [[OpenStack|OpenStack Web Interface]]. Did the instance boot successfully?<br />
:** Do the [[OpenStack Security Groups|security group's]] rules allow incoming ssh connections (TCP port 22) from ''an address range (CIDR) that includes your current IP address''? Double check that you followed the [[OpenStack Security Groups|instructions for security groups]].<br />
:** Remember, if you are not on campus but the security group is configured for ingress from 10.0.0.0/8 and 128.84.32.0/22, you would need to be connected to the [https://it.cornell.edu/cuvpn Cornell VPN] in order to SSH into the instance.<br />
:** Is your instance on the [[Networks#Public Network|public network]]? If not, does it have an associated [[Networks#Floating IP Addresses|floating IP address]] and are you using the correct address?<br />
:** Here is a tool for finding your current [https://whatsmyip.com IP address]. There are also port connection tools like ping and telnet you can use for troubleshooting. (To use ping, make sure your security group has the "ALL ICMP" rule enabled for an address range that includes your current IP.)<br />
<br />
:* An error like '''"Permissions <4-digits> for <key-file-name> are too open"''' means you can reach the instance, but your private key file has improper permissions.<br />
:** Make sure your private key file is saved as a ".pem" extension and that it has the proper permissions: <p><code>chmod 600 <key name>.pem</code></p><br />
<br />
:* '''"Permission denied (<some details>)"''' means that the combination of the username and SSH key you are providing are not correct for this instance.<br />
:** Make sure you are using the correct username:<br />
:*** If you are using Ubuntu, did you login as the '''ubuntu''' user? For more information on that, see the [[Linux_Tutorial#The_.22ubuntu.22_User|Linux Tutorial]].<br />
:*** If you are using CentOS 7, did you login as the '''centos''' user?<br />
:*** If you are using CentOS 8, did you login as the '''cloud-user''' user?<br />
:*** If you are using a CentOS MATLAB instance, did you login as the '''root''' user?<br />
:** Did you [[OpenStack_Key_Pairs#Creating_a_Key_Pair|create a key pair]] and make sure to [[OpenStack_Key_Pairs#Selecting_a_Key_Pair_When_Creating_an_Instance|select it when creating the instance]]?<br />
:** Are you supplying your key pair in the command? See the [[#Secure_Shell_.28SSH.29|SSH]] instructions above for an example.<br />
:* If you get an '''unexpected password prompt''':<br />
:** Did you use the correct user name? See suggestions above.<br />
:** Make sure your private key matches the public key of the [[OpenStack Key Pairs|key pair]]. <br />
:**# On your computer, run: <code>ssh-keygen -y -f <private key file></code><br />
:**# Confirm that the output matches the public key on Red Cloud at [https://redcloud.cac.cornell.edu/dashboard/project/key_pairs https://redcloud.cac.cornell.edu/dashboard/project/key_pairs]/<your keypair name>.<br />
<br />
=== VNC with XFCE Desktop ===<br />
<br />
In case you would prefer a desktop environment over a command-line, your Linux instance needs to have a VNC (Virtual Network Computing) server and a desktop environment installed on it. Red Cloud's "gpu-accelerated" images come with the TigerVNC server preinstalled, as well as the [https://xfce.org/ XFCE Desktop Environment], making it relatively easy to use a VNC client to connect to a Linux instance that is based on one of the "gpu-accelerated" images.<br />
<br />
For Linux instances based on other images, certain packages must be installed on the instance first. This section details the steps to setting up an XFCE desktop environment for use with VNC on a CentOS 7.4 instance. Other typical Linux desktop environments, such as GNOME, are also available, but XFCE is used as an example here. Setting up a desktop environment should work similarly on Ubuntu instances as well, with some differences. Once the environment is set up, you can launch a VNC server on the instance and connect to it using a VNC client through an ssh tunnel.<br />
<br />
==== VNC and XFCE Installation on CentOS ====<br />
<br />
# Log in as root via ssh as [[#Secure_Shell_.28ssh.29 | described above]].<br />
# Install needed packages:<br />
#* <code>yum install tigervnc-server</code><br />
#* <code>yum groupinstall xfce</code><br />
# Install some additional software that most users will want. These are only suggestions, and this is not a comprehensive list<br />
#* <code>yum install gedit</code><br />
#* <code>yum install firefox</code><br />
#* [https://www.tecmint.com/install-libreoffice-on-rhel-centos-fedora-debian-ubuntu-linux-mint/ LibreOffice]<br />
<br />
==== VNC and XFCE User Setup ====<br />
<br />
For each user that will want to use the XFCE Desktop, you will need to set up VNC capability. To do this, follow the directions below. Alternatively, there is also an [https://linuxtechlab.com/secure-vnc-server-tls-encryption/ Easy guide to secure VNC server with TLS encryption].<br />
<br />
# Open a shell as that user<br />
# <code>vncpasswd</code><br />
#* Sets the user's VNC password<br />
#* This step is '''not necessary''' for read-only VNC<br />
#* This creates a ~/.vnc folder<br />
# <code>vim ~/.vnc/xstartup</code><br />
#* Do not change this file on "gpu-accelerated" instances (as commands in it prevent Anaconda from interfering with dbus)<br />
#* On other instances, paste this text into the file: <br /><tt>#!/bin/bash<br />xrdb $HOME/.Xresources<br />startxfce4 &<br /></tt><br />
# <code>chmod 775 ~/.vnc/xstartup</code><br />
# <code>mkdir ~/bin</code><br />
# <code>vim ~/bin/start_vncserver.sh</code><br />
#* Paste this text into the file: <br /><tt>#!/bin/bash<br />vncserver -geometry 1680x1050<br /></tt><br />
# <code>chmod 775 ~/bin/start_vncserver.sh</code><br />
<br />
==== Using VNC ====<br />
<br />
A brief overview for users is provided here, and for more information please see the [[Getting_Started#Using_VNC|Using VNC section on our Getting Started page]].<br />
<br />
===== Manage the VNC Server =====<br />
<br />
Whenever an instance gets rebooted, you can '''restart''' the VNC server by doing the following<br />
# ssh into the instance<br />
# run <code>~/bin/start_vncserver.sh</code><br />
<br />
To find the port, you can run e.g. <code>ps gxu | grep vnc</code>.<br />
<br />
You can '''stop''' the VNC server by running <code>vncserver -kill :1</code>. If this doesn't work,<br />
you can try <code>pkill Xvnc</code>.<br />
<br />
To '''change or reset the VNC password''', you can simply run <code>vncpassword</code><br />
<br />
To '''change the screen resolution''':<br />
:* Permanently: edit the script <code>~/.vnc/xstartup</code><br />
:* For this session only: use Applications->Display<br />
<br />
===== View the Desktop =====<br />
<br />
# Open a local shell and ssh to establish the tunnel (recommended local port 10000):<br />
#* <code>ssh -L 10000:localhost:5901 <username>@<remote_ip></code><br />
#* '''Note:''' When this shell is closed, the VNC viewer will have to close, too, though VNC is still running.<br />
# In a VNC viewer app, connect to the VNC server <code>localhost:10000</code> (or whichever port you chose above).<br />
#* This should open a window showing the desktop<br />
#* The '''first time''' you do this:<br />
#** For the remote computer, you may have to dismiss a warning dialog<br />
#** You will need to initialize a "panel". Click "Use default config"<br />
<br />
'''Note for Windows users:''' You can also find useful instructions on the [[VNC Tunnel Windows]] page. You may also want to look into [https://fossbytes.com/enable-built-windows-10-openssh-client/ OpenSSH] or [https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10 Bash on Ubuntu on Windows].<br />
<br />
== Instance Maintenance ==<br />
<br />
All self-managed desktops, laptops, servers, and Red Cloud instances, both Windows and Linux, should be updated with Operating System and Acrobat Reader critical and security updates on a '''''monthly''''' basis. <br />
<br />
For Linux instances:<br />
# Check for updates<br />
#* Ubuntu: <code>sudo apt update</code><br />
#* CentOS 7: <code>sudo yum check-update</code><br />
#* CentOS 8: <code>sudo dnf check-update</code><br />
# Install updates<br />
#* Ubuntu: <code>sudo apt upgrade</code><br />
#* CentOS 7: <code>sudo yum update</code><br />
#* CentOS 8: <code>sudo dnf upgrade</code><br />
# Reboot the instance with <code>sudo reboot</code> on both Ubuntu and CentOS<br />
<br />
Before rebooting make sure to save all active work. Rebooting will disconnect you from the instance. Wait a minute or two to allow the instance to restart before reconnecting. When you reconnect, you should verify that the updates were applied by repeating step 1.<br />
<br />
== Initialize and Mount a Volume ==<br />
<br />
WARNING: FILE SYSTEM INITIALIZATION OVERWRITES AND DESTROYS PREVIOUS DATA.<br />
<br />
The instructions here are for formatting and mounting [[Volumes|attached volumes]], though steps like these can only be performed if you have [[Volumes#Create_and_Attach_a_Volume|allocated and attached the volume]] through OpenStack, which can be done while the instance is running.<br />
<br />
'''Note:''' These instructions assume you are the [[Linux_Tutorial#Definitions|root user]]. If you are not (such as on [[Linux_Tutorial#The_.22ubuntu.22_User|Ubuntu]]), then you may need to prepend <code>sudo</code> where appropriate.<br />
<br />
# Identify the device name of the drive you wish to format and mount.<br />
#* Run <code>lsblk</code> to see which /dev/vdX is the likely candidate (for some character 'X'). The following directions assume you identified <code>vdb</code> as the drive of interest.<br />
# Set up file system:<br />
#* <code>sudo mkfs.ext4 /dev/vdb</code><br />
# Make a directory where the device will be mounted, for example "<tt>mountpoint</tt>" in the "<tt>/mnt</tt>" directory:<br />
#* <code>sudo mkdir /mnt/mountpoint</code><br />
# Protect the mount point directory from accidental writes (Optional, but prevents a common user error): <br />
#* <code>sudo chattr +i /mnt/mountpoint</code><br />
# Mount the device:<br />
#* <code>sudo mount /dev/vdb /mnt/mountpoint</code><br />
# To have the mount automatically renewed after reboot, add an <code>fstab</code> entry (this is a little dangerous)<br />
#* <code>sudo nano /etc/fstab</code><br />
#* Add a line with tab separations between four fields: disk device, mounted location, "ext4", "defaults":<br />
#** <code>/dev/vdb /mnt/mountpoint ext4 defaults,nofail</code><br />
<br />
{{Migrate leadout}}</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=THECUBE_Cluster&diff=3888THECUBE Cluster2022-07-14T20:17:25Z<p>Crm17: /* Manage Modules in Your Python Virtual Environment */</p>
<hr />
<div>This is a private cluster.<br />
<br />
=Hardware=<br />
:* Head node: '''thecube.cac.cornell.edu'''.<br />
:* access modes: ssh<br />
:* OpenHPC v1.3.8 with CentOS 7.6<br />
:* 32 compute nodes (c0001-c0032) with dual 8-core Intel E5-2680 CPUs @ 2.7 GHz, 128 GB of RAM<br />
:* Hyperthreading is enabled on all nodes, i.e., each physical core is considered to consist of two logical CPUs.<br />
:* Interconnect is InfiniBand FDR: Mellanox MT27500 Family (ConnectX-3).<br />
:* THECUBE Cluster Status: [http://thecube.cac.cornell.edu/ganglia/ Ganglia].<br />
:* Submit HELP requests: [https://{{SERVERNAME}}/help help] OR by sending an email to [mailto:help@cac.cornell.edu CAC support] please include THECUBE in the subject area.<br />
<br />
=File Systems=<br />
==Home Directories==<br />
:* Path: ~<br />
<br />
User home directories is located on a NFS export from the head node. Use your home directory (~) for archiving the data you wish to keep. Do NOT use this file system for computation as bandwidth to the compute nodes is very limited and will quickly be overwhelmed by file I/Os from large jobs.<br />
<br />
'''Unless special arrangements are made, data in user's home directories are NOT backed up.'''<br />
<br />
==Scratch File System==<br />
LUSTRE file system runs Intel Lustre 2.7:<br />
:* Path: /scratch/<user name><br />
<br />
The scratch file system is a fast parallel file system. Use this file system for scratch space for your jobs. Copy the results you want to keep back to your home directory for safe keeping.<br />
<br />
=Scheduler/Queues=<br />
:* The cluster scheduler is Slurm. All nodes are configured to be in the "normal" partition with no time limits. See [[ slurm | Slurm documentation page ]] for details.<br />
:* Remember, hyperthreading is enabled on the cluster, so Slurm considers each physical core to consist of two logical CPUs.<br />
:* Partitions (queues):<br />
::{| border="1" cellspacing="0" cellpadding="10"<br />
! Name<br />
! Description<br />
! Time Limit<br />
|-<br />
| normal<br />
| all nodes<br />
| no limit<br />
|}<br />
<br />
=Software=<br />
<br />
==Work with Environment Modules==<br />
<br />
Set up the working environment for each package using the module command. <br />
The module command will activate dependent modules if there are any. <br />
<br />
To show currently loaded modules:<br />
(These modules are loaded by default system configurations)<br />
<pre><br />
-bash-4.2$ module list<br />
<br />
Currently Loaded Modules:<br />
1) autotools 2) prun/1.3 3) gnu8/8.3.0 4) openmpi3/3.1.4 5) ohpc<br />
</pre><br />
<br />
To show all available modules (as of Sept 30, 2013):<br />
<pre><br />
-bash-4.2$ module avail<br />
<br />
-------------------- /opt/ohpc/pub/moduledeps/gnu8-openmpi3 --------------------<br />
boost/1.70.0 netcdf/4.6.3 pnetcdf/1.11.1<br />
fftw/3.3.8 phdf5/1.10.5 py3-scipy/1.2.1<br />
<br />
------------------------ /opt/ohpc/pub/moduledeps/gnu8 -------------------------<br />
R/3.5.3 mpich/3.3.1 openblas/0.3.5 py3-numpy/1.15.3<br />
hdf5/1.10.5 mvapich2/2.3.1 openmpi3/3.1.4 (L)<br />
<br />
-------------------------- /opt/ohpc/pub/modulefiles ---------------------------<br />
autotools (L) intel/19.0.2.187 prun/1.3 (L)<br />
clustershell/1.8.1 julia/1.2.0 valgrind/3.15.0<br />
cmake/3.14.3 octave/5.1.0 vim/8.1<br />
gnu8/8.3.0 (L) ohpc (L) visit/3.0.1<br />
gurobi/8.1.1 pmix/2.2.2<br />
<br />
Where:<br />
L: Module is loaded<br />
<br />
</pre><br />
To load a module and verify:<br />
<pre><br />
-bash-4.2$ module load R/3.5.3 <br />
-bash-4.2$ module list<br />
<br />
Currently Loaded Modules:<br />
1) autotools 3) gnu8/8.3.0 5) ohpc 7) R/3.5.3<br />
2) prun/1.3 4) openmpi3/3.1.4 6) openblas/0.3.5<br />
<br />
</pre><br />
To unload a module and verify:<br />
<pre><br />
-bash-4.2$ module list<br />
<br />
Currently Loaded Modules:<br />
1) autotools 2) prun/1.3 3) gnu8/8.3.0 4) openmpi3/3.1.4 5) ohpc<br />
</pre><br />
<br />
<br />
== Install R Packages in Home Directory ==<br />
If you need a new R package not installed on the system, you can [[Install R Packages in Your Home Directory | install R packages in your home directory using these instructions]]. <br />
<br />
== Manage Modules in Your Python Virtual Environment ==<br />
<br />
Both python2 (2.7) and python3 (3.9) are installed. Users can manage their own python environment (including installing needed modules) using virtual environments. Please see [https://packaging.python.org/guides/installing-using-pip-and-virtual-environments the documentation on virtual environments on python.org] for details.<br />
<br />
=== Load Python Module ===<br />
<br />
You will first want to load the desired or required python module for your work. Use the command <code>module spider python</code> or <code>module avail</code> to see what python modules are available. Then load the specific required module, e.g., via:<br />
<br />
* <code>module load python/3.9.4</code><br />
<br />
After you execute this, <code>python3</code> should point to the program installed as part of the 3.9.4 module.<br />
<br />
=== Create Virtual Environment ===<br />
<br />
You can '''create''' as many virtual environments, each in their own directory, as needed.<br />
<br />
* python2: <code>python -m virtualenv <your virtual environment directory></code><br />
<br />
* python3: <code>python3 -m venv <your virtual environment directory></code><br />
<br />
=== Activate Virtual Environment ===<br />
<br />
You need to '''activate''' a virtual environment before using it:<br />
<br />
<pre>source <your virtual environment directory>/bin/activate</pre><br />
<br />
=== Install Python Modules Using pip ===<br />
<br />
After activating your virtual environment, you can now install python modules for the activated environment:<br />
<br />
* It's always a good idea to update <code>pip</code> first: <br />
<pre>pip install --upgrade pip</pre><br />
<br />
* Install the module:<br />
<pre>pip install <module name></pre><br />
<br />
* List installed python modules in the environment:<br />
<pre>pip list modules</pre><br />
<br />
* Examples: Install <code>tensorflow</code> and <code>keras</code> like this:<br />
<br />
<pre><br />
-bash-4.2$ python3 -m venv tensorflow<br />
-bash-4.2$ source tensorflow/bin/activate<br />
(tensorflow) -bash-4.2$ pip install --upgrade pip<br />
Collecting pip<br />
Using cached https://files.pythonhosted.org/packages/30/db/9e38760b32e3e7f40cce46dd5fb107b8c73840df38f0046d8e6514e675a1/pip-19.2.3-py2.py3-none-any.whl<br />
Installing collected packages: pip<br />
Found existing installation: pip 18.1<br />
Uninstalling pip-18.1:<br />
Successfully uninstalled pip-18.1<br />
Successfully installed pip-19.2.3<br />
(tensorflow) -bash-4.2$ pip install tensorflow keras<br />
Collecting tensorflow<br />
Using cached https://files.pythonhosted.org/packages/de/f0/96fb2e0412ae9692dbf400e5b04432885f677ad6241c088ccc5fe7724d69/tensorflow-1.14.0-cp36-cp36m-manylinux1_x86_64.whl<br />
:<br />
:<br />
:<br />
Successfully installed absl-py-0.8.0 astor-0.8.0 gast-0.2.2 google-pasta-0.1.7 grpcio-1.23.0 h5py-2.9.0 keras-2.2.5 keras-applications-1.0.8 keras-preprocessing-1.1.0 markdown-3.1.1 numpy-1.17.1 protobuf-3.9.1 pyyaml-5.1.2 scipy-1.3.1 six-1.12.0 tensorboard-1.14.0 tensorflow-1.14.0 tensorflow-estimator-1.14.0 termcolor-1.1.0 werkzeug-0.15.5 wheel-0.33.6 wrapt-1.11.2<br />
(tensorflow) -bash-4.2$ pip list modules<br />
Package Version<br />
-------------------- -------<br />
absl-py 0.8.0 <br />
astor 0.8.0 <br />
gast 0.2.2 <br />
google-pasta 0.1.7 <br />
grpcio 1.23.0 <br />
h5py 2.9.0 <br />
Keras 2.2.5 <br />
Keras-Applications 1.0.8 <br />
Keras-Preprocessing 1.1.0 <br />
Markdown 3.1.1 <br />
numpy 1.17.1 <br />
pip 19.2.3 <br />
protobuf 3.9.1 <br />
PyYAML 5.1.2 <br />
scipy 1.3.1 <br />
setuptools 40.6.2 <br />
six 1.12.0 <br />
tensorboard 1.14.0 <br />
tensorflow 1.14.0 <br />
tensorflow-estimator 1.14.0 <br />
termcolor 1.1.0 <br />
Werkzeug 0.15.5 <br />
wheel 0.33.6 <br />
wrapt 1.11.2 <br />
</pre><br />
<br />
=== Run MPI-Enabled Python in a Singularity Container ===<br />
<br />
The following Dockerfile should create an Ubuntu image that is able to run Python applications parallelized with mpi4py. Note that simply doing <code>apt-get install -y openmpi</code> in Ubuntu 18.04 will not generally install an Open MPI version that is recent enough to be compatible with the host's Open MPI version.<br />
<br />
<pre><br />
### start with ubuntu base image<br />
FROM ubuntu:18.04<br />
<br />
### install basics, python3, and modules needed for application<br />
RUN apt-get update && apt-get upgrade -y && apt-get install -y build-essential zlib1g-dev libjpeg-dev python3-pip openssh-server<br />
RUN pip3 install Pillow numpy pandas matplotlib cython<br />
<br />
### install Open MPI version 4.0.5, consistent with Hopper & TheCube<br />
RUN wget 'https://www.open-mpi.org/software/ompi/v4.0/downloads/openmpi-4.0.5.tar.gz' -O openmpi-4.0.5.tar.gz<br />
RUN tar -xzf openmpi-4.0.5.tar.gz openmpi-4.0.5; cd openmpi-4.0.5; ./configure --prefix=/usr/local; make all install<br />
RUN ldconfig<br />
<br />
### install mpi4py now that openmpi is installed<br />
RUN pip3 install mpi4py<br />
<br />
### add all code from current directory into “code” directory within container, and set as working directory<br />
ADD . /code<br />
WORKDIR /code<br />
ENV PATH "/code:$PATH"<br />
<br />
### compile cython for this particular application<br />
RUN python3 setup.py build_ext --inplace<br />
<br />
### set python file as executable so it can be run by docker/singularity<br />
RUN chmod +rx /code/run_reservoir_sim.py<br />
<br />
### change username from root<br />
RUN useradd -u 8877 <my_username><br />
USER <my_username><br />
</pre><br />
<br />
The resulting image can then be run in a Singularity container by putting commands like these into your Slurm batch file:<br />
<br />
<pre><br />
module load singularity<br />
mpirun singularity run cython_reservoir_0.1.sif run_reservoir_sim.py<br />
</pre><br />
<br />
== Software List ==<br />
::{| border="1" cellspacing="0" cellpadding="10"<br />
! Software<br />
! Path<br />
! Notes<br />
|-<br />
| Intel Compilers, MPI, and MKL || <pre>/opt/ohpc/pub/compiler/intel/2019/</pre><br />
|<br />
* module unload gnu8; module load intel/19.0.2.187; module load impi/2019.2.187<br />
|-<br />
| gcc 8.3 || <pre>/opt/ohpc/pub/compiler/gcc/8.3.0/</pre><br />
|<br />
* module load gnu8/8.3.0 (Loaded by default)<br />
|-<br />
| Openmpi 3.1.4 || <pre>/opt/ohpc/pub/mpi/openmpi3-gnu8/3.1.4</pre><br />
|<br />
* module load openmpi3/3.1.4 (Loaded by default)<br />
|-<br />
| python 3.9.4 || <pre>/opt/ohpc/pub/utils/python/3.9.4</pre><br />
|<br />
* module load python/3.9.4<br />
|-<br />
| python 2.7.16 || <pre>/opt/ohpc/pub/utils/python/2.7.16</pre><br />
|<br />
* module load python/2.7.16<br />
|-<br />
| perl 5.30.1 || <pre>/opt/ohpc/pub/utils/perl/5.30.1</pre><br />
|<br />
* module load perl/5.30.1<br />
|-<br />
| Boost 1.70.0 || <pre>/opt/ohpc/pub/libs/gnu8/openmpi3/boost/1.70.0</pre><br />
|<br />
* module load boost/1.70.0<br />
|-<br />
| cmake 3.14.3 || <pre>/opt/ohpc/pub/utils/cmake/3.14.3</pre><br />
|<br />
* module load cmake/3.14.3<br />
|-<br />
| hdf5 1.10.5 || <pre>/opt/ohpc/pub/libs/gnu8/hdf5/1.10.5</pre><br />
|<br />
* module load hdf5/1.10.5<br />
|-<br />
| octave 5.1.0 || <pre>/opt/ohpc/pub/apps/octave/5.1.0</pre><br />
|<br />
* module load octave/5.1.0<br />
|-<br />
| netcdf 4.6.3 || <pre>/opt/ohpc/pub/libs/gnu8/openmpi3/netcdf/4.6.3</pre><br />
|<br />
* module load netcdf/4.6.3<br />
|-<br />
| fftw 3.3.8 || <pre>/opt/ohpc/pub/libs/gnu8/openmpi3/fftw/3.3.8</pre><br />
|<br />
* module load fftw/3.3.8 <br />
|-<br />
| valgrind 3.15.0 || <pre>/opt/ohpc/pub/utils/valgrind/3.15.0</pre><br />
|<br />
* module load valgrind/3.15.0<br />
|-<br />
| visit 3.0.1 || <pre>/opt/ohpc/pub/apps/visit/3.0.1</pre><br />
|<br />
* module load visit/3.0.1<br />
|-<br />
| R 3.5.3 || <pre>/opt/ohpc/pub/libs/gnu8/R/3.5.3</pre><br />
|<br />
* module load R/3.5.3<br />
|-<br />
| openblas 0.3.5 || <pre>/opt/ohpc/pub/libs/gnu8/openblas/0.3.5</pre><br />
|<br />
* module load openblas/0.3.5<br />
|-<br />
| vim 8.1 || <pre>/opt/ohpc/pub/apps/vim/8.1</pre><br />
|<br />
* module load vim/8.1<br />
|-<br />
| julia 1.2.0 || <pre>/opt/ohpc/pub/compiler/julia/1.2.0</pre><br />
|<br />
* module load julia/1.2.0 <br />
|-<br />
| gurobi 8.1.1 || <pre>/opt/ohpc/pub/apps/gurobi/8.1.1</pre><br />
|<br />
* module load gurobi/8.1.1<br />
* Create a <code>~/gurobi.lic</code> file with the following line:<br />
<pre><br />
TOKENSERVER=infrastructure2.tc.cornell.edu<br />
</pre><br />
* <code>gurobipy</code> is installed in python-3.6.9. You can use it by loading that module.<br />
|-<br />
| remora 1.8.3 || <pre>/opt/ohpc/pub/apps/remora/1.8.3</pre><br />
|<br />
* module load remora/1.8.3 <br />
|-<br />
| GMAT R2019aBeta1 || <pre>/opt/ohpc/pub/apps/GMAT/R2019aBeta1</pre><br />
|<br />
* module load GMAT/R2019aBeta1<br />
|}<br />
<br />
=Help=<br />
:* [http://thecube.cac.cornell.edu/ganglia Cluster Status].<br />
:* Submit questions or requests at [https://www.cac.cornell.edu/help help] or by sending email to: [mailto:help@cac.cornell.edu help@cac.cornell.edu]. Please include THECUBE in the subject area.</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=Marx1_Cluster&diff=3797Marx1 Cluster2021-12-01T19:25:33Z<p>Crm17: </p>
<hr />
<div>__TOC__<br />
<br />
= General Information =<br />
<br />
:* Marx1 is a private virtual cluster in Red Cloud with restricted access to the following groups: mtm83_0001. Please see [[Virtual_Cluster_in_Red_Cloud | Virtual Cluster in Red Cloud page]] for more usage information.<br />
:* Head node: '''marx1.cac.cornell.edu''' ([[#How To Login|access via ssh]])<br />
:** [https://openhpc.community/ OpenHPC] deployment running Centos 8<br />
:** Cluster scheduler: slurm <br />
:* compute nodes - on demand via slurm<br />
:* data on the Marx1 cluster storage is <tt>'''NOT'''</tt> backed up<br />
:* Please send any questions and report problems to: [mailto:cac-help@cornell.edu cac-help@cornell.edu]<br />
<br />
= Software =<br />
<br />
==Work with Environment Modules==<br />
<br />
Set up the working environment for each package using the module command. <br />
The module command will activate dependent modules if there are any. <br />
<br />
To show currently loaded modules:<br />
(These modules are loaded by default system configurations)<br />
<pre><br />
-bash-4.2$ module list<br />
<br />
Currently Loaded Modules:<br />
1) autotools 3) gnu9/9.3.0 5) libfabric/1.10.1 7) ohpc<br />
2) prun/2.0 4) ucx/1.8.0 6) openmpi4/4.0.4<br />
</pre><br />
<br />
To show all available modules:<br />
<pre><br />
-bash-4.2$ module avail<br />
<br />
-------------------- /opt/ohpc/pub/moduledeps/gnu9-openmpi4 --------------------<br />
adios/1.13.1 netcdf-fortran/4.5.2 py3-mpi4py/3.0.3<br />
boost/1.73.0 netcdf/4.7.3 py3-scipy/1.5.1<br />
fftw/3.3.8 opencoarrays/2.8.0 scalapack/2.1.0<br />
hypre/2.18.1 petsc/3.13.1 slepc/3.13.2<br />
mfem/4.1 phdf5/1.10.6 superlu_dist/6.1.1<br />
mumps/5.2.1 pnetcdf/1.12.1 trilinos/13.0.0<br />
netcdf-cxx/4.3.1 ptscotch/6.0.6<br />
<br />
------------------------ /opt/ohpc/pub/moduledeps/gnu9 -------------------------<br />
gsl/2.6 mpich/3.3.2-ofi openmpi4/4.0.4 (L)<br />
hdf5/1.10.6 mvapich2/2.3.2 py3-numpy/1.19.0<br />
metis/5.1.0 openblas/0.3.7 superlu/5.2.1<br />
<br />
-------------------------- /opt/ohpc/pub/modulefiles ---------------------------<br />
autotools (L) gsutil/4.6.2 os prun/2.0 (L)<br />
cmake/3.16.2 libfabric/1.10.1 (L) perl5-libs ucx/1.8.0 (L)<br />
gnu9/9.3.0 (L) ohpc (L) pmix/3.1.4<br />
<br />
Where:<br />
L: Module is loaded<br />
<br />
Use "module spider" to find all possible modules and extensions.<br />
Use "module keyword key1 key2 ..." to search for all possible modules matching<br />
any of the "keys".<br />
</pre><br />
To load a module and verify:<br />
<pre><br />
-bash-4.2$ module load cmake<br />
-bash-4.2$ module list<br />
<br />
Currently Loaded Modules:<br />
1) autotools 3) gnu9/9.3.0 5) libfabric/1.10.1 7) ohpc<br />
2) prun/2.0 4) ucx/1.8.0 6) openmpi4/4.0.4 8) cmake/3.16.2<br />
<br />
</pre><br />
<br />
== Manage Modules in Your Python Virtual Environment ==<br />
<br />
python 3.6.8 is installed. Users can manage their own python environment (including installing needed modules) using virtual environments. Please see [https://packaging.python.org/guides/installing-using-pip-and-virtual-environments the documentation on virtual environments on python.org] for details.<br />
<br />
=== Create Virtual Environment ===<br />
<br />
You can '''create''' as many virtual environments, each in their own directory, as needed.<br />
<br />
<pre><br />
python3 -m venv <your virtual environment directory><br />
</pre><br />
<br />
=== Activate Virtual Environment ===<br />
<br />
You need to '''activate''' a virtual environment before using it:<br />
<br />
<pre>source <your virtual environment directory>/bin/activate</pre><br />
<br />
=== Install Python Modules Using pip ===<br />
<br />
After activating your virtual environment, you can now install python modules for the activated environment:<br />
<br />
* It's always a good idea to update <code>pip</code> first: <br />
<pre>pip install --upgrade pip</pre><br />
<br />
* Install the module:<br />
<pre>pip install <module name></pre><br />
<br />
* List installed python modules in the environment:<br />
<pre>pip list modules</pre><br />
<br />
* Examples: Install <code>tensorflow</code> and <code>keras</code> like this:<br />
<br />
<pre><br />
-bash-4.2$ python3 -m venv tensorflow<br />
-bash-4.2$ source tensorflow/bin/activate<br />
(tensorflow) -bash-4.2$ pip install --upgrade pip<br />
Collecting pip<br />
Using cached https://files.pythonhosted.org/packages/30/db/9e38760b32e3e7f40cce46dd5fb107b8c73840df38f0046d8e6514e675a1/pip-19.2.3-py2.py3-none-any.whl<br />
Installing collected packages: pip<br />
Found existing installation: pip 18.1<br />
Uninstalling pip-18.1:<br />
Successfully uninstalled pip-18.1<br />
Successfully installed pip-19.2.3<br />
(tensorflow) -bash-4.2$ pip install tensorflow keras<br />
Collecting tensorflow<br />
Using cached https://files.pythonhosted.org/packages/de/f0/96fb2e0412ae9692dbf400e5b04432885f677ad6241c088ccc5fe7724d69/tensorflow-1.14.0-cp36-cp36m-manylinux1_x86_64.whl<br />
:<br />
:<br />
:<br />
Successfully installed absl-py-0.8.0 astor-0.8.0 gast-0.2.2 google-pasta-0.1.7 grpcio-1.23.0 h5py-2.9.0 keras-2.2.5 keras-applications-1.0.8 keras-preprocessing-1.1.0 markdown-3.1.1 numpy-1.17.1 protobuf-3.9.1 pyyaml-5.1.2 scipy-1.3.1 six-1.12.0 tensorboard-1.14.0 tensorflow-1.14.0 tensorflow-estimator-1.14.0 termcolor-1.1.0 werkzeug-0.15.5 wheel-0.33.6 wrapt-1.11.2<br />
(tensorflow) -bash-4.2$ pip list modules<br />
Package Version<br />
-------------------- -------<br />
absl-py 0.8.0 <br />
astor 0.8.0 <br />
gast 0.2.2 <br />
google-pasta 0.1.7 <br />
grpcio 1.23.0 <br />
h5py 2.9.0 <br />
Keras 2.2.5 <br />
Keras-Applications 1.0.8 <br />
Keras-Preprocessing 1.1.0 <br />
Markdown 3.1.1 <br />
numpy 1.17.1 <br />
pip 19.2.3 <br />
protobuf 3.9.1 <br />
PyYAML 5.1.2 <br />
scipy 1.3.1 <br />
setuptools 40.6.2 <br />
six 1.12.0 <br />
tensorboard 1.14.0 <br />
tensorflow 1.14.0 <br />
tensorflow-estimator 1.14.0 <br />
termcolor 1.1.0 <br />
Werkzeug 0.15.5 <br />
wheel 0.33.6 <br />
wrapt 1.11.2 <br />
</pre></div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=Mainpage&diff=3586Mainpage2021-08-31T17:47:38Z<p>Crm17: </p>
<hr />
<div><html><br />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"><br />
<table role="presentation" style="border:0; margin: 0;" width="100%" cellspacing="10"><br />
<tr> <br />
<td valign="top" id="mainpage_opportunitiescell"><br />
<h1 class="mainpage_boxtitle">WELCOME TO CAC SUPPORT</h1><br />
<br />
<br />
<div class="mainpage_boxcontents_small"><br />
<p>This wiki provides Cornell University Center for Advanced Computing <a href="/">(CAC)</a> users with user documentation and other kinds of support information. If you're not a current user and would like to become one, visit <a href="/services/projects.aspx">how to start a project</a>. If you are a PI, visit <a href="/services/projects/manage.aspx">how to manage your current project</a>. Please remember to <a href="/wiki/index.php?title=Acknowledging_CAC">acknowledge CAC support</a> in your publications.</p><br />
</div><br />
</td><br />
</tr><br />
</table><br />
<br />
<br />
<table role="presentation" style="border:0; margin: 0;" width="100%" cellspacing="10"><br />
<tr><br />
<td valign="top" class="mainpage_hubbox"><br />
<br />
<div class="col-sm-4 panel-item"><br />
<a class="panel panel-circle-contrast" href="/wiki/index.php?title=Special:Search"><br />
<div class="panel-icon"><br />
<i class="fa fa-info-circle fa-5x"></i><br />
</div><br />
<div class="panel-body text-center"><br />
<h4 class="panel-title">Search support</h4><br />
<p>Search CAC support site.</p><br />
</div><br />
</a><br />
</div><br />
</td><br />
<td valign="top" class="mainpage_hubbox"><br />
<br />
<div class="col-sm-4 panel-item"><br />
<a class="panel panel-circle-contrast" href="//rt.cac.cornell.edu/index.html"><br />
<div class="panel-icon"><br />
<i class="fa fa-question-circle fa-5x"></i><br />
</div><br />
<div class="panel-body text-center"><br />
<h4 class="panel-title">Contact support</h4><br />
<p>Submit a ticket or call 607-254-8691.</p><br />
</div><br />
</a><br />
</div><br />
</td> <br />
<td valign="top" class="mainpage_hubbox"><br />
<br />
<br />
<div class="col-sm-4 panel-item"><br />
<a class="panel panel-circle-contrast" href="/datafeed/status.aspx"><br />
<div class="panel-icon"><br />
<i class="fa fa-check-circle fa-5x"></i><br />
</div><br />
<div class="panel-body text-center"><br />
<h4 class="panel-title">Check operating status</h4><br />
<p>Plan ahead for CAC infrastructure downtimes.</p><br />
</div><br />
</a><br />
</div><br />
</td> <br />
</tr><br />
</table><br />
<br />
<br />
<table role="presentation" style="border:0; margin: 0;" width="100%" cellspacing="10"><br />
<tr><br />
<br />
<!-- POUR LA PREMIERE COLONNE: USER DOCUMENTATION --><br />
<td valign="top" id="mainpage_opportunitiescell"><br />
<div class="mainpage_boxtitle">USER DOCUMENTATION</div><br />
<div class="mainpage_boxcontents_small"><br />
<ul><br />
<li><a href="/wiki/index.php?title=Red_Cloud" >Red Cloud</a><span> - on-demand cloud services</span></li><br />
<li><a href="/wiki/index.php?title=GPUs_in_Red_Cloud" >GPUs in Red Cloud</a></li><br />
<li><a href="/wiki/index.php?title=Archival_Storage" >Archival Storage</a><span> - how to use and</span><a href="/wiki/index.php?title=Syncing_to_Archival_Storage"> sync directories</a> <span> to CAC Archival Storage</span> </li><br />
<li><a href="/wiki/index.php?title=Private_Clusters"> Private Clusters</a> <span> - maintained by CAC </span></li><br />
<li><a href="/wiki/index.php?title=Getting_Started_on_Private_Clusters">Getting Started on Private Clusters</a><span> - password rules, home directories, and more</span></li><br />
<li><a href="/wiki/index.php?title=File_Transfer_using_Globus">File Transfer using Globus</a><span> - high speed file transfers to/from CAC</span></li><br />
<li><a href="/wiki/index.php?title=MATLAB_Parallel_Server_in_Red_Cloud">MATLAB Parallel Server in Red Cloud</a></li><br />
</ul><br />
</div><br />
</td><br />
<br />
<!-- TRAINING & EDUCATION --><br />
<td valign="top" id="mainpage_opportunitiescell"><br />
<div class="mainpage_boxtitle">TRAINING & EDUCATION</div><br />
<div class="mainpage_boxcontents_small"><br />
<ul><br />
<li><a href="https://www.youtube.com/channel/UCVPGMVWhp3sqWZFU5NntjTA">CAC YouTube</a> - Red Cloud how-to videos, webinars, and more</span></li><br />
<li><a href="/education/Default.aspx"> CAC Education and Outreach</a> <span> - overview </span></li><br />
<li><a href="https://portal.xsede.org/training/course-catalog" >XSEDE Training</a><span> - CAC is training lead (NSF program)</span></li><br />
<li><a href="https://cvw.cac.cornell.edu/topics/">Cornell Virtual Workshop</a><span> - online training </span></li><br />
<li><a href="http://cse.cornell.edu/scan/" >SCAN</a><span> - Scientific Computing and Numerics seminar</span></li><br />
<li><a href="http://www.cse.cornell.edu/">Program in Computational Science and Engineering</a></li><br />
<li><a href="https://www.cac.cornell.edu/education/training.aspx">CAC Events</a></li><br />
</ul><br />
</div><br />
</td><br />
<br />
<br />
</tr><br />
</table><br />
<br />
</html></div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=Mainpage&diff=3565Mainpage2021-07-23T19:04:26Z<p>Crm17: Added entry and link to CAC YouTube in Training & Education</p>
<hr />
<div><html><br />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"><br />
<table role="presentation" style="border:0; margin: 0;" width="100%" cellspacing="10"><br />
<tr> <br />
<td valign="top" id="mainpage_opportunitiescell"><br />
<h1 class="mainpage_boxtitle">WELCOME TO CAC SUPPORT</h1><br />
<br />
<br />
<div class="mainpage_boxcontents_small"><br />
<p>This wiki provides Cornell University Center for Advanced Computing <a href="/">(CAC)</a> users with user documentation and other kinds of support information. If you're not a current user and would like to become one, visit <a href="/services/projects.aspx">how to start a project</a>. If you are a PI, visit <a href="/services/projects/manage.aspx">how to manage your current project</a>. Please remember to <a href="/wiki/index.php?title=Acknowledging_CAC">acknowledge CAC support</a> in your publications.</p><br />
</div><br />
</td><br />
</tr><br />
</table><br />
<br />
<br />
<table role="presentation" style="border:0; margin: 0;" width="100%" cellspacing="10"><br />
<tr><br />
<td valign="top" class="mainpage_hubbox"><br />
<br />
<div class="col-sm-4 panel-item"><br />
<a class="panel panel-circle-contrast" href="/wiki/index.php?title=Special:Search"><br />
<div class="panel-icon"><br />
<i class="fa fa-info-circle fa-5x"></i><br />
</div><br />
<div class="panel-body text-center"><br />
<h4 class="panel-title">Search support</h4><br />
<p>Search CAC support site.</p><br />
</div><br />
</a><br />
</div><br />
</td><br />
<td valign="top" class="mainpage_hubbox"><br />
<br />
<div class="col-sm-4 panel-item"><br />
<a class="panel panel-circle-contrast" href="//rt.cac.cornell.edu/index.html"><br />
<div class="panel-icon"><br />
<i class="fa fa-question-circle fa-5x"></i><br />
</div><br />
<div class="panel-body text-center"><br />
<h4 class="panel-title">Contact support</h4><br />
<p>Submit a ticket or call 607-254-8691.</p><br />
</div><br />
</a><br />
</div><br />
</td> <br />
<td valign="top" class="mainpage_hubbox"><br />
<br />
<br />
<div class="col-sm-4 panel-item"><br />
<a class="panel panel-circle-contrast" href="/datafeed/status.aspx"><br />
<div class="panel-icon"><br />
<i class="fa fa-check-circle fa-5x"></i><br />
</div><br />
<div class="panel-body text-center"><br />
<h4 class="panel-title">Check operating status</h4><br />
<p>Plan ahead for CAC infrastructure downtimes.</p><br />
</div><br />
</a><br />
</div><br />
</td> <br />
</tr><br />
</table><br />
<br />
<br />
<table role="presentation" style="border:0; margin: 0;" width="100%" cellspacing="10"><br />
<tr><br />
<br />
<!-- POUR LA PREMIERE COLONNE: USER DOCUMENTATION --><br />
<td valign="top" id="mainpage_opportunitiescell"><br />
<div class="mainpage_boxtitle">USER DOCUMENTATION</div><br />
<div class="mainpage_boxcontents_small"><br />
<ul><br />
<li><a href="/wiki/index.php?title=Red_Cloud" >Red Cloud</a><span> - on-demand cloud services</span></li><br />
<li><a href="/wiki/index.php?title=GPUs_in_Red_Cloud" >GPUs in Red Cloud</a></li><br />
<li><a href="/wiki/index.php?title=Archival_Storage" >Archival Storage</a><span> - how to use and</span><a href="/wiki/index.php?title=Syncing_to_Archival_Storage"> sync directories</a> <span> to CAC Archival Storage</span> </li><br />
<li><a href="/wiki/index.php?title=Private_Clusters"> Private Clusters</a> <span> - maintained by CAC </span></li><br />
<li><a href="/wiki/index.php?title=Getting_Started_on_Private_Clusters">Getting Started on Private Clusters</a><span> - password rules, home directories, and more</span></li><br />
<li><a href="/wiki/index.php?title=File_Transfer_using_Globus">File Transfer using Globus</a><span> - high speed file transfers to/from CAC</span></li><br />
<li><a href="/wiki/index.php?title=MATLAB_Parallel_Server_in_Red_Cloud">MATLAB Parallel Server in Red Cloud</a></li><br />
</ul><br />
</div><br />
</td><br />
<br />
<!-- TRAINING & EDUCATION --><br />
<td valign="top" id="mainpage_opportunitiescell"><br />
<div class="mainpage_boxtitle">TRAINING & EDUCATION</div><br />
<div class="mainpage_boxcontents_small"><br />
<ul><br />
<li><a href="https://www.youtube.com/channel/UCVPGMVWhp3sqWZFU5NntjTA">CAC YouTube</a> - how-to videos</span></li><br />
<li><a href="/education/Default.aspx"> CAC Education and Outreach</a> <span> - overview </span></li><br />
<li><a href="https://portal.xsede.org/training/course-catalog" >XSEDE Training</a><span> - CAC is training lead (NSF program)</span></li><br />
<li><a href="https://cvw.cac.cornell.edu/topics/">Cornell Virtual Workshop</a><span> - online training </span></li><br />
<li><a href="http://cse.cornell.edu/scan/" >SCAN</a><span> - Scientific Computing and Numerics seminar</span></li><br />
<li><a href="http://www.cse.cornell.edu/">Program in Computational Science and Engineering</a></li><br />
<li><a href="https://www.cac.cornell.edu/education/training.aspx">CAC Events</a></li><br />
</ul><br />
</div><br />
</td><br />
<br />
<br />
</tr><br />
</table><br />
<br />
</html></div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=Mainpage&diff=3545Mainpage2021-05-25T13:28:02Z<p>Crm17: </p>
<hr />
<div><html><br />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"><br />
<table role="presentation" style="border:0; margin: 0;" width="100%" cellspacing="10"><br />
<tr> <br />
<td valign="top" id="mainpage_opportunitiescell"><br />
<h1 class="mainpage_boxtitle">WELCOME TO CAC SUPPORT</h1><br />
<br />
<br />
<div class="mainpage_boxcontents_small"><br />
<p>This wiki provides Cornell University Center for Advanced Computing <a href="/">(CAC)</a> users with user documentation and other kinds of support information. If you're not a current user and would like to become one, visit <a href="/services/projects.aspx">how to start a project</a>. If you are a PI, visit <a href="/services/projects/manage.aspx">how to manage your current project</a>. Please remember to <a href="/wiki/index.php?title=Acknowledging_CAC">acknowledge CAC support</a> in your publications.</p><br />
</div><br />
</td><br />
</tr><br />
</table><br />
<br />
<br />
<table role="presentation" style="border:0; margin: 0;" width="100%" cellspacing="10"><br />
<tr><br />
<td valign="top" class="mainpage_hubbox"><br />
<br />
<div class="col-sm-4 panel-item"><br />
<a class="panel panel-circle-contrast" href="/wiki/index.php?title=Special:Search"><br />
<div class="panel-icon"><br />
<i class="fa fa-info-circle fa-5x"></i><br />
</div><br />
<div class="panel-body text-center"><br />
<h4 class="panel-title">Search support</h4><br />
<p>Search CAC support site.</p><br />
</div><br />
</a><br />
</div><br />
</td><br />
<td valign="top" class="mainpage_hubbox"><br />
<br />
<div class="col-sm-4 panel-item"><br />
<a class="panel panel-circle-contrast" href="//rt.cac.cornell.edu/index.html"><br />
<div class="panel-icon"><br />
<i class="fa fa-question-circle fa-5x"></i><br />
</div><br />
<div class="panel-body text-center"><br />
<h4 class="panel-title">Contact support</h4><br />
<p>Submit a ticket or call 607-254-8691.</p><br />
</div><br />
</a><br />
</div><br />
</td> <br />
<td valign="top" class="mainpage_hubbox"><br />
<br />
<br />
<div class="col-sm-4 panel-item"><br />
<a class="panel panel-circle-contrast" href="/datafeed/status.aspx"><br />
<div class="panel-icon"><br />
<i class="fa fa-check-circle fa-5x"></i><br />
</div><br />
<div class="panel-body text-center"><br />
<h4 class="panel-title">Check operating status</h4><br />
<p>Plan ahead for CAC infrastructure downtimes.</p><br />
</div><br />
</a><br />
</div><br />
</td> <br />
</tr><br />
</table><br />
<br />
<br />
<table role="presentation" style="border:0; margin: 0;" width="100%" cellspacing="10"><br />
<tr><br />
<br />
<!-- POUR LA PREMIERE COLONNE: USER DOCUMENTATION --><br />
<td valign="top" id="mainpage_opportunitiescell"><br />
<div class="mainpage_boxtitle">USER DOCUMENTATION</div><br />
<div class="mainpage_boxcontents_small"><br />
<ul><br />
<li><a href="/wiki/index.php?title=Red_Cloud" >Red Cloud</a><span> - on-demand cloud services</span></li><br />
<li><a href="/wiki/index.php?title=GPUs_in_Red_Cloud" >GPUs in Red Cloud</a></li><br />
<li><a href="/wiki/index.php?title=Archival_Storage" >Archival Storage</a><span> - how to use and</span><a href="/wiki/index.php?title=Syncing_to_Archival_Storage"> sync directories</a> <span> to CAC Archival Storage</span> </li><br />
<li><a href="/wiki/index.php?title=Private_Clusters"> Private Clusters</a> <span> - maintained by CAC </span></li><br />
<li><a href="/wiki/index.php?title=Getting_Started_on_Private_Clusters">Getting Started on Private Clusters</a><span> - password rules, home directories, and more</span></li><br />
<li><a href="/wiki/index.php?title=File_Transfer_using_Globus">File Transfer using Globus</a><span> - high speed file transfers to/from CAC</span></li><br />
<li><a href="/wiki/index.php?title=MATLAB_Parallel_Server_in_Red_Cloud">MATLAB Parallel Server in Red Cloud</a></li><br />
</ul><br />
</div><br />
</td><br />
<br />
<!-- TRAINING & EDUCATION --><br />
<td valign="top" id="mainpage_opportunitiescell"><br />
<div class="mainpage_boxtitle">TRAINING & EDUCATION</div><br />
<div class="mainpage_boxcontents_small"><br />
<ul><br />
<li><a href="/education/Default.aspx"> CAC Education and Outreach</a> <span> - overview </span></li><br />
<li><a href="https://portal.xsede.org/training/course-catalog" >XSEDE Training</a><span> - CAC is training lead (NSF program)</span></li><br />
<li><a href="https://cvw.cac.cornell.edu/topics/">Cornell Virtual Workshop</a><span> - online training </span></li><br />
<li><a href="http://cse.cornell.edu/scan/" >SCAN</a><span> - Scientific Computing and Numerics seminar</span></li><br />
<li><a href="http://www.cse.cornell.edu/">Program in Computational Science and Engineering</a></li><br />
<li><a href="https://www.cac.cornell.edu/education/training.aspx">CAC Events</a></li><br />
</ul><br />
</div><br />
</td><br />
<br />
<br />
</tr><br />
</table><br />
<br />
</html></div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=Install_Python_Packages_in_a_Python_virtual_environment&diff=3524Install Python Packages in a Python virtual environment2021-04-30T17:24:57Z<p>Crm17: /* Create Virtual Environment */</p>
<hr />
<div>== Manage Modules in Your Python Virtual Environment ==<br />
<br />
Users can manage their own python environment (including installing needed modules) using virtual environments (works with python2 and python3). Please see [https://packaging.python.org/guides/installing-using-pip-and-virtual-environments the documentation on virtual environments on python.org] for details.<br />
<br />
=== Create Virtual Environment ===<br />
<br />
Users can '''create''' as many virtual environments, each in their own directory, as needed. Note: if you are running on a machine that uses the module system to configure your computing environment, you might first need to load the desired python module to gain access to the version of python you'd like to run, e.g., via <code>module load python/3.9.4</code>.<br />
<br />
* python2: <code>python2 -m virtualenv <your virtual environment directory></code><br />
<br />
* python3: <code>python3 -m venv <your virtual environment directory></code><br />
<br />
=== Activate Virtual Environment ===<br />
<br />
Next you need to '''activate''' a virtual environment before using it:<br />
<br />
<pre>source <your virtual environment directory>/bin/activate</pre><br />
<br />
=== Install Python Modules Using pip ===<br />
<br />
After activating your virtual environment, you can now install python modules for the activated environment:<br />
<br />
* NOTE: It's always a good idea to update <code>pip</code> first: <br />
<pre>pip install --upgrade pip</pre><br />
<br />
* Install the module:<br />
<pre>pip install <module name></pre><br />
<br />
* List installed python modules in the environment:<br />
<pre>pip list modules</pre><br />
<br />
=== Sample workflow ===<br />
<br />
* '''Example''': Create a new environment, and install <code>tensorflow</code> and <code>keras</code>:<br />
<br />
<pre><br />
$ module load python3 <br />
(note: python3 is an example, the actual module on the cluster you are using may be different)<br />
(use the "module avail" command to view the list of python versions you can load; it might be something like python/3.6)<br />
$ python3 -m venv tensorflow<br />
$ source tensorflow/bin/activate<br />
(tensorflow)$ pip install --upgrade pip<br />
Collecting pip<br />
Using cached https://files.pythonhosted.org/packages/30/db/9e38760b32e3e7f40cce46dd5fb107b8c73840df38f0046d8e6514e675a1/pip-19.2.3-py2.py3-none-any.whl<br />
Installing collected packages: pip<br />
Found existing installation: pip 18.1<br />
Uninstalling pip-18.1:<br />
Successfully uninstalled pip-18.1<br />
Successfully installed pip-19.2.3<br />
<br />
(tensorflow)$ pip install tensorflow keras<br />
Collecting tensorflow<br />
Using cached https://files.pythonhosted.org/packages/de/f0/96fb2e0412ae9692dbf400e5b04432885f677ad6241c088ccc5fe7724d69/tensorflow-1.14.0-cp36-cp36m-manylinux1_x86_64.whl<br />
:<br />
:<br />
:<br />
Successfully installed absl-py-0.8.0 astor-0.8.0 gast-0.2.2 google-pasta-0.1.7 grpcio-1.23.0 h5py-2.9.0 keras-2.2.5 keras-applications-1.0.8 keras-preprocessing-1.1.0 markdown-3.1.1 numpy-1.17.1 protobuf-3.9.1 pyyaml-5.1.2 scipy-1.3.1 six-1.12.0 tensorboard-1.14.0 tensorflow-1.14.0 tensorflow-estimator-1.14.0 termcolor-1.1.0 werkzeug-0.15.5 wheel-0.33.6 wrapt-1.11.2<br />
<br />
(tensorflow)$ pip list modules<br />
Package Version<br />
-------------------- -------<br />
absl-py 0.8.0 <br />
astor 0.8.0 <br />
gast 0.2.2 <br />
google-pasta 0.1.7 <br />
grpcio 1.23.0 <br />
h5py 2.9.0 <br />
Keras 2.2.5 <br />
Keras-Applications 1.0.8 <br />
Keras-Preprocessing 1.1.0 <br />
Markdown 3.1.1 <br />
numpy 1.17.1 <br />
pip 19.2.3 <br />
protobuf 3.9.1 <br />
PyYAML 5.1.2 <br />
scipy 1.3.1 <br />
setuptools 40.6.2 <br />
six 1.12.0 <br />
tensorboard 1.14.0 <br />
tensorflow 1.14.0 <br />
tensorflow-estimator 1.14.0 <br />
termcolor 1.1.0 <br />
Werkzeug 0.15.5 <br />
wheel 0.33.6 <br />
wrapt 1.11.2 <br />
</pre></div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=Install_Python_Packages_in_a_Python_virtual_environment&diff=3352Install Python Packages in a Python virtual environment2020-12-09T14:19:00Z<p>Crm17: /* Manage Modules in Your Python Virtual Environment */</p>
<hr />
<div>== Manage Modules in Your Python Virtual Environment ==<br />
<br />
Users can manage their own python environment (including installing needed modules) using virtual environments (works with python2 and python3). Please see [https://packaging.python.org/guides/installing-using-pip-and-virtual-environments the documentation on virtual environments on python.org] for details.<br />
<br />
=== Create Virtual Environment ===<br />
<br />
Users can '''create''' as many virtual environments, each in their own directory, as needed.<br />
<br />
* python2: <code>python -m virtualenv <your virtual environment directory></code><br />
<br />
* python3: <code>python3 -m venv <your virtual environment directory></code><br />
<br />
=== Activate Virtual Environment ===<br />
<br />
Next you need to '''activate''' a virtual environment before using it:<br />
<br />
<pre>source <your virtual environment directory>/bin/activate</pre><br />
<br />
=== Install Python Modules Using pip ===<br />
<br />
After activating your virtual environment, you can now install python modules for the activated environment:<br />
<br />
* NOTE: It's always a good idea to update <code>pip</code> first: <br />
<pre>pip install --upgrade pip</pre><br />
<br />
* Install the module:<br />
<pre>pip install <module name></pre><br />
<br />
* List installed python modules in the environment:<br />
<pre>pip list modules</pre><br />
<br />
=== Sample workflow ===<br />
<br />
* '''Example''': Create a new environment, and install <code>tensorflow</code> and <code>keras</code>:<br />
<br />
<pre><br />
$ module load python3 <br />
(note: python3 is an example, the actual module on the cluster you are using may be different)<br />
(use the "module avail" command to view the list of python versions you can load; it might be something like python/3.6)<br />
$ python3 -m venv tensorflow<br />
$ source tensorflow/bin/activate<br />
(tensorflow)$ pip install --upgrade pip<br />
Collecting pip<br />
Using cached https://files.pythonhosted.org/packages/30/db/9e38760b32e3e7f40cce46dd5fb107b8c73840df38f0046d8e6514e675a1/pip-19.2.3-py2.py3-none-any.whl<br />
Installing collected packages: pip<br />
Found existing installation: pip 18.1<br />
Uninstalling pip-18.1:<br />
Successfully uninstalled pip-18.1<br />
Successfully installed pip-19.2.3<br />
<br />
(tensorflow)$ pip install tensorflow keras<br />
Collecting tensorflow<br />
Using cached https://files.pythonhosted.org/packages/de/f0/96fb2e0412ae9692dbf400e5b04432885f677ad6241c088ccc5fe7724d69/tensorflow-1.14.0-cp36-cp36m-manylinux1_x86_64.whl<br />
:<br />
:<br />
:<br />
Successfully installed absl-py-0.8.0 astor-0.8.0 gast-0.2.2 google-pasta-0.1.7 grpcio-1.23.0 h5py-2.9.0 keras-2.2.5 keras-applications-1.0.8 keras-preprocessing-1.1.0 markdown-3.1.1 numpy-1.17.1 protobuf-3.9.1 pyyaml-5.1.2 scipy-1.3.1 six-1.12.0 tensorboard-1.14.0 tensorflow-1.14.0 tensorflow-estimator-1.14.0 termcolor-1.1.0 werkzeug-0.15.5 wheel-0.33.6 wrapt-1.11.2<br />
<br />
(tensorflow)$ pip list modules<br />
Package Version<br />
-------------------- -------<br />
absl-py 0.8.0 <br />
astor 0.8.0 <br />
gast 0.2.2 <br />
google-pasta 0.1.7 <br />
grpcio 1.23.0 <br />
h5py 2.9.0 <br />
Keras 2.2.5 <br />
Keras-Applications 1.0.8 <br />
Keras-Preprocessing 1.1.0 <br />
Markdown 3.1.1 <br />
numpy 1.17.1 <br />
pip 19.2.3 <br />
protobuf 3.9.1 <br />
PyYAML 5.1.2 <br />
scipy 1.3.1 <br />
setuptools 40.6.2 <br />
six 1.12.0 <br />
tensorboard 1.14.0 <br />
tensorflow 1.14.0 <br />
tensorflow-estimator 1.14.0 <br />
termcolor 1.1.0 <br />
Werkzeug 0.15.5 <br />
wheel 0.33.6 <br />
wrapt 1.11.2 <br />
</pre></div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=Pool_Cluster&diff=3351Pool Cluster2020-12-09T13:51:53Z<p>Crm17: /* Install_Python_Packages_in_a_Python_virtual_environment */</p>
<hr />
<div>== General Information ==<br />
:* POOL is a joint HPC cluster between two departments: '''Chemical and Biomolecular Engineering''' and '''Chemistry'''<br />
:* PIs are Fernando Escobedo (fe13), Don Koch (dlk15), Yong Joo (ylj2), Robert DiStasio (rad332), and Nandini Ananth (na346)<br />
:* Cluster access is restricted to these CAC groups: fe13_0001, dlk15_0001, ylj2_0001, rad332_0001, na346_0001<br />
:* Head node: '''pool.cac.cornell.edu''' ([[#How To Login|access via ssh]])<br />
:** [https://github.com/openhpc/ohpc/wiki OpenHPC] deployment running Centos 7<br />
:** Scheduler: slurm 18<br />
: <br />
:* Current Cluster Status: [http://pool.cac.cornell.edu/ganglia/ Ganglia].<br />
:* Home directories are provided for each group from 3 file servers.<br />
:** icsefs01 - serves fe13_0001<br />
:** icsefs02 - serves dlk15_0001 and ylj2_0001<br />
:** chemfs01 - serves rad332_0001 and na346_0001<br />
:* Data is generally <tt>'''NOT'''</tt> backed up (check with your PI for details).<br />
:* Please send any questions and report problems to: [mailto:cac-help@cornell.edu cac-help@cornell.edu]<br />
<br />
== How To Login ==<br />
:* To get started, login to the head node <tt>pool.cac.cornell.edu</tt> via ssh.<br />
:* You will be prompted for your [https://www.cac.cornell.edu/services/myacct.aspx CAC account] password<br />
:* If you are unfamiliar with Linux and ssh, we suggest reading the [[Linux Tutorial]] and looking into how to [[Connect to Linux]] before proceeding.<br />
:* NOTE: Users should not run codes on the head node. Users who do so will be notified and have privileges revoked.<br />
<br />
== Hardware and Networking ==<br />
:* The head node has 1.8TB local /scratch disk.<br />
:* Head node and 3 file servers have 10Gb connections.<br />
:* All compute nodes currently have a 1GB connections.<br />
:* [[Pool Hardware]] technical information.<br />
<br />
== Partitions ==<br />
"Partition" is the term used by slurm for designated groups of compute nodes<br />
<br />
:* ''hyperthreading is turned on in all nodes '''EXCEPT astra''''' <br />
:** where hyperthreading is turned on Slurm considers each core to consist of 2 logical CPUs<br />
:** for astra nodes Slurm considers each core to consist of 1 logical CPU<br />
:* all partitions have a default time of 1 hour and are set to OverSubscribe (per core scheduling vs per node)<br />
''Partitions on the pool cluster:''<br />
<br />
:{| class="wikitable" border="1" cellpadding="4" style="width: auto"<br />
! style="background:#e9e9e9;" | Queue/Partition<br />
! style="background:#e9e9e9;" | Number of nodes<br />
! style="background:#e9e9e9;" | Node Names<br />
! style="background:#e9e9e9;" | Limits<br />
! style="background:#e9e9e9;" | Group Access<br />
|-<br />
| '''common''' (default)<br />
| align="center" | 18<br />
| align="center" | c00[17,19,20,22,29-38,50-53]<br />
| align="center" | walltime limit: 168 hours (i.e. 7 days)<br />
| '''All Groups'''<br />
|-<br />
| '''plato''' <br />
| align="center" | 1<br />
| align="center" | c0009<br />
| align="center" | walltime limit: 168 hours (i.e. 7 days)<br />
| limited access per fe13<br />
|-<br />
| '''fe13''' <br />
| align="center" | 23<br />
| align="center" | c00[01-08,18,21,23,24,40-49,54]<br />
| align="center" | walltime limit: 168 hours (i.e. 7 days)<br />
| fe13_0001<br />
|-<br />
| '''dlk15''' <br />
| align="center" | 7<br />
| align="center" | c00[10-14,25,39]<br />
| align="center" | walltime limit: 168 hours (i.e. 31 days)<br />
| dlk15_0001<br />
|-<br />
| '''ylj2''' <br />
| align="center" | 5<br />
| align="center" | c00[15-16,26-28]<br />
| align="center" | walltime limit: 168 hours (i.e. 7 days)<br />
| ylj2_0001<br />
|-<br />
| '''vega''' <br />
| align="center" | 7<br />
| align="center" | c00[56-62]<br />
| align="center" | walltime limit: 168 hours (i.e. 7 days)<br />
| rad332_0001<br />
|-<br />
| '''astra''' <br />
| align="center" | 39<br />
| align="center" | c0[055,063-100]<br />
| align="center" | walltime limit: 720 hours (i.e. 30 days)<br />
| na346_0001<br />
|-<br />
|}<br />
<br />
== Running Jobs / Slurm Scheduler ==<br />
<br />
'''[[Slurm | CAC's Slurm page]]''' explains what Slurm is and how to use it to run your jobs. Please take the time to read this page, giving special attention to the parts that pertain to the types of jobs you want to run.<br />
:* NOTE: Users should not run codes on the head node. Users who do so will be notified and have privileges revoked. <br />
<pre><br />
A few slurm commands to initially get familiar with:<br />
<br />
sinfo -l<br />
scontrol show nodes<br />
scontrol show partition<br />
<br />
Submit a job: sbatch testjob.sh<br />
Interactive Job: srun -p common --pty /bin/bash<br />
<br />
scontrol show job [job id]<br />
scancel [job id]<br />
<br />
squeue -u userid<br />
</pre><br />
=== Slurm Examples & Tips ===<br />
NOTE: All lines begining with "#SBATCH" are a directive for the scheduler to read. If you want the line ignored (i.e. a comment), you must place 2 "##" at the beginning of your line.<br />
==== Example batch job to run in the partition: common ====<br />
<br />
Example sbatch script to run a job with one task (default) in the 'common' partition (i.e. queue):<br />
<br />
<pre><br />
#!/bin/bash<br />
## -J sets the name of job<br />
#SBATCH -J TestJob<br />
<br />
## -p sets the partition (queue)<br />
#SBATCH -p common<br />
<br />
## 10 min<br />
#SBATCH --time=00:10:00<br />
<br />
## sets the tasks per core (default=2 for hyperthreading: cores are oversubscribed)<br />
## set to 1 if one task by itself is enough to keep a core busy<br />
#SBATCH --ntasks-per-core=1 <br />
<br />
## request 4GB per CPU (may limit # of tasks, depending on total memory)<br />
#SBATCH --mem-per-cpu=4GB<br />
<br />
## define job stdout file<br />
#SBATCH -o testcommon-%j.out<br />
<br />
## define job stderr file<br />
#SBATCH -e testcomon%j.err<br />
<br />
echo "starting at `date` on `hostname`"<br />
<br />
# Print the Slurm job ID<br />
echo "SLURM_JOB_ID=$SLURM_JOB_ID"<br />
<br />
echo "hello world `hostname`"<br />
<br />
echo "ended at `date` on `hostname`"<br />
exit 0<br />
<br />
</pre><br />
<br />
Submit/Run your job:<br />
<pre><br />
sbatch example.sh<br />
</pre><br />
<br />
View your job:<br />
<pre><br />
scontrol show job <job_id><br />
</pre><br />
<br />
==== Example MPI batch job to run in the partition: common ====<br />
<br />
Example sbatch script to run a job with 60 tasks in the 'common' partition (i.e. queue):<br />
<br />
<pre><br />
#!/bin/bash<br />
## -J sets the name of job<br />
#SBATCH -J TestJob<br />
<br />
## -p sets the partition (queue)<br />
#SBATCH -p common<br />
<br />
## 10 min<br />
#SBATCH --time=00:10:00<br />
<br />
## the number of slots (CPUs) to reserve<br />
#SBATCH -n 60<br />
<br />
## the number of nodes to use (min and max can be set separately)<br />
#SBATCH -N 3<br />
<br />
## typically an MPI job needs exclusive access to nodes for good load balancing<br />
#SBATCH --exclusive<br />
<br />
## don't worry about hyperthreading, Slurm should distribute tasks evenly<br />
##SBATCH --ntasks-per-core=1 <br />
<br />
## define job stdout file<br />
#SBATCH -o testcommon-%j.out<br />
<br />
## define job stderr file<br />
#SBATCH -e testcommon-%j.err<br />
<br />
echo "starting at `date` on `hostname`"<br />
<br />
# Print Slurm job properties<br />
echo "SLURM_JOB_ID = $SLURM_JOB_ID"<br />
echo "SLURM_NTASKS = $SLURM_NTASKS"<br />
echo "SLURM_JOB_NUM_NODES = $SLURM_JOB_NUM_NODES"<br />
echo "SLURM_JOB_NODELIST = $SLURM_JOB_NODELIST"<br />
echo "SLURM_JOB_CPUS_PER_NODE = $SLURM_JOB_CPUS_PER_NODE"<br />
<br />
mpiexec -n $SLURM_NTASKS ./hello_mpi<br />
<br />
echo "ended at `date` on `hostname`"<br />
exit 0<br />
<br />
</pre><br />
<br />
==== To include or exclude specific nodes in your batch script ====<br />
<br />
To run on a specific node only, add the following line to your batch script:<br />
<pre><br />
#SBATCH -w, --nodelist=c0009<br />
</pre><br />
<br />
To include one or more nodes that you specifically want, add the following line to your batch script:<br />
<pre><br />
#SBATCH --nodelist=<node_names_you_want_to_include><br />
<br />
## e.g., to include c0006:<br />
#SBATCH --nodelist=c0006<br />
<br />
## to include c0006 and c0007 (also illustrates shorter syntax):<br />
#SBATCH -w c000[6,7]<br />
</pre><br />
<br />
To exclude one or more nodes, add the following line to your batch script:<br />
<br />
<pre><br />
#SBATCH -exclude=<node_names_you_want_to_exclude><br />
<br />
## e.g., to avoid c0006 through c0008, and c0013:<br />
#SBATCH -exclude=c00[06-08,13]<br />
<br />
## to exclude c0006 (also illustrates shorter syntax):<br />
#SBATCH -x c0006<br />
</pre><br />
<br />
==== Environment variables defined for tasks that are started with srun ====<br />
<br />
If you submit a batch job in which you run the following script with "srun -n $SLURM_NTASKS", you will see how the various environment variables are defined.<br />
<br />
<pre><br />
#!/bin/bash<br />
echo "Hello from `hostname`," \<br />
"$SLURM_CPUS_ON_NODE CPUs are allocated here," \<br />
"I am rank $SLURM_PROCID on node $SLURM_NODEID," \<br />
"my task ID on this node is $SLURM_LOCALID"<br />
</pre><br />
<br />
These variables are not defined in the same useful way in the environments of tasks that are started with mpiexec or mpirun.<br />
<br />
==== Use $HOME within your script rather than the full path to your home directory ====<br />
In order to access files in your home directory, you should use $HOME rather than the full path . <br />
To test, you could add to your batch script:<br />
<pre><br />
echo "my home dir is $HOME"<br />
</pre><br />
Then view the output file you set in your batch script to get the result.<br />
<br />
<br />
==== Copy your data to /tmp to avoid heavy I/O from your nfs mounted $HOME !!! ====<br />
* We cannot stress enough how important this is to avoid delays on the file systems.<br />
<br />
<pre><br />
#!/bin/bash<br />
## -J sets the name of job<br />
#SBATCH -J TestJob<br />
<br />
## -p sets the partition (queue)<br />
#SBATCH -p common<br />
## time is HH:MM:SS<br />
#SBATCH --time=00:01:30<br />
#SBATCH --cpus-per-task=15<br />
<br />
## define job stdout file<br />
#SBATCH -o testcommon-%j.out<br />
<br />
## define job stderr file<br />
#SBATCH -e testcommon-%j.err<br />
<br />
echo "starting $SLURM_JOBID at `date` on `hostname`"<br />
echo "my home dir is $HOME" <br />
<br />
## copying my data to a local tmp space on the compute node to reduce I/O<br />
MYTMP=/tmp/$USER/$SLURM_JOB_ID<br />
/usr/bin/mkdir -p $MYTMP || exit $?<br />
echo "Copying my data over..."<br />
cp -rp $SLURM_SUBMIT_DIR/mydatadir $MYTMP || exit $?<br />
<br />
## run your job executables here...<br />
<br />
echo "ended at `date` on `hostname`"<br />
echo "copy your data back to your $HOME" <br />
/usr/bin/mkdir -p $SLURM_SUBMIT_DIR/newdatadir || exit $?<br />
cp -rp $MYTMP $SLURM_SUBMIT_DIR/newdatadir || exit $?<br />
## remove your data from the compute node /tmp space<br />
rm -rf $MYTMP <br />
<br />
exit 0<br />
<br />
</pre><br />
<br />
Explanation: /tmp refers to a local directory that is found on each compute node. It is faster to use /tmp because when you read and write to it, the I/O does not have to go across the network, and it does not have to compete with the other users of a shared network drive (such as the one that holds everyone's /home).<br />
<br />
To look at files in /tmp while your job is running, you can ssh to the login node, then do a further ssh to the compute node that you were assigned. Then you can cd to /tmp on that node and inspect the files in there with <code>cat</code> or <code>less</code>.<br />
<br />
Note, if your application is producing 1000's of output files that you need to save, then it is far more efficient to put them all into a single tar or zip file before copying them into $HOME as the final step.<br />
<br />
==Software==<br />
=== LMOD Module System ===<br />
The 'lmod module' system is implemented to list and load software. Loading software via the module command will put you in the software environment requested. <br />
:For more information, type: '''module help'''<br />
:To list the available software type: '''module avail''' <br />
:To get a more complete listing, type: '''module spider'''<br />
:Software listed with "(L)" references it is already loaded. <br />
EXAMPLE:<br />
To be sure you are using the environment setup for gromacs, you would type:<br />
<pre><br />
module load gromacs/2019.1<br />
module list (you will see gromacs (L) to show it is loaded)<br />
* when done with gromacs, either logout and log back in or type:<br />
module unload gromacs/2019.1<br />
</pre><br />
<br />
You can create your own modules and place them in your $HOME. <br />
Once created, type:<br />
module use $HOME/path_to_personal/modulefiles<br />
This will prepend the path to $MODULEPATH<br />
[type '''echo $MODULEPATH''' to confirm]<br />
<br />
Reference: [http://lmod.readthedocs.io/en/latest/020_advanced.html User Created Modules]<br />
<br />
===Intel Compilers and Tools===<br />
The following Intel compilers are installed on the pool cluster<br />
* Intel Compiler 2020 - default (2020.4.304)<br />
* Intel Compiler 2019 (2019.2.187)<br />
* Intel MPI (2019.9.304)<br />
<br />
By default, GNU 8 compilers and OpenMPI are selected, but you can use any combinations of compilers and MPI:<br />
<br />
To switch from GNU8/OpenMPI environment to the Intel environment:<br />
<pre><br />
-bash-4.2$ module list<br />
<br />
Currently Loaded Modules:<br />
1) autotools 2) prun/1.3 3) gnu8/8.3.0 4) openmpi3/3.1.4 5) ohpc<br />
<br />
<br />
-bash-4.2$ module swap gnu8 intel<br />
<br />
Due to MODULEPATH changes, the following have been reloaded:<br />
1) openmpi3/3.1.4<br />
<br />
-bash-4.2$ module swap openmpi3 impi<br />
-bash-4.2$ module list<br />
<br />
Currently Loaded Modules:<br />
1) autotools 3) ohpc 5) impi/2019.9.304<br />
2) prun/1.3 4) intel/2020.4.304<br />
</pre><br />
<br />
=== Build software from source into your home directory ($HOME) ===<br />
:* It is usually possible to install software in your home directory $HOME.<br />
:* List installed software via rpms: '''rpm -qa'''. Use grep to search for specific software: rpm -qa | grep sw_name [i.e. rpm -qa | grep perl ]<br />
<pre><br />
* download and extract your source<br />
* cd to your extracted source directory<br />
./configure --./configure --prefix=$HOME/appdir<br />
[You need to refer to your source documentation to get the full list of options you can provide 'configure' with.]<br />
make<br />
make install<br />
<br />
The binary would then be located in ~/appdir/bin. <br />
* Add the following to your $HOME/.bashrc: <br />
export PATH="$HOME/appdir/bin:$PATH"<br />
* Reload the .bashrc file with source ~/.bashrc. (or logout and log back in)<br />
</pre><br />
===[[Install_Python_Packages_in_a_Python_virtual_environment|Install Python Packages in a Python virtual environment]] ===</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=Red_Cloud&diff=3299Red Cloud2020-11-05T19:33:50Z<p>Crm17: </p>
<hr />
<div>This wiki provides documentation for [https://{{SERVERNAME}}/redcloud Red Cloud], an on-demand research [https://en.wikipedia.org/wiki/Cloud_computing cloud computing] service maintained and supported by the [https://www.cac.cornell.edu/ CAC]. At present, Red Cloud is an Infrastructure as a Service (IaaS) based on [[OpenStack]].<br />
<br />
Instructions on these pages apply to users who have a [https://www.cac.cornell.edu/services/projects.aspx Red Cloud subscription] they are managing, though some instructions may also apply to users of subscriptions managed by someone else. Individuals who manage a Red Cloud subscription can create, administer, and delete virtual servers and storage in Red Cloud.<br />
<br />
__TOC__<br />
<br />
== How To Read This Documentation ==<br />
<br />
:* '''Exploratory Account Users'''<br />
:** Read through all the sections on this page targeting New Users.<br />
:** Look through the [[#Important Pages|Important Pages]] listed below to help you get started managing Red Cloud resources.<br />
:** Pay particular attention to the [[#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21|Accounting]] section on this page, as your exploratory project ends when you have exhausted your subscription.<br />
:** An important point to remember is that you are ''not'' the PI on your account, so you can ignore any instructions targeting PIs on a project.<br />
:* '''New Users'''<br />
:** Read through all the sections on this page targeting New Users.<br />
:** Look through the [[#Important Pages|Important Pages]] listed to help you get started managing Red Cloud resources.<br />
:** If you are ''not'' the PI on your account, you can ignore any instructions targeting PIs.<br />
:* '''Returning Users'''<br />
:** Check out the section dedicated to [[#All Users|all users]].<br />
:** You may also want to look through the [[#Important Pages|Important Pages]] listed to help you manage Red Cloud resources.<br />
:** If you are ''not'' the PI on your account, you can ignore any instructions targeting PIs.<br />
<br />
'''Note:''' All links on our wiki are colored red and underlined. Each of the external links will have dotted underlining and an icon next to them that looks like an arrow pointing out of a box, whereas internal links have a solid underline and do not have any icon. This can help you navigate by knowing that the external links are not part of our documentation or "how to" instructions.<br />
<br />
=== Important Pages ===<br />
<br />
Here is a suggested list of pages to look over to help with getting started managing resources.<br />
<br />
# '''This page''' - includes information about:<br />
#* The [[#First_Time_Login|first time you login]] to your [https://www.cac.cornell.edu/services/myacct.aspx CAC Account]<br />
#* [[#How_to_Access_Red_Cloud_Resources|Accessing resources]]<br />
#* [[#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21|Accounting]]<br />
# '''[[OpenStack]]''' - a '''highly recommended''' quick-start page including instructions for:<br />
#* The [[OpenStack#Using_the_OpenStack_Web_Interface_.28Horizon.29|Web interface]]<br />
#* [[OpenStack#Instances|Managing instances]] including:<br />
#** [[OpenStack#Launching an Instance|launching a new instance]]<br />
#** [[OpenStack#Instance_States|changing instance state]]<br />
# Either instructions for '''[[Red_Cloud_Linux_Instances|Linux Instances]]''' OR '''[[Red_Cloud_Windows_Instances|Windows Instances]]'''<br />
#* There are special instructions if you intend to use [[MATLAB Parallel Server in Red Cloud]]<br />
#* There is also a [[Linux Tutorial]] for those new to Linux system administration, or if you want a refresher<br />
# If you are planning to use '''GPUs in Red Cloud''':<br />
#* [[GPUs in Red Cloud]]<br />
#* [[Red Cloud GPU Image Usage]]<br />
<!-- #* [[Docker]] - coming soon --><br />
<br />
== New Users ==<br />
<br />
New users would be best served by reading this complete page first, then reading through the pages listed in the [[#Important Pages|Important Pages]] section. New users are also encouraged to explore the [[Getting Started]] page, which includes a lot more general information on using CAC resources beyond Red Cloud.<br />
<br />
'''Note for new Linux users:''' As the root user, you will have complete control over access to the system, such as setting up users and their permissions, defining the firewall, and more. This means that the primary user of a Linux system '''must be familiar with Linux system administration'''. Aside from the basics of using the command line, this includes familiarity with: creating and modifying users, installing software, configuring software for remote logins, and managing/transferring data. For users that want to use Red Cloud, but do not have much system administration experience, we've written a [[Linux Tutorial]] that should work for RedHat/CentOS and Ubuntu Linux systems. [https://{{SERVERNAME}}/services/ Consulting] is also available to answer general questions about systems administration, or for help on specific software and research problems.<br />
<br />
=== First Time Login === <br />
<br />
When you are added to a CAC project, you will receive an e-mail confirming your Red Cloud access. You must '''change the automatically generated password immediately''' for security reasons and to access computing resources. Refer to the instructions for [[Getting_Started#Managing_your_password|managing your password]] as needed.<br />
<br />
If you are a PI or a PI's proxy for a new project, verify that you have added a subscription to your project; see the [https://www.cac.cornell.edu/Services/projects/manage.aspx Manage Projects] page. After waiting up to an hour for account information to propagate, you will then be ready to download the [[OpenStack]] credentials and start managing Red Cloud resources.<br />
<br />
=== How to Create and Manage Red Cloud Resources ===<br />
<br />
Red Cloud is a private research cloud with an '''OpenStack''' backend. Interacting with OpenStack is how resources can be managed. In this case, resources can refer to [[OpenStack#Instances|instances]] (or [//en.wikipedia.org/wiki/Virtual_machine#Definitions virtual machines]), [[Images|images]], and [[Volumes|volumes]]. There are two ways to interact with OpenStack:<br />
<br />
:* '''The OpenStack Web Interface (Horizon)'''<br />
:** Go to the [//redcloud.cac.cornell.edu OpenStack Web Interface]<br />
:** For a walk-through, see the [[OpenStack]] page<br />
:* '''The Command-Line Interface (CLI) called the OpenStack CLI'''<br />
:** Linux command-line tools provided by [[OpenStack]]<br />
:** For a walk-through, see the [[OpenStack CLI]] page<br />
:** Also see the [https://docs.openstack.org/python-openstackclient/pike/ official OpenStack CLI documentation]<br />
<br />
'''Note:''' Regardless which method you choose (Web Interface or Command Line Interface), you must follow the [[#First Time Login | First Time Login]] instructions.<br />
<br />
=== How to Access Instances ===<br />
<br />
Depending on which operating system you are planning on running on your instances, you should also refer to one of the following pages:<br />
:* [[Red Cloud Linux Instances | Linux Instances]] - especially the [[Red_Cloud_Linux_Instances#Accessing_Instances|accessing instances]] section (also see [[Red_Cloud_Linux_Instances#Troubleshooting|troubleshooting]] if needed)<br />
:* [[Red Cloud Windows Instances | Windows Instances]] - especially the [[Red_Cloud_Windows_Instances#Accessing_Instances|accessing instances]] section<br />
<br />
=== Accounting: Don't Use Up Your Subscription by Accident! ===<br />
<br />
To understand how billing works, it is necessary to understand a bit about how Red Cloud operates. Red Cloud enables the user to [[OpenStack#Instance_States|control the state]] of system [//en.wikipedia.org/wiki/Virtual_machine#Definitions virtual machines (VMs)], such as start, pause, suspend, shelve, and delete (see [[OpenStack#Instance_States|Instance States]] for a full list). Since starting a VM allocates memory and CPU resources on a physical machine to that VM,''' subscriptions are billed based on the length of time a VM is running, even if it is idle and doing NO work for the user'''. This is fair because your running [[OpenStack#Instances|instance]] will prevent others from using the hardware, even if the hardware is idle.<br />
<br />
Thus, '''the best way to avoid using up your subscription''' needlessly is to make sure you [[OpenStack#Instance_States|'''''shelve''''']] your Red Cloud instance any time you are not using it. It is very simple to do this via the menu in the [[OpenStack#Using_the_OpenStack_Web_Interface_.28Horizon.29|OpenStack Web Interface]]. You can always start the instance again later, and the disk contents will be unchanged. It is just like shutting down your laptop.<br />
<br />
Whenever you have one or more instances that are up and running, the amount that is deducted from your Red Cloud subscription is: the length of time that your instances are running, multiplied by the number of cores that you are occupying with those instances. This implies that you should also take advantage of the various [[OpenStack#Instances|instance sizes]] available. For example, it is usually best to choose a small instance type to do your development work.<br />
<br />
It is worth pointing out that Red Cloud allows the [[Resizing an Instance| instance type]] to be changed if the VM is stopped (i.e. shut down). This allows you to "scale up" an instance at any time by stopping it, choosing a larger size for it, and starting it back up. You can shrink an instance in the same way. If you intend to use a large instance, we '''recommend''' that you start with the smallest instance size you can to install software and get used to your instance ''before'' [[Resizing an Instance|resizing your instance]] to the full size you would like.<br />
<br />
Here are a couple of motivating examples for you. Let's say you have an exploratory account, with just 165 core hours to start. If you leave a 1-core node running around the clock, you will use up the entire account in a little less than a week. Similarly, let's say you are on a CAC project with a Red Cloud subscription (8,585 core hours). If you start up an instance with 4 cores (sometimes called CPUs in [[OpenStack]]), and you leave the instance running for a week, or 168 hours, you will use up (168 hours)*(4 cores) or 672 core hours, or 8% of the subscription.<br />
<br />
All of the above is true for [[Red Cloud Linux Instances | Linux instances]] and [[Red Cloud Windows Instances | Windows instances]]; note that Cornell users do not need to pay for a [[Red Cloud Windows Instances#Windows_Activation|Windows license]] in Red Cloud.<br />
<br />
We recommend you check your balance frequently using pages provided for [https://{{SERVERNAME}}/services/cu/Memberlimits.aspx Cornell]<br />
or<br />
[https://{{SERVERNAME}}/services/external/Memberlimits.aspx external]<br />
users.<br />
<br />
== All Users ==<br />
<br />
Please refer to the [[OpenStack]] page for more in-depth guidance on how to use Red Cloud, and read either [[Red Cloud Linux Instances | Linux instances]] or [[Red Cloud Windows Instances | Windows instances]] based on what systems will be used. <br />
<br />
The current [https://www.cac.cornell.edu/RedCloud/status/ Red Cloud System Status] can be checked anytime.<br />
<br />
=== Common Tasks ===<br />
<br />
Here are some links to help you with particular aspects of using Red Cloud: <br />
:* [[Linux Tutorial]] - This may help you get up and running with some basic systems administration tasks. It is not intended to be comprehensive.<br />
:* Information on choosing [[Instance Types | instance type]] (the size of the virtual machine). [[Resizing volumes]]<!-- this likely needs to be a new page --> is a separate issue, and is somewhat more involved.<br />
:* [//it.cornell.edu/services/ezbackup/ EZ-backup] - a CIT solution for backups. Data stored on Red Cloud is not backed up by default; users are responsible for their own backups.<br />
:* Data in CAC [[Archival_Storage| Archival Storage]] is intended to be an additional copy of user data; CAC Archival Storage is not backed up or snapshotted.<br />
:* All CAC resources are suitable for unregulated, non-confidential data ([https://it.cornell.edu/security-and-policy/data-types-confidential-regulated-restricted-public reference] for details). <br />
<!-- :* [[GPUs in Red Cloud]] --><br />
<br />
===Acknowledging CAC===<br />
{{:Acknowledging CAC}}<br />
<br />
== Software on Red Cloud ==<br />
<br />
Generally, new instances launched on Red Cloud will contain basic operating system software and utilities, but will not contain pre-installed scientific applications. It is your responsibility to install any relevant applications either using a built-in package manager or by transferring your application code to the instance (e.g., via scp or sftp). In some cases, however, there are resources available to support running particular applications, as described below:<br />
:* On Linux instances, information on using package managers to install software: ( [[Linux Tutorial#Installing_Software | Using apt on Ubuntu]] ) ([[Linux Tutorial#Installing_Software_2 | Using yum on Centos]] )<br />
:* [[Installing R| Installing R]], a commonly used programming language and statistical analysis environment<br />
:* Running [[MATLAB Parallel Server in Red Cloud | MATLAB Parallel Server in Red Cloud]]<br />
:* Running [[OpenFOAM | OpenFOAM-7 in a Docker container]]<br />
:* Creating and using a [[Red Cloud GPU Image Usage | GPU Instance with pre-installed software]] (CUDA, NVIDIA Driver, Anaconda, Docker, Jupyter, MATLAB, etc.)<br />
<br />
== FAQ ==<br />
<br />
:* [[FAQ#Red_Cloud| Red Cloud FAQ]]</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3297OpenFOAM2020-11-04T22:18:59Z<p>Crm17: </p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 from The OpenFOAM Foundation as provided at https://github.com/OpenFOAM/OpenFOAM-7 . This material generally assumes you are familiar with OpenFOAM, and are mostly interested in learning how to run it in a container on Red Cloud.<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than is required. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that. The Docker container described here is intended to run on CPUs. While there are efforts to port OpenFOAM to GPUs, that is not currently supported by this container.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing the OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here three tutorials that are included in the $FOAM_TUTORIALS directory. The first two are small and simple enough that they can be run on the smallest Red Cloud instance, c1.m8. The last is a more complicated example run in parallel on a larger instance. Feel free to explore the contents of the $FOAM_TUTORIALS directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== icoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the cavity example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a motorbike with a rider on it. This example is configured to run using 8 processes (by dividing up the problem into 8 subdomains), which we can run on Red Cloud on a c8.m64 instance (or larger). The computation for this tutorial, even when run in a shorter -test mode (as specified below), runs for approximately 30 minutes on 8 cores, so you might not want to run this example unless you'd like to examine the output, or do something similar by adapting this example. (If you run the example without the -test option, it will carry out a much longer computation, so beware.) Like the other tutorials, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the motorBike example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun -test</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you want to get the data files with the results out of the docker container, you can copy the files from the container to your Red Cloud instance (and then perhaps transfer to your local machine using <code>scp</code> or <code>sftp</code>). Assuming you have exited the container as described in the line above, in order to copy the files out of the container, do the following:<br />
** Run <code>docker ps -a</code> to see a list of containers that have been run. There might be only one if you've run through these instructions just once. Find the Container ID of the container that you ran the OpenFOAM code in &mdash; we'll refer to this below as [CONTAINER_ID]. Alternatively, you can run <code>docker ps -alq</code> just to get the ID of the latest created container.<br />
** Make a directory in your Red Cloud instance to hold files from the container, e.g.: <code>mkdir tmp_container</code><br />
** Run <code>docker cp [CONTAINER_ID]:/home/openfoam tmp_container</code><br />
** The previous command should recursively copy all the contents of the /home/openfoam directory in the container to your tmp_container directory in the Red Cloud instance. The specific name of the directory under /home/openfoam will reflect the $WORK_DIR variable set in the examples above.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3291OpenFOAM2020-11-03T13:40:29Z<p>Crm17: /* Launch Instance */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 . This material generally assumes you are familiar with OpenFOAM, and are mostly interested in learning how to run it in a container on Red Cloud.<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than is required. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that. The Docker container described here is intended to run on CPUs. While there are efforts to port OpenFOAM to GPUs, that is not currently supported by this container.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing the OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here three tutorials that are included in the $FOAM_TUTORIALS directory. The first two are small and simple enough that they can be run on the smallest Red Cloud instance, c1.m8. The last is a more complicated example run in parallel on a larger instance. Feel free to explore the contents of the $FOAM_TUTORIALS directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== icoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the cavity example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a motorbike with a rider on it. This example is configured to run using 8 processes (by dividing up the problem into 8 subdomains), which we can run on Red Cloud on a c8.m64 instance (or larger). The computation for this tutorial, even when run in a shorter -test mode (as specified below), runs for approximately 30 minutes on 8 cores, so you might not want to run this example unless you'd like to examine the output, or do something similar by adapting this example. (If you run the example without the -test option, it will carry out a much longer computation, so beware.) Like the other tutorials, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the motorBike example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun -test</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you want to get the data files with the results out of the docker container, you can copy the files from the container to your Red Cloud instance (and then perhaps transfer to your local machine using <code>scp</code> or <code>sftp</code>). Assuming you have exited the container as described in the line above, in order to copy the files out of the container, do the following:<br />
** Run <code>docker ps -a</code> to see a list of containers that have been run. There might be only one if you've run through these instructions just once. Find the Container ID of the container that you ran the OpenFOAM code in &mdash; we'll refer to this below as [CONTAINER_ID]. Alternatively, you can run <code>docker ps -alq</code> just to get the ID of the latest created container.<br />
** Make a directory in your Red Cloud instance to hold files from the container, e.g.: <code>mkdir tmp_container</code><br />
** Run <code>docker cp [CONTAINER_ID]:/home/openfoam tmp_container</code><br />
** The previous command should recursively copy all the contents of the /home/openfoam directory in the container to your tmp_container directory in the Red Cloud instance. The specific name of the directory under /home/openfoam will reflect the $WORK_DIR variable set in the examples above.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3290OpenFOAM2020-11-03T13:37:19Z<p>Crm17: /* Run and Attach to Docker Container */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 . This material generally assumes you are familiar with OpenFOAM, and are mostly interested in learning how to run it in a container on Red Cloud.<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than is required. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing the OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here three tutorials that are included in the $FOAM_TUTORIALS directory. The first two are small and simple enough that they can be run on the smallest Red Cloud instance, c1.m8. The last is a more complicated example run in parallel on a larger instance. Feel free to explore the contents of the $FOAM_TUTORIALS directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== icoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the cavity example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a motorbike with a rider on it. This example is configured to run using 8 processes (by dividing up the problem into 8 subdomains), which we can run on Red Cloud on a c8.m64 instance (or larger). The computation for this tutorial, even when run in a shorter -test mode (as specified below), runs for approximately 30 minutes on 8 cores, so you might not want to run this example unless you'd like to examine the output, or do something similar by adapting this example. (If you run the example without the -test option, it will carry out a much longer computation, so beware.) Like the other tutorials, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the motorBike example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun -test</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you want to get the data files with the results out of the docker container, you can copy the files from the container to your Red Cloud instance (and then perhaps transfer to your local machine using <code>scp</code> or <code>sftp</code>). Assuming you have exited the container as described in the line above, in order to copy the files out of the container, do the following:<br />
** Run <code>docker ps -a</code> to see a list of containers that have been run. There might be only one if you've run through these instructions just once. Find the Container ID of the container that you ran the OpenFOAM code in &mdash; we'll refer to this below as [CONTAINER_ID]. Alternatively, you can run <code>docker ps -alq</code> just to get the ID of the latest created container.<br />
** Make a directory in your Red Cloud instance to hold files from the container, e.g.: <code>mkdir tmp_container</code><br />
** Run <code>docker cp [CONTAINER_ID]:/home/openfoam tmp_container</code><br />
** The previous command should recursively copy all the contents of the /home/openfoam directory in the container to your tmp_container directory in the Red Cloud instance. The specific name of the directory under /home/openfoam will reflect the $WORK_DIR variable set in the examples above.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3289OpenFOAM2020-11-02T14:41:06Z<p>Crm17: /* IcoFoam Cavity */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 . This material generally assumes you are familiar with OpenFOAM, and are mostly interested in learning how to run it in a container on Red Cloud.<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than is required. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here three tutorials that are included in the $FOAM_TUTORIALS directory. The first two are small and simple enough that they can be run on the smallest Red Cloud instance, c1.m8. The last is a more complicated example run in parallel on a larger instance. Feel free to explore the contents of the $FOAM_TUTORIALS directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== icoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the cavity example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a motorbike with a rider on it. This example is configured to run using 8 processes (by dividing up the problem into 8 subdomains), which we can run on Red Cloud on a c8.m64 instance (or larger). The computation for this tutorial, even when run in a shorter -test mode (as specified below), runs for approximately 30 minutes on 8 cores, so you might not want to run this example unless you'd like to examine the output, or do something similar by adapting this example. (If you run the example without the -test option, it will carry out a much longer computation, so beware.) Like the other tutorials, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the motorBike example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun -test</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you want to get the data files with the results out of the docker container, you can copy the files from the container to your Red Cloud instance (and then perhaps transfer to your local machine using <code>scp</code> or <code>sftp</code>). Assuming you have exited the container as described in the line above, in order to copy the files out of the container, do the following:<br />
** Run <code>docker ps -a</code> to see a list of containers that have been run. There might be only one if you've run through these instructions just once. Find the Container ID of the container that you ran the OpenFOAM code in &mdash; we'll refer to this below as [CONTAINER_ID]. Alternatively, you can run <code>docker ps -alq</code> just to get the ID of the latest created container.<br />
** Make a directory in your Red Cloud instance to hold files from the container, e.g.: <code>mkdir tmp_container</code><br />
** Run <code>docker cp [CONTAINER_ID]:/home/openfoam tmp_container</code><br />
** The previous command should recursively copy all the contents of the /home/openfoam directory in the container to your tmp_container directory in the Red Cloud instance. The specific name of the directory under /home/openfoam will reflect the $WORK_DIR variable set in the examples above.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3288OpenFOAM2020-10-30T20:35:42Z<p>Crm17: /* motorBike */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 . This material generally assumes you are familiar with OpenFOAM, and are mostly interested in learning how to run it in a container on Red Cloud.<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than is required. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here three tutorials that are included in the $FOAM_TUTORIALS directory. The first two are small and simple enough that they can be run on the smallest Red Cloud instance, c1.m8. The last is a more complicated example run in parallel on a larger instance. Feel free to explore the contents of the $FOAM_TUTORIALS directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the cavity example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a motorbike with a rider on it. This example is configured to run using 8 processes (by dividing up the problem into 8 subdomains), which we can run on Red Cloud on a c8.m64 instance (or larger). The computation for this tutorial, even when run in a shorter -test mode (as specified below), runs for approximately 30 minutes on 8 cores, so you might not want to run this example unless you'd like to examine the output, or do something similar by adapting this example. (If you run the example without the -test option, it will carry out a much longer computation, so beware.) Like the other tutorials, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the motorBike example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun -test</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you want to get the data files with the results out of the docker container, you can copy the files from the container to your Red Cloud instance (and then perhaps transfer to your local machine using <code>scp</code> or <code>sftp</code>). Assuming you have exited the container as described in the line above, in order to copy the files out of the container, do the following:<br />
** Run <code>docker ps -a</code> to see a list of containers that have been run. There might be only one if you've run through these instructions just once. Find the Container ID of the container that you ran the OpenFOAM code in &mdash; we'll refer to this below as [CONTAINER_ID]. Alternatively, you can run <code>docker ps -alq</code> just to get the ID of the latest created container.<br />
** Make a directory in your Red Cloud instance to hold files from the container, e.g.: <code>mkdir tmp_container</code><br />
** Run <code>docker cp [CONTAINER_ID]:/home/openfoam tmp_container</code><br />
** The previous command should recursively copy all the contents of the /home/openfoam directory in the container to your tmp_container directory in the Red Cloud instance. The specific name of the directory under /home/openfoam will reflect the $WORK_DIR variable set in the examples above.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3287OpenFOAM2020-10-30T20:15:50Z<p>Crm17: /* Cleaning Up */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 . This material generally assumes you are familiar with OpenFOAM, and are mostly interested in learning how to run it in a container on Red Cloud.<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than is required. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here three tutorials that are included in the $FOAM_TUTORIALS directory. The first two are small and simple enough that they can be run on the smallest Red Cloud instance, c1.m8. The last is a more complicated example run in parallel on a larger instance. Feel free to explore the contents of the $FOAM_TUTORIALS directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the cavity example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a motorbike with a rider on it. This example is configured to run using 8 processes (by dividing up the problem into 8 subdomains), which we can run on Red Cloud on a c8.m64 instance (or larger). The tutorial runs for approximately 30 minutes on 8 cores, so you might not want to run this example unless you'd like to examine the output, or do something similar by adapting this example. Like the other tutorials, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the motorBike example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you want to get the data files with the results out of the docker container, you can copy the files from the container to your Red Cloud instance (and then perhaps transfer to your local machine using <code>scp</code> or <code>sftp</code>). Assuming you have exited the container as described in the line above, in order to copy the files out of the container, do the following:<br />
** Run <code>docker ps -a</code> to see a list of containers that have been run. There might be only one if you've run through these instructions just once. Find the Container ID of the container that you ran the OpenFOAM code in &mdash; we'll refer to this below as [CONTAINER_ID]. Alternatively, you can run <code>docker ps -alq</code> just to get the ID of the latest created container.<br />
** Make a directory in your Red Cloud instance to hold files from the container, e.g.: <code>mkdir tmp_container</code><br />
** Run <code>docker cp [CONTAINER_ID]:/home/openfoam tmp_container</code><br />
** The previous command should recursively copy all the contents of the /home/openfoam directory in the container to your tmp_container directory in the Red Cloud instance. The specific name of the directory under /home/openfoam will reflect the $WORK_DIR variable set in the examples above.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3286OpenFOAM2020-10-30T20:14:40Z<p>Crm17: /* Cleaning Up */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 . This material generally assumes you are familiar with OpenFOAM, and are mostly interested in learning how to run it in a container on Red Cloud.<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than is required. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here three tutorials that are included in the $FOAM_TUTORIALS directory. The first two are small and simple enough that they can be run on the smallest Red Cloud instance, c1.m8. The last is a more complicated example run in parallel on a larger instance. Feel free to explore the contents of the $FOAM_TUTORIALS directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the cavity example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a motorbike with a rider on it. This example is configured to run using 8 processes (by dividing up the problem into 8 subdomains), which we can run on Red Cloud on a c8.m64 instance (or larger). The tutorial runs for approximately 30 minutes on 8 cores, so you might not want to run this example unless you'd like to examine the output, or do something similar by adapting this example. Like the other tutorials, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the motorBike example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you want to get the data files with the results out of the docker container, you can copy the files from the container to your Red Cloud instance (and then perhaps transfer to your local machine using <code>scp</code> or <code>sftp</code>). Assuming you have exited the container as described in the line above, in order to copy the files out of the container, do the following:<br />
** Run <code>docker ps -a</code> to see a list of containers that have been run. There might be only one if you've run through these instructions just once. Find the Container ID of the container that you ran the OpenFOAM code in &mdash; we'll refer to this below as [CONTAINER_ID]. Alternatively, you can run <code>docker ps -alq</code> just to get the ID of the latest created container.<br />
** Make a directory in your Red Cloud instance to hold files from the container, e.g.: <code>mkdir tmp_container</code><br />
** Run <code>docker cp [CONTAINER_ID]:/home/openfoam tmp_container</code><br />
** The previous command should recursively copy all the contents of the /home/openfoam directory in the container to your tmp_container directory. The specific name of the directory under /home/openfoam will reflect the $WORK_DIR variable set in the examples above.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3285OpenFOAM2020-10-30T20:05:52Z<p>Crm17: /* Tutorials */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 . This material generally assumes you are familiar with OpenFOAM, and are mostly interested in learning how to run it in a container on Red Cloud.<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than is required. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here three tutorials that are included in the $FOAM_TUTORIALS directory. The first two are small and simple enough that they can be run on the smallest Red Cloud instance, c1.m8. The last is a more complicated example run in parallel on a larger instance. Feel free to explore the contents of the $FOAM_TUTORIALS directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the cavity example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a motorbike with a rider on it. This example is configured to run using 8 processes (by dividing up the problem into 8 subdomains), which we can run on Red Cloud on a c8.m64 instance (or larger). The tutorial runs for approximately 30 minutes on 8 cores, so you might not want to run this example unless you'd like to examine the output, or do something similar by adapting this example. Like the other tutorials, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the motorBike example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you want to get the data files with the results out of the docker container, you can copy the files from the container to your Red Cloud instance (and then transfer to your local machine using scp or sftp). Assuming you have exited the container as described in the line above, in order to copy the files out of the container, do the following:<br />
** Run <code>docker ps -a</code> to see a list of containers that have been run. There might be only one if you've run through these instructions just once. Find the Container ID of the container that you ran the OpenFOAM code in &mdash; we'll refer to this below as [CONTAINER_ID]. Alternatively, you can run <code>docker ps -alq</code> just to get the ID of the latest created container.<br />
** Make a directory in your Red Cloud instance to hold files from the container, e.g.: <code>mkdir tmp_container</code><br />
** Run <code>docker cp [CONTAINER_ID]:/home/openfoam tmp_container</code><br />
** The previous command should recursively copy all the contents of the /home/openfoam directory in the container to your tmp_container directory. The specific name of the directory under /home/openfoam will reflect the $WORK_DIR variable set in the examples above.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3284OpenFOAM2020-10-30T20:00:59Z<p>Crm17: /* Cleaning Up */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 . This material generally assumes you are familiar with OpenFOAM, and are mostly interested in learning how to run it in a container on Red Cloud.<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than is required. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the cavity example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a motorbike with a rider on it. This example is configured to run using 8 processes (by dividing up the problem into 8 subdomains), which we can run on Red Cloud on a c8.m64 instance (or larger). The tutorial runs for approximately 30 minutes on 8 cores, so you might not want to run this example unless you'd like to examine the output, or do something similar by adapting this example. Like the other tutorials, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the motorBike example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you want to get the data files with the results out of the docker container, you can copy the files from the container to your Red Cloud instance (and then transfer to your local machine using scp or sftp). Assuming you have exited the container as described in the line above, in order to copy the files out of the container, do the following:<br />
** Run <code>docker ps -a</code> to see a list of containers that have been run. There might be only one if you've run through these instructions just once. Find the Container ID of the container that you ran the OpenFOAM code in &mdash; we'll refer to this below as [CONTAINER_ID]. Alternatively, you can run <code>docker ps -alq</code> just to get the ID of the latest created container.<br />
** Make a directory in your Red Cloud instance to hold files from the container, e.g.: <code>mkdir tmp_container</code><br />
** Run <code>docker cp [CONTAINER_ID]:/home/openfoam tmp_container</code><br />
** The previous command should recursively copy all the contents of the /home/openfoam directory in the container to your tmp_container directory. The specific name of the directory under /home/openfoam will reflect the $WORK_DIR variable set in the examples above.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3283OpenFOAM2020-10-30T20:00:21Z<p>Crm17: /* Cleaning Up */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 . This material generally assumes you are familiar with OpenFOAM, and are mostly interested in learning how to run it in a container on Red Cloud.<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than is required. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the cavity example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a motorbike with a rider on it. This example is configured to run using 8 processes (by dividing up the problem into 8 subdomains), which we can run on Red Cloud on a c8.m64 instance (or larger). The tutorial runs for approximately 30 minutes on 8 cores, so you might not want to run this example unless you'd like to examine the output, or do something similar by adapting this example. Like the other tutorials, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the motorBike example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you want to get the data files with the results out of the docker container, you can copy the files from the container to your Red Cloud instance (and then transfer to your local machine using scp or sftp). Assuming you have exited the container as described in the line above, in order to copy the files out of the container, do the following:<br />
** Run <code>docker ps -a</code> to see a list of containers that have been run. There might be only one if you've run through these instructions just once. Find the Container ID of the container that you ran the OpenFOAM code in &mdash; we'll refer to this below as [CONTAINER_ID]. Alternatively, you can run <code>docker ps -alq</code> just to get the container ID of the latest created container.<br />
** Make a directory in your Red Cloud instance to hold files from the container, e.g.: <code>mkdir tmp_container</code><br />
** Run <code>docker cp [CONTAINER_ID]:/home/openfoam tmp_container</code><br />
** The previous command should recursively copy all the contents of the /home/openfoam directory in the container to your tmp_container directory. The specific name of the directory under /home/openfoam will reflect the $WORK_DIR variable set in the examples above.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3282OpenFOAM2020-10-30T19:59:05Z<p>Crm17: </p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 . This material generally assumes you are familiar with OpenFOAM, and are mostly interested in learning how to run it in a container on Red Cloud.<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than is required. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the cavity example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a motorbike with a rider on it. This example is configured to run using 8 processes (by dividing up the problem into 8 subdomains), which we can run on Red Cloud on a c8.m64 instance (or larger). The tutorial runs for approximately 30 minutes on 8 cores, so you might not want to run this example unless you'd like to examine the output, or do something similar by adapting this example. Like the other tutorials, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the motorBike example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you want to get the data files with the results out of the docker container, you can copy the files from the container to your Red Cloud instance (and then transfer to your local machine using scp or sftp). Assuming you have exited the container as described in the line above, in order to copy the files out of the container, do the following:<br />
** Run <code>docker ps -a</code> to see a list of containers that have been run. There might be only one if you've run through these instructions just once. Find the Container ID of the container that you ran the OpenFOAM code in -- we'll refer to this below as [CONTAINER_ID]. Alternatively, you can run <code>docker ps -alq</code> just to get the container ID of the latest created container.<br />
** Make a directory in your Red Cloud instance to hold files from the container, e.g.: <code>mkdir tmp_container</code><br />
** Run <code>docker cp [CONTAINER_ID]:/home/openfoam tmp_container</code><br />
** The previous command should recursively copy all the contents of the /home/openfoam directory in the container to your tmp_container directory. The specific name of the directory under /home/openfoam will reflect the $WORK_DIR variable set in the examples above.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3281OpenFOAM2020-10-30T18:33:51Z<p>Crm17: /* Launch Instance */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 . This material generally assumes you are familiar with OpenFOAM, and are mostly interested in learning how to run it in a container on Red Cloud.<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than is required. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the cavity example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a motorbike with a rider on it. This example is configured to run using 8 processes (by dividing up the problem into 8 subdomains), which we can run on Red Cloud on a c8.m64 instance (or larger). The tutorial runs for approximately 30 minutes on 8 cores, so you might not want to run this example unless you'd like to examine the output, or do something similar by adapting this example. Like the other tutorials, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the motorBike example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3280OpenFOAM2020-10-30T18:32:56Z<p>Crm17: </p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 . This material generally assumes you are familiar with OpenFOAM, and are mostly interested in learning how to run it in a container on Red Cloud.<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than needed. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the cavity example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a motorbike with a rider on it. This example is configured to run using 8 processes (by dividing up the problem into 8 subdomains), which we can run on Red Cloud on a c8.m64 instance (or larger). The tutorial runs for approximately 30 minutes on 8 cores, so you might not want to run this example unless you'd like to examine the output, or do something similar by adapting this example. Like the other tutorials, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the motorBike example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3279OpenFOAM2020-10-30T18:32:37Z<p>Crm17: </p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 . This page generally assumes you are familiar with OpenFOAM, and are mostly interested in learning how to run it in a container on Red Cloud.<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than needed. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the cavity example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a motorbike with a rider on it. This example is configured to run using 8 processes (by dividing up the problem into 8 subdomains), which we can run on Red Cloud on a c8.m64 instance (or larger). The tutorial runs for approximately 30 minutes on 8 cores, so you might not want to run this example unless you'd like to examine the output, or do something similar by adapting this example. Like the other tutorials, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the motorBike example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3278OpenFOAM2020-10-30T18:30:34Z<p>Crm17: /* motorBike */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 .<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than needed. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the cavity example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a motorbike with a rider on it. This example is configured to run using 8 processes (by dividing up the problem into 8 subdomains), which we can run on Red Cloud on a c8.m64 instance (or larger). The tutorial runs for approximately 30 minutes on 8 cores, so you might not want to run this example unless you'd like to examine the output, or do something similar by adapting this example. Like the other tutorials, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the motorBike example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3277OpenFOAM2020-10-30T18:12:35Z<p>Crm17: /* IcoFoam Cavity */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 .<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than needed. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the cavity example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a motorbike with a rider on it. This example is configured to run using 8 processes, which we can run on Red Cloud on a c8.m64 instance (or larger). The tutorial runs for more than 10 minutes (on 8 cores). Like the other examples, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the motorBike example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3276OpenFOAM2020-10-30T18:12:19Z<p>Crm17: /* motorBike */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 .<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than needed. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a motorbike with a rider on it. This example is configured to run using 8 processes, which we can run on Red Cloud on a c8.m64 instance (or larger). The tutorial runs for more than 10 minutes (on 8 cores). Like the other examples, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the motorBike example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3275OpenFOAM2020-10-30T18:11:07Z<p>Crm17: /* IcoFoam Cavity */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 .<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than needed. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== motorBike ==<br />
<br />
This is a more computationally challenging example, simulating flow around a rider on a motorbike. This example is configured to run using 8 processes, which we can run on Red Cloud on a c8.m64 instance (or larger). The tutorial runs for more than 10 minutes (on 8 cores). Like the other examples, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3274OpenFOAM2020-10-30T18:10:34Z<p>Crm17: /* Tutorials */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 .<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than needed. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a more computationally challenging example, simulating flow around a rider on a motorbike. This example is configured to run using 8 processes, which we can run on Red Cloud on a c8.m64 instance (or larger). The tutorial runs for more than 10 minutes (on 8 cores). Like the other examples, we will want to run this in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike . <br />
cd motorBike<br />
</pre><br />
<br />
* Now run the simulation:<br />
** <code>./Allrun</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3273OpenFOAM2020-10-30T18:05:46Z<p>Crm17: /* Launch Instance */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 .<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than needed. The last of the tutorials described below is configured to run using 8 processes, so you would need to choose a c8.m64 instance to run that.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3272OpenFOAM2020-10-30T18:04:12Z<p>Crm17: /* Launch Instance */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 .<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. Depending on what sort of computation you want to run in OpenFOAM, you might want to choose a larger flavor with more memory and multiple cores to enable the code to run in parallel, but you will generally want to choose the smallest instance necessary to do your work so as not to use up your subscription more quickly than needed.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3271OpenFOAM2020-10-30T14:47:06Z<p>Crm17: /* Launch Instance */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 .<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. Instances come in various "flavors" comprised of different numbers of computational cores and total amount of memory available to those cores. See the [[OpenStack#Instances|Red Cloud Instances documentation]] for more information. You can choose whatever size (flavor) instance you need for your OpenFOAM computations, and will generally want to choose the smallest one necessary to do your work.<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3270OpenFOAM2020-10-30T14:40:31Z<p>Crm17: /* Launch Instance */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 .<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
To run OpenFOAM, you will need to launch an instance in Red Cloud. <br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3269OpenFOAM2020-10-30T14:39:17Z<p>Crm17: </p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]]. Specifically, these instructions involve the use of OpenFOAM-7 as provided at https://github.com/OpenFOAM/OpenFOAM-7 .<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3268OpenFOAM2020-10-30T14:34:56Z<p>Crm17: /* Launch Instance */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]].<br />
<br />
<br />
= Launch Instance =<br />
<br />
<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3246OpenFOAM2020-09-25T12:44:24Z<p>Crm17: </p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]].<br />
<br />
<br />
= Launch Instance =<br />
<br />
[<b>QUESTION FOR CAC REVIEW</b>: Do we want to provide any guidance here about what flavor of instance to launch? Can any of this OpenFOAM code be run in parallel, and if so, do we want to provide any instruction on how to do so?]<br />
<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3245OpenFOAM2020-09-25T12:43:47Z<p>Crm17: </p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]].<br />
<br />
[<b>QUESTION #1 FOR CAC REVIEW</b>: Do we want to provide any guidance here about what flavor of instance to launch? Can any of this OpenFOAM code be run in parallel, and if so, do we want to provide any instruction on how to do so?]<br />
<br />
<br />
= Launch Instance =<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3244OpenFOAM2020-09-25T12:36:47Z<p>Crm17: </p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]].<br />
<br />
[<b>QUESTION #1 FOR CAC REVIEW</b>: Do we want to provide any guidance here about what flavor of instance to launch? Can any of this OpenFOAM code be run in parallel, and if so, do we want to provide any instruction on how to do so?]<br />
<br />
[<b>QUESTION #2 FOR CAC REVIEW</b>: Is there a Dockerfile available that builds this container? Not something to show externally for users of this page, but I'm just curious to see it.]<br />
<br />
<br />
= Launch Instance =<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3243OpenFOAM2020-09-25T12:34:07Z<p>Crm17: /* Tutorials */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]].<br />
<br />
[<b>QUESTION #1 FOR CAC REVIEW</b>: Do we want to provide any guidance here about what flavor of instance to launch? Can any of this OpenFOAM code be run in parallel, and if so, do we want to provide any instruction on how to do so?]<br />
<br />
[<b>QUESTION #2 FOR CAC REVIEW</b>: Is there a repo and/or a Dockerfile anywhere that builds this container? Not something to show externally for users of this page, but I'm just curious to see it.]<br />
<br />
<br />
= Launch Instance =<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to explore the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3242OpenFOAM2020-09-25T12:27:32Z<p>Crm17: </p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]].<br />
<br />
[<b>QUESTION #1 FOR CAC REVIEW</b>: Do we want to provide any guidance here about what flavor of instance to launch? Can any of this OpenFOAM code be run in parallel, and if so, do we want to provide any instruction on how to do so?]<br />
<br />
[<b>QUESTION #2 FOR CAC REVIEW</b>: Is there a repo and/or a Dockerfile anywhere that builds this container? Not something to show externally for users of this page, but I'm just curious to see it.]<br />
<br />
<br />
= Launch Instance =<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to examine the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3241OpenFOAM2020-09-25T12:26:47Z<p>Crm17: /* Launch Instance */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]].<br />
<br />
= Launch Instance =<br />
<br />
[<b>QUESTION #1 FOR CAC REVIEW</b>: Do we want to provide any guidance here about what flavor of instance to launch? Can any of this OpenFOAM code be run in parallel, and if so, do we want to provide any instruction on how to do so?]<br />
<br />
[<b>QUESTION #2 FOR CAC REVIEW</b>: Is there a repo and/or a Dockerfile anywhere that builds this container? Not something to show externally for users of this page, but I'm just curious to see it.]<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to examine the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3240OpenFOAM2020-09-25T01:24:26Z<p>Crm17: /* pitzDaily */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]].<br />
<br />
= Launch Instance =<br />
<br />
[<b>QUESTION #1 FOR CAC REVIEW</b>: Is there a repo and/or a Dockerfile anywhere that builds this container? Maybe there is a way to extract that from the container, but if there is, the world of docker has not provided much in the way of useful information in that regard.]<br />
<br />
[<b>QUESTION #2 FOR CAC REVIEW</b>: Do we want to provide any guidance here about what flavor of instance to launch? Can any of this OpenFOAM code be run in parallel, and if so, do we want to provide any instruction on how to do so?]<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to examine the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence. They will run quickly (under a minute), and will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3239OpenFOAM2020-09-25T01:21:36Z<p>Crm17: /* pitzDaily */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]].<br />
<br />
= Launch Instance =<br />
<br />
[<b>QUESTION #1 FOR CAC REVIEW</b>: Is there a repo and/or a Dockerfile anywhere that builds this container? Maybe there is a way to extract that from the container, but if there is, the world of docker has not provided much in the way of useful information in that regard.]<br />
<br />
[<b>QUESTION #2 FOR CAC REVIEW</b>: Do we want to provide any guidance here about what flavor of instance to launch? Can any of this OpenFOAM code be run in parallel, and if so, do we want to provide any instruction on how to do so?]<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to examine the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's run the simulations. Execute these commands in sequence; they will run quickly (under a minute). They will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3238OpenFOAM2020-09-25T01:21:04Z<p>Crm17: </p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]].<br />
<br />
= Launch Instance =<br />
<br />
[<b>QUESTION #1 FOR CAC REVIEW</b>: Is there a repo and/or a Dockerfile anywhere that builds this container? Maybe there is a way to extract that from the container, but if there is, the world of docker has not provided much in the way of useful information in that regard.]<br />
<br />
[<b>QUESTION #2 FOR CAC REVIEW</b>: Do we want to provide any guidance here about what flavor of instance to launch? Can any of this OpenFOAM code be run in parallel, and if so, do we want to provide any instruction on how to do so?]<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to examine the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory, by executing the following commands within the docker bash shell:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's the simulations. Execute these commands in sequence; they will run quickly (under a minute). They will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3237OpenFOAM2020-09-25T01:18:46Z<p>Crm17: </p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]].<br />
<br />
= Launch Instance =<br />
<br />
[<b>QUESTION #1 FOR CAC REVIEW</b>: Is there a repo and/or a Dockerfile anywhere that builds this container? Maybe there is a way to extract that from the container, but if there is, the world of docker has not provided much in the way of useful information in that regard.]<br />
<br />
[<b>QUESTION #2 FOR CAC REVIEW</b>: Do we want to provide any guidance here about what flavor of instance to launch? Can any of this OpenFOAM code be run in parallel, and if so, do we want to provide any instruction on how to do so?]<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to examine the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, let's the simulations. Execute these commands in sequence; they will run quickly (under a minute). They will produce some printed output.<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3236OpenFOAM2020-09-25T01:11:45Z<p>Crm17: /* Launch Instance */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]].<br />
<br />
= Launch Instance =<br />
<br />
[<b>QUESTION #1 FOR CAC REVIEW</b>: Is there a repo and/or a Dockerfile anywhere that builds this container? Maybe there is a way to extract that from the container, but if there is, the world of docker has not provided much in the way of useful information in that regard.]<br />
<br />
[<b>QUESTION #2 FOR CAC REVIEW</b>: Do we want to provide any guidance here about what flavor of instance to launch? Can any of this OpenFOAM code be run in parallel, and if so, do we want to provide any instruction on how to do so?]<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to examine the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, we will run the simulations. Execute these commands in sequence; they will run quickly (under a minute).<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3235OpenFOAM2020-09-25T01:08:51Z<p>Crm17: </p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]].<br />
<br />
= Launch Instance =<br />
<br />
[<b>QUESTION #1 FOR CAC REVIEW</b>: Is there a repo and/or a Dockerfile anywhere that builds this container?]<br />
<br />
[<b>QUESTION #2 FOR CAC REVIEW</b>: Do we want to provide any guidance here about what flavor of instance to launch? Can any of this OpenFOAM code be run in parallel, and if so, do we want to provide any instruction on how to do so?]<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to examine the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, we will run the simulations. Execute these commands in sequence; they will run quickly (under a minute).<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3234OpenFOAM2020-09-24T22:10:21Z<p>Crm17: </p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]].<br />
<br />
= Launch Instance =<br />
<br />
[<b>QUESTION FOR CAC REVIEW</b>: Do we want to provide any guidance here about what flavor of instance to launch? Can any of this OpenFOAM code be run in parallel, and if so, do we want to provide any instruction on how to do so?]<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to examine the contents of that directory if you'd like to examine other tutorials.<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, we will run the simulations. Execute these commands in sequence; they will run quickly (under a minute).<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17https://www.cac.cornell.edu/wiki/index.php?title=OpenFOAM&diff=3233OpenFOAM2020-09-24T22:09:35Z<p>Crm17: /* IcoFoam Cavity */</p>
<hr />
<div>__TOC__<br />
<br />
This page describes how to run OpenFOAM in a docker container in [[Red_Cloud|Red Cloud]].<br />
<br />
= Launch Instance =<br />
<br />
[<b>QUESTION FOR CAC REVIEW</b>: Do we want to provide any guidance here about what flavor of instance to launch? Can any of this OpenFOAM code be run in parallel, and if so, do we want to provide any instruction on how to do so?]<br />
<br />
Launch a Red Cloud instance using the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image. See the [[Red_Cloud_Linux_Instances|Red Cloud Linux instances]] page on how to launch an instance, and the [[Images|Images]] page for more information about images on Red Cloud. You can launch an image either directly from the [https://redcloud.cac.cornell.edu/dashboard/ngdetails/OS::Glance::Image/291b6b05-b114-40a0-b244-d4334eec2618 openfoam-docker-2020-09-17] image page, or by following the general instructions for creating a Red Cloud Linux instance and choosing the openfoam-docker-2020-09-17 image as the source for the new instance.<br />
<br />
= Run and Attach to Docker Container =<br />
<br />
1. ssh to the Red Cloud instance <br />
<br />
* Because the openfoam-docker image is based upon an Ubuntu image, the username for your ssh command will be <code>ubuntu</code>, e.g., with a command such as:<br />
<br />
:: <code>ssh -i my_key.pem ubuntu@<IP address of your instance></code><br />
<br />
* See the documentation on [[Red_Cloud_Linux_Instances#Secure Shell (SSH)|Secure Shell (SSH)]] for more information on connecting to your instance.<br />
<br />
2. Run and attach a docker container containing OpenFOAM image: <code>docker container run -ti openfoam/openfoam7-paraview56</code><br />
<br />
* After executing this command, you should notice that the command prompt has changed, as the docker container is now running and is providing you with access to a separate bash shell running within the container.<br />
<br />
= Tutorials =<br />
<br />
We present here two tutorials that are included in the $FOAM_TUTORIALS directory. Feel free to examine the contents of that directory if you'd like to examine other tutorials.<br />
<br />
<br />
== pitzDaily ==<br />
<br />
This example is based on the experimental work of Pitz and Daily (1981). It features a backward facing step. Such a "classic" case is instructive for comparing different turbulence models with respect to the size and shape of the recirculation zone.<br />
<br />
* Now that you are running a bash shell within the OpenFOAM docker container, first make a unique working directory and copy the pitzDaily example code into the directory:<br />
<pre><br />
WORK_DIR=$FOAM_RUN-$(whoami)-$(date +%s) <br />
echo $WORK_DIR<br />
mkdir -p $WORK_DIR <br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .<br />
cd pitzDaily<br />
</pre><br />
<br />
* Next, we will run the simulations. Execute these commands in sequence; they will run quickly (under a minute).<br />
** <code>blockMesh</code><br />
** <code>simpleFoam</code><br />
<br />
* If you're curious about where those applications are within the container, you can make use of standard Linux commands to examine the PATH that has been set up within the container, and figure out where these applications are stored:<br />
** <code>echo $PATH</code><br />
** <code>which blockMesh</code><br />
<br />
<br />
== IcoFoam Cavity ==<br />
<br />
This is a second example that we will want to run in a separate subdirectory. First execute the following commands, in order to go back to the working directory ($WORK_DIR) and copy the code for the second example:<br />
<br />
<pre><br />
cd $WORK_DIR<br />
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity . <br />
cd cavity<br />
</pre><br />
<br />
* Now run the simulations:<br />
** <code>blockMesh</code><br />
** <code>icoFoam</code><br />
<br />
= Cleaning Up =<br />
<br />
* Once you are finished running within your docker container, you can issue the command <code>exit</code> to terminate the bash shell running within the container and return to the outer bash shell running in your Red Cloud instance.<br />
* If you are done using your instance for the time being, you can logout (<code>exit</code>) and then [[OpenStack#Instance_States | shelve]] your instance so that you do not continue to accrue charges to your Red Cloud subscription. See our documentation for [[Red_Cloud#Accounting:_Don.27t_Use_Up_Your_Subscription_by_Accident.21 | more information about managing your subscription]].</div>Crm17