Changes between Version 12 and Version 13 of docker


Ignore:
Timestamp:
11/16/20 16:15:39 (4 years ago)
Author:
downs
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • docker

    v12 v13  
    44= Installing Matlab on Docker =
    55
    6 To install Matlab on Docker you will nee to download the full installation files, in addition to a file installation key and license file. Under an academic headcount license through the Unversity of Montana, I was able to get an installation key and license by logging into my Mathworks account, going to the "install and activate" tab, then clicking "activate to retrieve license file" under related tasks. From there, click "active a computer". The Matlab license is tied to a specific username and MAC address, so in order to get it to work in docker, specify the login name as "root", which is the Docker default, and set the mac address to 02:42:ac:11:00:02. The license MAC address needs to match the MAC address in the Docker container, which can be specified at runtime.
     6To install Matlab on Docker you will nee to download the full installation files, in addition to a file installation key and license file. Under an academic headcount license through the Unversity of Montana. First create a directory to contain the installation files
     7
     8{{{
     9#!sh
     10mkdir issm_docker
     11mkdir issm_docker/license
     12}}}
     13
     14I was able to get an installation key and license by logging into my Mathworks account, going to the "install and activate" tab, then clicking "activate to retrieve license file" under related tasks. From there, click "active a computer". The Matlab license is tied to a specific username and MAC address, so in order to get it to work in docker, specify the login name as "root", which is the Docker default, and set the mac address to 02:42:ac:11:00:02. The license MAC address needs to match the MAC address in the Docker container, which can be specified at runtime.
    715
    816[[Image(shot1.png,800px)]]
     
    1220[[Image(shot2.png,800px)]]
    1321
    14 Next
    15 
    16 You can add the following lines to `~/.ssh/config` on your local machine if you are running ISSM from outside campus:
    17 {{{
    18 #!sh
    19 Host camhpc darwin login.hpc.cam.ac.uk
    20   HostName login.hpc.cam.ac.uk
    21   User YOURHPCUSERNAME
    22   ProxyCommand ssh YOURUSERNAME@citadel.ch.cam.ac.uk nc %h %p 2> /dev/null
    23   HostKeyAlias login.hpc.cam.ac.uk
    24 }}}
    25 If you can ssh to hpc directly (from campus), you don't need to go through citadel and you can log in directly:
    26 {{{
    27 #!sh
    28 Host camhpc darwin login.hpc.cam.ac.uk
    29   HostName login.hpc.cam.ac.uk
    30   User YOURHPCUSERNAME
    31 }}}
    32 and replace `YOURHPCUSERNAME` by your hpc username.
    33 
    34 Once this is done, you can ssh to HPC by simply doing:
     22Click continue and you will receive a file installation key and license file. Place the license file in issm_docker/license.
    3523
    3624{{{
    3725#!sh
    38 ssh camhpc
     26cp license.lic issm_docker/license
    3927}}}
    4028
    41 == Password-less ssh ==
     29Next you will need to download all  Matlab installation files. Download the Matlab installer from the license center, unzip the directory, and run the installer. Login with your Mathworks account, accept the license agreement, then under advanced options, select "I want to download without installing." I downloaded the installation files to issm_docker/R2020.
    4230
    43 Once you have the account, you can setup a public key authentification in order to avoid having to input your password for each run.
    44 You need to have a SSH public/private key pair. If you already have one, you can skip their creation described below. If you do not, you can create a SSH public/private key pair by typing the following command and following the prompts (no passphrase necessary):
    45 {{{
    46 #!sh
    47 $your_localhost% ssh-keygen -t rsa
    48 Generating public/private rsa key pair.
    49 Enter file in which to save the key (/Users/username/.ssh/id_rsa):RETURN
    50 Enter passphrase (empty for no passphrase):RETURN
    51 Enter same passphrase again:RETURN
    52 Your identification has been saved in /Users/username/.ssh/id_rsa.
    53 Your public key has been saved in /Users/username/.ssh/id_rsa.pub.
    54 }}}
    55 
    56 Two files were created: your private key `/Users/username/.ssh/id_rsa`, and the public key `/Users/username/.ssh/id_rsa.pub`. The private key is read-only and only for you, it is used to decrypt all correspondence encrypted with the public key. The contents of the public key need to be copied to `~/.ssh/authorized_keys` on your hoc account:
    57 
    58 {{{
    59 #!sh
    60 $your_localhost%scp ~/.ssh/id_rsa.pub username@your_remotehost:~
    61 }}}
    62 
    63 Now on '''HPC''', copy the content of id_rsa.pub:
    64 
    65 {{{
    66 #!sh
    67 $your_remotehost%cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
    68 $your_remotehost%rm ~/id_rsa.pub
    69 }}}
    70 
    71 == Environment ==
    72 
    73 On HPC, add the following lines to `~/.bashrc`:
    74 {{{
    75 #!sh
    76 export ISSM_DIR=PATHTOTRUNK
    77 source $ISSM_DIR/etc/environment.sh
    78 module load petsc/3.6.4
    79 }}}
    80 
    81 ''Log out and log back in'' to apply this change.
    82 
    83 == Installing ISSM on HPC  ==
    84 
    85 HPC will ''only'' be used to run the code, you will use your local machine for pre and post processing, you will never use HPC's matlab. You can check out ISSM and install the following packages:
    86  - automake (the one provided by default is too old)
    87  - m1qn3
    88 
    89 Use the following configuration script (adapt to your needs):
    90 
    91 {{{
    92 #!sh
    93 ./configure \
    94    --prefix=$ISSM_DIR \
    95    --with-wrappers=no \
    96    --with-kml=no \
    97    --with-bamg=no \
    98    --with-metis-dir="/usr/local/Cluster-Apps/petsc/3.6.4/intel12.1-impi/" \
    99    --with-petsc-dir="/usr/local/Cluster-Apps/petsc/3.6.4/intel12.1-impi/" \
    100    --with-m1qn3-dir="$ISSM_DIR/externalpackages/m1qn3/install" \
    101    --with-mpi-include="/usr/local/Cluster-Apps/intel/impi/4.1.3.045/include64/" \
    102    --with-mpi-libflags="-L/usr/local/Cluster-Apps/intel/impi/4.1.3.045/lib64 -lmpi" \
    103    --with-mkl-libflags="-L/usr/local/Cluster-Apps/intel/mkl/10.3.10.319/composer_xe_2011_sp1.10.319/mkl/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm" \
    104    --with-mumps-dir="/usr/local/Cluster-Apps/petsc/3.6.4/intel12.1-impi/" \
    105    --with-cxxoptflags="-DMPICH_IGNORE_CXX_SEEK -DMPICH_SKIP_MPICXX "
    106 }}}
    107 == camhpc_settings.m ==
    108 
    109 You have to add a file in `$ISSM_DIR/src/m` entitled `camhpc_settings.m` with your personal settings:
    110 
    111 {{{
    112 #!m
    113 cluster.login='nsa12';
    114 cluster.partition='sandybridge';
    115 cluster.project='ARNOLD-SL3';
    116 cluster.port=0;
    117 cluster.codepath='/home/nsa12/trunk-jpl/bin';
    118 cluster.executionpath='/home/nsa12/trunk-jpl/execution/';
    119 cluster.numnodes=1;
    120 cluster.cpuspernode=3;
    121 cluster.time=2;
    122 }}}
    123 
    124 use your username for the `login` and enter your code path and execution path. These settings will be picked up automatically by matlab when you do `md.cluster=camhpc()`
    125 
    126 == Running jobs on HPC ==
    127 
    128 On HPC, you can use up to XX cores per node. The more nodes and the longer the requested time, the more you will have to wait in the queue. Per job you can only request up to XXXGB of RAM. So choose your settings wisely:
    129 
    130  {{{
    131 #!m
    132 md.cluster=camhpc('numnodes',1,'cpuspernode',8);
    133 md.cluster.time=10;
    134 }}}
    135 
    136 to have a maximum job time of 10 minutes and 8 cores on one node. If the run lasts longer than 10 minutes, it will be killed and you will not be able to retrieve your results.
    137 
    138 Now if you want to check the status of your job and the queue you are using, type in:
    139 
    140  {{{
    141 #!sh
    142 squeue -u username
    143 }}}
    144 
    145 You can delete your job manually by typing:
    146 
    147 {{{
    148 #!sh
    149 scancel JOBID
    150 }}}
    151 
    152 where JOBID is the ID of your job (indicated in the Matlab session). Matlab indicates too the directory of your job where you can find the files `JOBNAME.outlog` and `JOBNAME.errlog`. The outlog file contains the informations that would appear if you were running your job on your local machine and the errlog file contains the error information in case the job encounters an error.
    153 
    154 If you want to load results from the cluster manually (for example if you have an error due to an internet interruption), you find in the informations Matlab gave you `$ISSM_DIR/execution/LAUNCHSTRING/JOBNAME.lock `, you copy the LAUNCHSTRING and you type in Matlab:
    155 
    156 {{{
    157 #!m
    158 md=loadresultsfromcluster(md,'LAUNCHSTRING');
    159 }}}