Creating tasks for the UNIX/Linux environment

ArcGIS Server can execute geoprocessing tools residing in toolboxes found on a UNIX/Linux machine, and tools can reference data residing on UNIX/Linux machines. However, you can only author tools in ArcGIS Desktop, which runs on Windows only. This means that you must copy your toolboxes and map documents to the UNIX/Linux machine after you author them on Windows. These resources can then be published to ArcGIS Server.

Authoring tools for UNIX/Linux

The main issue for authoring tools for UNIX/Linux is paths. Windows uses the drive letter convention (D:\, for example) for local disks and the UNC convention for resources on the LAN (\\<host>\<directory>, for example). UNIX/Linux uses the forward-slash convention of /<host>/<directory> for paths. When you are authoring and testing your tools, you do so on Windows, so all your paths are using Windows convention. Before moving your tools to UNIX/Linux, you need to decide on a method that allows Windows paths to be converted to UNIX/Linux paths. There are several ways to do this:

Use relative paths to data

By far the easiest approach is to use the toolshare folder structure to store all data used by your tools. You then set the properties of your map documents, model tools, and script tools to store relative paths. You then copy the toolshare folder to the UNIX/Linux platform and publish the service using ArcGIS Server Manager. When tasks in the service execute, they can find all their data relative to the toolshare folder.

Use ArcMap layers

With this technique, you publish an ArcMap document containing tool layers. Your model and script tools use layers and tables in the ArcMap table of contents. You then do the following before copying your map document and toolboxes to UNIX/Linux:

  1. Open your ArcMap document and disable the option to store relative paths to data sources:
    1. In ArcMap, click File menu > Map Document Properties.
    2. On the properties dialog box, make sure the box Store relative pathnames to data sources is unchecked.
    3. Click OK to save the properties, then save the map document and exit.
  2. In the Catalog window, right-click your map document and click Set Data Source(s).
  3. On the Set Data Source(s) dialog box, provide the UNIX/Linux path to all layers, including sublayers of tool layers. (Changing sublayers of tool layers is necessary only if you are using a result map service.)
  4. After setting paths, close the dialog box and copy the map document and toolboxes to the UNIX/Linux machine.
  5. Publish the service by publishing the map document containing tool layers, not the toolbox.

Let ArcGIS Server convert Windows UNC paths

When a geoprocessing service is executing on UNIX/Linux, all Windows UNC paths (\\host\) are converted to UNIX/Linux convention (/host/). Local Windows paths (D:\) will not be converted.

This means you can mount the UNIX/Linux disk (/host/) on your Windows machine and refer to data on the mounted disk using the Windows UNC path (\\host\). You then copy your documents and toolboxes to the UNIX/Linux machine and publish.

Use a combination of these techniques

You can use a combination of these techniques. For example, some of your data could be stored relative to your toolbox, and your tools can use relative paths. For the subset of data not stored relative to your toolbox, you can use layers in the ArcMap document that references the data and convert the path before copying.

Known limitations in the UNIX/Linux environment

Although the main consideration is converting paths, there are two additional issues specific to services running on UNIX/Linux: the 100-character limit and lowercase dataset names. Both are described below.

100-character limit for GRID and coverage paths

There are two data formats that have restrictions on the number of characters in their path:

  • GRIDs (ESRI native raster format)
  • Coverages (ArcInfo Workstation features)

The total length of a GRID or coverage path cannot exceed 100 characters. Since intermediate and output data is written to the scratch workspace, the total number of characters in the scratch workspace cannot exceed 100.

Here is an example of the contents of %scratchworkspace%:

/disk/arcgisserver/arcgisjobs/drivetimepolygonsservice_gpserver/
jc01a0ddb3dc94455b8eb6629cf421798/scratch/

Portion of path

Number of characters

Description

/disk/arcgisserver/arcgisjobs/

30

Jobs directory. Since you or your system administrator set up the jobs directory, the number of characters is under your control.

drivetimepolygonsservice_gpserver/

34

Service name (_gpserver is automatically appended by ArcGIS Server). Since you name the service, the number of characters is under your control.

<folder name>

When publishing a service, you can designate a folder name. The name of this folder would appear here. The number of characters in the name of the folder is under your control.

jc01a0ddb3dc94455b8eb6629cf421798/scratch/

42

Unique job ID plus the scratch folder. This is defined by ArcGIS Server and is not under your control.

TOTAL

106

Number of characters in the scratch workspace path

In the above table, the path to the scratch workspace is 106 characters, which exceeds the 100-character limit. You would need to reduce this by 6 characters. In the above example, the easiest reduction is to rename the service from drivetimepolygonsservice to something shorter, like dtpolys.

Learn more about the jobs directory

Lowercase dataset names

GRIDs and coverages must have lowercase names on UNIX/Linux. Although these are the only two datasets that require lowercase names, you should establish the practice of using lowercase names for all datasets, including directory names.

Related Topics


3/6/2013