You must log in to edit wiki content.

ArcGIS

Using ArcGIS on the cluster to execute GIS tasks is based on using the embedded Python shell provided in ArcGIS Server 10.1. Each user must install the ArcGIS shell in their own account before running an interactive or batch job.

Install ArcGIS shell

Each user must install the embedded Python shell in ArcGIS Server 10.1 in their own account on the cluster one time. The install must be done on a compute node and it requires approximately 2GB of storage, so we recommend using /lustre or /archive.

The basics steps are

  • Define your workgroup
  • Connect to a compute node using qlogin
  • Run the install script /opt/shared/arcgis/bin/install-arcgis-10.1 <install_dir>
  • exit the compute node after the instation is complete

The following example shows the install steps for the ArcGIS shell in /archive/it_css/traine for the account traine in workgroup it_css on the Mills cluster.

[traine@mills ~]$ workgroup -g it_css
[(it_css:traine)@mills ~]$ qlogin
Your job 357310 ("QLOGIN") has been submitted
waiting for interactive job to be scheduled ...
Your interactive job 357310 has been successfully scheduled.
Establishing /opt/shared/OpenGridScheduler/local/qlogin_ssh session to host n015                               ...
[traine@n015 ~]$  /opt/shared/arcgis/bin/install-arcgis-10.1 /archive/it_css/train
Adding dependency `x11/RHEL6.1` to your environment
Adding package `openjdk/1.6.0` to your environment
[ArcGIS 10.1 for Server Installation Details]
UI Mode..................silent
Agreed to Esri License...yes
Authorization File......./opt/shared/arcgis/data/10.1/ArcGISforServerAdvancedEnterprise_server_194954.prvc
Installation Directory.../archive/it_css/traine/arcgis/server
 
Starting installation of ArcGIS 10.1 for Server...
...ArcGIS 10.1 for Server installation is complete.
 
You will be able to access ArcGIS Server Manager by navigating to http://n015:6080/arcgis/manager.
 
Killing 4 process(es) started by the installer...
 
Patching the init_Xvfb.sh script...
 
Adding ArcGIS shell startup script.  You can run the Python shell with the command
 
  /archive/it_css/traine/arcgis-10.1-shell
 
[traine@n015 ~]$  exit
exit
Connection to n015 closed.
/opt/shared/OpenGridScheduler/local/qlogin_ssh exited with exit code 0
[(it_css:traine)@mills ~]$

The ArcGIS shell script /archive/it_css/traine/arcgis-10.1-shell will only work for the account traine.

This install is based on the installation procedure documented for ArcGIS on a Linux cluster.

Batch job

In order to use the ArcGIS shell it needs to be installed in your account. For account traine in workgroup it_css, the ArcGIS shell was installed in /archive/it_css/traine/arcgis-10.1-shell. A python script is used to execute the GIS tasks like the arc-test.py below. This example refers to the full path of the input file as /lustre/work/it_css/ArcGIS and the output file as /lustre/work/it_css/traine/ArcGIS.

arc-test.py
# This example code produces a 100 Meter buffer of a point located in the center of Newark, DE
import arcpy
arcpy.Buffer_analysis("z:\\lustre\\work\\it_css\\ArcGIS\\nwkcntr.shp","z:\\lustre\\work\\it_css\\traine\\ArcGIS\\nwkcntr_Buffer","100 Meters","FULL","ROUND","NONE","#")

You will also need a queue submission file to run your GIS tasks which will be based on the serial.qs template in /opt/templates. The example below is a modified version called arc-submit.qs for the account traine in workgroup it_css using the installed ArcGIS shell in /archive/it_css/traine/arcgis-10.1-shell.

arc-submit.qs
# Setup the environment; add vpkg_require commands after this
# line:
source /opt/shared/valet/docs/valet.sh

# Now append all of your shell commands necessary to run your program
# after this line:

/archive/it_css/traine/arcgis-10.1-shell arc-test.py

Create a directory <ArcGIS_projects> to store your .py and .qs file. This is also the directory you most likely will want to reference for your input and output files. For account traine in workgroup it_css we will use /lustre/work/it_css/traine/ArcGIS. Now we can submit our batch run by using

[traine@mills ArcGIS]$ workgroup -g it_css
[(it_css:traine)@mills ArcGIS]$ qsub arc-submit.qs

Interactive job

All interactive jobs should be run on a compute node by setting your workgroup and using qlogin. For account traine in workgroup it_css, the ArcGIS shell was installed in /archive/it_css/traine/arcgis-10.1-shell. The same python script, arc-test.py, used for the batch job can be used for an interactive job.

Although there is no GUI with the ArcGIS shell, if it detects that your SSH connection is configured to enable X11-forwarding you will get an error unless you run an X-Windows server (e.g. Xming) or unset DISPLAY before running the ArcGIS shell.

Running X-Windows and DISPLAY set properly

The example below shows an ArcGIS interactive job with an X-Windows server running.

[traine@mills ArcGIS]$ workgroup -g it_css
[(it_css:traine)@mills ArcGIS]$ qlogin
Your job 357451 ("QLOGIN") has been submitted
waiting for interactive job to be scheduled ...
Your interactive job 357451 has been successfully scheduled.
Establishing /opt/shared/OpenGridScheduler/local/qlogin_ssh session to host n016 ...
[traine@n016 ArcGIS]$ /archive/it_css/traine/arcgis-10.1-shell
Adding package `x11/RHEL6.1` to your environment
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> execfile("arc-test.py")
>>> quit()
[traine@n016 ArcGIS]$

Troubleshooting

Not running X-Windows

ImportError: DLL load failed: DLL init failed

The example below shows an ArcGIS interactive job without an X-Windows server running. In this case the arc-test.py python script cannot load successfully. You must run an X-windows server like Xming with the DISPLAY set properly or unset DISPLAY before you run the ArcGIS shell as explained in the next section.

[traine@mills ArcGIS]$ workgroup -g it_css
[(it_css:traine)@mills ArcGIS]$ qlogin
Your job 357451 ("QLOGIN") has been submitted
waiting for interactive job to be scheduled ...
Your interactive job 357451 has been successfully scheduled.
Establishing /opt/shared/OpenGridScheduler/local/qlogin_ssh session to host n016 ...
[traine@n016 ArcGIS]$ /archive/it_css/traine/arcgis-10.1-shell
Adding package `x11/RHEL6.1` to your environment
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> execfile("arc-test.py")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "arc-test.py", line 1, in <module>
    import arcpy
  File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\__init__.py", line 21, in <module>
    from arcpy.geoprocessing import gp
  File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\geoprocessing\__init__.py", line 14, in <module>
    from _base import *
  File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\geoprocessing\_base.py", line 14, in <module>
    import arcgisscripting
ImportError: DLL load failed: DLL init failed
>>> quit()
[traine@n016 ArcGIS]$

unset DISPLAY

The example below shows an ArcGIS interactive job without an X-Windows server running. By using unset DISPLAY before we run the ArcGIS shell, we can successfully load arc-test.py python script. You will get a LIBGL error, however this can be ignored because ArcGIS shell does not use a GUI.

[traine@mills ArcGIS]$ workgroup -g it_css
[(it_css:traine)@mills ArcGIS]$ qlogin
Your job 357451 ("QLOGIN") has been submitted
waiting for interactive job to be scheduled ...
Your interactive job 357451 has been successfully scheduled.
Establishing /opt/shared/OpenGridScheduler/local/qlogin_ssh session to host n016 ...
[traine@n016 ArcGIS]$ unset DISPLAY
[traine@n016 ArcGIS]$ /archive/it_css/traine/arcgis-10.1-shell
Adding package `x11/RHEL6.1` to your environment
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> execfile("arc-test.py")
libGL error: failed to load driver: swrast
libGL error: Try again with LIBGL_DEBUG=verbose for more details.
>>> quit()
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":600"
      after 9 requests (7 known processed) with 0 events remaining.
[traine@n016 ArcGIS]$

Error: license expired

Although it is not obvious, if you are running X-windows and your display is set correctly, then you will get the following error if the license has expired with your installation of the ArcGIS shell. You need to update your ArcGIS shell installation with the updated license file. Below is an example for account traine in workgroup it_css and the ArcGIS shell was installed in /archive/it_css/traine/arcgis-10.1-shell displaying the error when the license is expired when we try to import arcpy for this ArcGIS shell.

[traine@mills traine]$ workgroup -g it_css
[(it_css:traine)@mills traine]$ qlogin
Your job 386764 ("QLOGIN") has been submitted
waiting for interactive job to be scheduled ...
Your interactive job 386764 has been successfully scheduled.
Establishing /opt/shared/OpenGridScheduler/local/qlogin_ssh session to host n016 ...
Last login: Wed Oct  2 16:31:09 2013 from mills.mills.hpc.udel.edu
[traine@n016 traine]$ /archive/it_css/traine/arcgis-10.1-shell
Adding package `x11/RHEL6.1` to your environment
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import arcpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\__init__.py", line 21, in <module>
    from arcpy.geoprocessing import gp
  File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\geoprocessing\__init__.py", line 14, in <module>
    from _base import *
  File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\geoprocessing\_base.py", line 578, in <module>
    env = GPEnvironments(gp)
  File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\geoprocessing\_base.py", line 575, in GPEnvironments
    return GPEnvironment(geoprocessor)
  File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\geoprocessing\_base.py", line 531, in __init__
    self._refresh()
  File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\geoprocessing\_base.py", line 533, in _refresh
    envset = (set(env for env in self._gp.listEnvironments()))
RuntimeError: NotInitialized
>>> quit()
[traine@n016 traine]$

Below is an example showing the command to update the license file for account traine in workgroup it_css and the ArcGIS shell was installed in /archive/it_css/traine/arcgis-10.1-shell.

[traine@n016 traine]$ /archive/it_css/traine/arcgis/server/tools/authorizeSoftware /opt/shared/arcgis/data/10.1/ArcGISforServerAdvancedEnterprise_server.prvc
--------------------------------------------------------------------------
Starting the ArcGIS Software Authorization Wizard

Run this script with --help for additional information.
--------------------------------------------------------------------------
Product          Ver   ECP#           Expires
-------------------------------------------------
arcsdeserver     101   ecp779682803   29-aug-2013
svrenterprise    101   ecp779682803   29-aug-2013
arcgisserver     101   ecp779682803   29-aug-2013
schematicssvr    101   ecp779682803   29-aug-2013
capacitysvr_4    101   ecp779682803   29-aug-2013
svradvanced      101   ecp779682803   29-aug-2013
3dserver         101   ecp258306197   29-aug-2013
spatialserver    101   ecp590549377   29-aug-2013
networkserver    101   ecp212515735   29-aug-2013
imageextserver   101   ecp620459725   29-aug-2013
interopserver    101   ecp420389825   29-aug-2013
jtxserver        101   ecp999933358   29-aug-2013
geostatserver    101   ecp069410712   29-aug-2013
businesssvr      101   ecp448526656   29-aug-2013
datareviewersvr  101   ecp558244029   29-aug-2013
geoportalextsvr  101   ecp499060465   29-aug-2013
arcsdeserver     101   ecp775725075   29-aug-2014
svrenterprise    101   ecp775725075   29-aug-2014
arcgisserver     101   ecp775725075   29-aug-2014
schematicssvr    101   ecp775725075   29-aug-2014
capacitysvr_4    101   ecp775725075   29-aug-2014
svradvanced      101   ecp775725075   29-aug-2014
3dserver         101   ecp336159020   29-aug-2014
spatialserver    101   ecp456452818   29-aug-2014
networkserver    101   ecp561164180   29-aug-2014
imageextserver   101   ecp947525102   29-aug-2014
interopserver    101   ecp442729701   29-aug-2014
jtxserver        101   ecp944603642   29-aug-2014
geostatserver    101   ecp228112209   29-aug-2014
businesssvr      101   ecp698202176   29-aug-2014
datareviewersvr  101   ecp296837188   29-aug-2014
geoportalextsvr  101   ecp937627605   29-aug-2014
geoeventsvr      101   ecp769559994   29-aug-2014
[traine@n016 traine]$

Error: existing output file

If the output file specified already exists, then an error smiliar to the one below is generated. The ArcGIS shell will not overwrite an existing output file. You must remove it before the run or specify a different file.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "arc-test.py", line 3, in <module>
    arcpy.Buffer_analysis("z:\\lustre\\scratch\\it_css\\ArcGISex\\nwkcntr.shp","z:\\lustre\\work\\it_css\\traine\\ArcGIS\\nwkcntr_Buffer","100 Meters","FULL","ROUND","NONE","#")
  File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\analysis.py", line 687, in Buffer
    raise e
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000725: Output Feature Class: Dataset z:\lustre\work\it_css\traine\ArcGIS\nwkcntr_Buffer.shp already exists.
Failed to execute (Buffer).
clusters/mills/arcgis.txt · Last modified: 2013-10-15 11:49 by anita