Working With ENVI Servers Tutorial
In this tutorial you will learn how to take advantage of ENVI Servers to run processes in the background. This frees you from having to wait for ENVI to finish whatever you ask it to do. You will also learn how to scale your processing power by setting up and using other ENVI Servers in a distributed environment. Jobs that would take hours or days on one machine can run in parallel on several computers, each running multiple jobs at the same time.
See the following sections:
- System Requirements
- Set Up an ENVI Server
- Run Tasks in the Background
- Run Models in the Background
- Perform Batch Processing in the ENVI Modeler
- Optional: Distributed Batch Processing Using Multiple ENVI Servers
System Requirements
You can designate one or more computers as ENVI Servers to run jobs. Each ENVI Server must have the following installed:
-
ENVI 5.6.1 or higher installed (note that versions 5.6.1 and higher include a Geospatial Services Framework (GSF) installer, which must also be installed)
- Windows or Linux operating system.
-
A valid license for ENVI and any additional modules that you might run on this server.
The next section describes how to get started with installing ENVI and GSF.
Set Up an ENVI Server
You can designate a local computer as an ENVI Server to run ENVI jobs in the background and in parallel. With parallel processing, you can run multiple jobs on one computer at the same time. Running jobs in the background means that you do not have to watch a progress bar while ENVI completes a process. You can continue working on your next task or visualizing images. You can even close ENVI, and ENVI Server will continue working on the jobs you submitted until they are done.
The following steps describe how to configure an ENVI Server on a local computer for personal use.
- Install ENVI using the default options.
- Use the License Administrator to license ENVI.
- Install GSF using the default options. GSF is a job scheduler application that will convert ENVI into ENVI Server.
When installation is complete, a web browser displays the Geospatial Services Framework page. This page contains examples, help, and links to the GSF job console and client SDKs. The URL for this page is http://localhost:9191, which is the server name that will be used for your local machine.
Run Tasks in the Background
The following steps demonstrate how to run a simple task in the background on your local ENVI Server. This allows you to complete other activities in ENVI while the job is running.
- Start ENVI.
- In the ENVI Toolbox, expand the Band Algebra folder and double-click Spectral Indices. The Data Selection dialog appears.
- Click the Open File button in the Data Selection dialog.
- Navigate to the
ENVIxx\data
folder of your ENVI installation path and selectqb_boulder_msi
. Click Open. - Click OK in the Data Selection dialog. The Spectral Indices dialog appears.
- In the Index list, select Green Difference Vegetation Index.
- Select the File radio button, and leave the Output Raster field blank.
- Click the drop-down arrow and select Run Task in the Background.
- When the job is complete, click the Display Results link in the job console to display the Green Difference Vegetation Index (GDVI) image in ENVI; for example:
- ENVI writes the GDVI image to a numbered folder in your GSF workspace. Click the folder icon to open that folder in Windows Explorer or Linux terminal window; for example:
- Click the icon in the job console to rerun the Spectral Indices task.
- Select any Index.
- Click the drop-down arrow and select Run Task in the Background.
- While that job is running, click the icon in the job console again, select another Index, and select Run Task in the Background. Repeat these steps as many times as you want.
The Spectral Indices task runs in the background while the ENVI Server Job Console displays. The job console reports the processing status of the job you submitted. You can continue to do other things in ENVI while the job is running.
Next, you will run more Spectral Indices jobs in the background.
The job console lists each job that you ran. You can click Display results to view each spectral index image that was created. The results of each job are written to a new numbered subfolder in your local GSF workspace.
Run Models in the Background
In this section you will run an ENVI Modeler model in the background on your local computer.
- From the ENVI main menu bar, select Display > ENVI Modeler. The ENVI Modeler appears.
- From the ENVI Modeler menu bar, select File > Open Example > Simple Model. The example model for Simple Model appears.
- Select the View node and press the Delete key on your keyboard to remove it from the model.
- In the Basic Nodes list, double-click Output Parameters to add an Output Parameters node to the model.
- Drag the Output Parameters node to the end of the model, then draw a connector between it and the Classification Smoothing node; for example:
- Click the drop-down arrow next to the Run button at the top of the ENVI Modeler, and select Run Model in the Background.
- When the model runs, you are prompted to select an Input Raster. Click the Browse button and select
qb_boulder_msi
from theENVIxx\data
folder of your installation path. - Click OK in the Data Selection dialog, then OK in the Input Raster dialog.
- While the model runs in the background, the job console shows its status; for example:
- When processing is complete, click the Display Results link in the job console to view the smoothed classification image.
This model performs ISODATA unsupervised classification and smooths the classification image. Notice the green-colored View and Data Manager nodes. When the model runs, it displays the resulting image in the current view and adds the result to the Data Manager. When you run models in the background, you should add an Output Parameters node to the models so that the results can be displayed in the job console. You will do this in the next step.
Next, you will learn how to batch-process multiple datasets in the ENVI Modeler.
Perform Batch Processing in the ENVI Modeler
In this section you will learn how to process multiple datasets in parallel on a local ENVI Server. Follow these steps:
- Select the Input Parameters node and the Data Manager node, then press the Del key on your keyboard to remove them from the model.
- In the Basic Nodes list, double-click Dataset. The Select Type dialog appears.
- Click Raster. A data selection dialog appears.
- Click the Open File button in the Data Selection dialog.
- Go to the
ENVIxx\data
folder of your installation path and selectAvon.dat
, then click Open. - In the Data Selection dialog, use Ctrl-click to select the following files and click OK:
Avon.dat
-
qb_boulder_msi
- Select both files in the Data Selection dialog and click OK.
- Drag the Dataset node to the front of the model as follows:
- In the Basic Nodes list, double-click Iterator to add an Iterator node to the model.
- Place the Iterator node between the Dataset node and ISODATA Classification node.
- Draw a connector between the Dataset node and the Iterator node.
- Draw a connector between the end of the Iterator node and the front of the ISODATA Classification node. The Connect Parameters dialog appears.
- Click the Output button on the left side of the Connect Parameters dialog. A red line connects Output to Input Raster:
- Click OK in the Connect Parameters dialog. The model should look like this:
- Click the button in the Iterator node. The Set ENVI Servers dialog appears.
- Click the Add Servers button in the Set ENVI Servers dialog.
- In the Add Servers dialog, select This Computer and click OK. The Set ENVI Servers dialog shows a URL of http://localhost:9191, which means that the jobs will run on your local ENVI Server.
- Click OK. The model is now ready to run.
- Click the Run button at the top of the ENVI Modeler. As the model runs, the ENVI Job Console shows two separate jobs, one for each input raster:
- When the jobs are complete, click the Display Results link next to each job. The smoothed classification image results from
Avon.dat
andqb_boulder_msi
are displayed in ENVI: - When you are finished, save the modified model to a new file on your local computer. Then close the ENVI Modeler and job console.
A blue-colored [Raster] Dataset node is added to the model.
The Iterator node allows you to batch-process both rasters (Avon.dat
and qb_boulder_msi
) specified in the Dataset node. If you were to run this model now, the rasters would be processed one at a time in the current ENVI session. The next steps describe how to run the model as multiple, parallel jobs on your local ENVI Server.
This was a simple example of running multiple jobs in the ENVI Modeler, each with a different input raster. By adding an Iterator node to the model and specifying the ENVI Server where the jobs will run, you split the work into parallel processes that both ran on the same ENVI Server.
You can also run tasks and models on multiple ENVI Servers. The next section describes how to configure ENVI Servers for distributed processing.
Optional: Distributed Batch Processing Using Multiple ENVI Servers
If you have more than one ENVI license, you can configure one or more ENVI Servers to be used as network resources for distributed processing. For example, you may have one local ENVI Server and three additional ENVI Servers on a network. This allows you to scale jobs even further by sending them to multiple computers working in parallel. Thus, all of the jobs can finish in a fraction of the time it would take for a single computer, especially if the other computers have powerful hardware and resources.
The following are general steps on how to install and configure the necessary software for multiple ENVI Servers:
- For each computer on your network, install ENVI and GSF. In the Configuration: External Address panel of the GSF installation process, note the external URL of the computer. You will need this later.
- Ensure that input data is in a shared location that the client and server computers can access.
-
Set the location of output files (also called the workspace in GSF) to a shared network location that all computers can access. To do this, open the file
config.json
in a text editor and add a"root"
value as shown below:"workspaceManager": {
"type":"gsf-basic-workspace-manager",
"root":"shared network directory"
Note: if you're running GSF as a Service, make sure the user that is the owner of the service has proper writing permissions to this shared network location.
- Stop and restart the GSF service so that the changes take effect.
- From the ENVI main menu bar, select Server > Manage Servers. The Manage ENVI Server dialog appears with "This Computer" as the only entry. "This Computer" is the local ENVI Server that you set up earlier. ENVI uses "localhost" as the URL for this ENVI Server.
- Click the Add button. The Add ENVI Server dialog appears.
- In the Server URL field, enter the URL of a server computer where ENVI and GSF are installed. See Step 1 above. The URL can be just the server name. A port number is not required as long as it is the default port (9191). For non-default ports, include the port number; for example:
- For the Workspace Folder, you have two options:
- Leave the field blank.
- Enter a shared network directory that both the local ENVI Server and remote ENVI Server can access.
- Click OK in the Add ENVI Server dialog.
- Select the new ENVI Server in the Manage ENVI Servers dialog. Click the Info button to display more information about that computer, including the software versions that are installed on it.
- Click OK to dismiss the Manage ENVI Servers dialog.
Now you are ready to run ENVI tasks and models on the ENVI Servers.
gsfserver:port_number
Now you can run tasks and models on the remote ENVI Server by clicking the drop-down arrow in the task dialog or ENVI Modeler and selecting Run Task/Model on remote computer name. Make sure the data you are processing is in a network location that can be accessed with the same path in both your local ENVI Server and remote ENVI Servers.
This concludes the tutorial. When you are finished, close ENVI.