Using a task scheduler for geoprocessing within a production server environment

3566
11
10-29-2013 09:40 AM
BenjaminBauman
Occasional Contributor
Hi there,

We have a model that is being used for weekly processing. A Python script checks to see if a file exists within an assigned directory, and then triggers the model process. This is accomplished without intervention, through the use of the Windows 7 Task Scheduler. We are now in need of migrating this weekly process to our production server. This server does not contain ArcGIS for Desktop, only ArcGIS for Server. How can we maintain our hands-off weekly processing given this limitation? Would it be be possible to export the model into a Python script, convert it to an executable and then assign that to Windows Task Scheduler without the existence of ArcGIS for Desktop? Or is there an ArcGIS for Server feature for scheduling a geoprocessing service (assuming we publish the model)? It seems to me as if published services are more for distributed use, and given that we only need to use this internally, it is not entirely appropriate.
We have no access to our production server yet, so I am still unclear as to what we can and cannot do. Any advice would be greatly appreciated.
Tags (2)
0 Kudos
11 Replies
MichaelVolz
Esteemed Contributor
Can you please explain what your model does?

Maybe you can remotely call python that resides on your Windows 7 machine using software such as psexec.exe.  In this way you would get the proper python libraries that are only installed on that machine.  This might get confusing, so I would recommend trying to get ArcGIS Desktop installed directly on the ArcGIS Server server so you have the proper python libraries.
0 Kudos
KevinHibma
Esri Regular Contributor
Almost everything thats available in Desktop is available in Server.
(there are a few limitations on data types and certain tools that aren't supported, but for the most part, Server + arcpy does what Desktop + arcpy does).

I'd be willing to say, copy/paste everything you have on your Desktop, setup the scheduled task to call the Python script and it'll just work. (windows task scheduler calls Python that gets installed with Server)
You've said you have a model and a script that does some work (checks for a file). How is the model being called in the first place? By the script? If you're following that workflow, stick with it. No need to convert the model into Python.
0 Kudos
BenjaminBauman
Occasional Contributor
edit: Didn't see your post, khibma, before I posted. To answer your question, the model is being called by the script.
Because we do not have access to the server yet, and because ArcGIS for Server is still very foreign to me, I'm unclear how I would be able to copy/paste a model without ArcGIS for Desktop. Are you saying that I can simply place the toolbox that contains it within the production server directory?

The model does the following:

1.File rename (Python)
2.File validation (Python)
3.File filter (Python)
4.Geocoding (ESRI)
5.Spatial Joining (ESRI)
6. Quality Filter (Python)

Apparently the powers that be will not allow any desktop software on the production server, but the production server will soon be the required environment for weekly processing. Ugh, sounds like a catch-22.
0 Kudos
MichaelVolz
Esteemed Contributor
Kevin:

In my organization, we had a (process) server setup with just ArcGIS Desktop and python that is installed with that.  One of the scripts we had needed to turn off an ArcGIS Server geocode service before rebuilding an address locator due to service locks on the address locator.  We were unable to run this script until we installed ArcGIS Server on this server.  Would this indicate that python libraries to manage ArcGIS Server services are only available from the ArcGIS Server install and not included with the ArcGIS Desktop install?
0 Kudos
KevinHibma
Esri Regular Contributor
Do you mean these scripts? http://resources.arcgis.com/en/help/main/10.2/#/ArcGIS_Server_command_line_utilities/015400000626000...
I'm pretty sure that those files only get installed with Server.

As for everything else in arcpy; tools, functions, etc.... they're available in both Desktop and Server.
Python and the extra packages (matplotlib, numpy and a couple others) are exactly the same from DT to AGS, except AGS being 64bit.

Without seeing your script and knowing the error it would be hard to say exactly what Server had that Desktop didnt.
0 Kudos
KevinHibma
Esri Regular Contributor
edit: Didn't see your post, khibma, before I posted. To answer your question, the model is being called by the script.
Because we do not have access to the server yet, and because ArcGIS for Server is still very foreign to me, I'm unclear how I would be able to copy/paste a model without ArcGIS for Desktop. Are you saying that I can simply place the toolbox that contains it within the production server directory?


Think of it this way:
If I asked you to move your model to another directory on your Desktop machine, would it continue to work?
If you have relative paths and move the data appropriately, it should work.
If the paths aren't relative, then you'll need to make sure the model can continue to access the data. (again it probably should continue to work).
If it STOPS working, you probably have relative paths and the data is no longer relative to where the model thinks it should be.

This is the same scenario I'm proposing, except moving your model to a different machine. You don't need Desktop over there as long as the paths to the data all line up.

"Server" is just a headless Desktop (as a way to explain this scenario). It does everything Desktop does in terms of models, tools, data, there just isn't the nice user interface to interact with. So something like a model which you build in Desktop will work on the Server, you just can't modify it. You can use it just as is by making sure the data paths are correct when you move it.
0 Kudos
MichaelVolz
Esteemed Contributor
Kevin:

I am not using the scripts referenced in your link.  I am calling this line of code in a bat file:

"C:\Python27\ArcGISx6410.2\python.exe" "C:\Program Files\ArcGIS\Server\tools\admin\manageservice.py" -u username -p password -s https://server alias -t -n GIS_Services/Address.GeocodeServer -o stop
0 Kudos
KevinHibma
Esri Regular Contributor
Yeah, that's the same as I referenced in the link. Check the little code snippet at the bottom of the link, it's the same as you've posted pretty much.
Your bat file calls server admin scripts which are only installed by Server.

C:\Program Files\ArcGIS\Server\tools\admin\manageservice.py" 
0 Kudos
BenjaminBauman
Occasional Contributor
That's great news, Kevin. Thanks for your help.
0 Kudos