ArcGIS in Docker

From Wildsong
Revision as of 15:48, 10 October 2018 by Brian Wilson (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Objective

The moving parts are many. Get them running in Docker containers so I can easily spin up ESRI ArcGIS Enterprise and use it.

Status

Brian Wilson (talk) 15:48, 10 October 2018 (UTC) I basically stopped working on ArcGIS Enterprise when my 1 year developer license ran out, and I decided using open source for the GIS server component is a better idea.

I am working with version 10.5.1

I have these components working, but not persisting data, so every time I stop one I have to configure again.

  • ArcGIS Server
  • Portal for ArcGIS
  • Web Adaptor
  • Data Store

The Data Store needs an RDBMS backend, I will be using the SQL Server docker provided by Microsoft. I got Data Store set up but no RDBMS. I need to do this soon, so that it is useful!

Additionally there are more components that are optional, one I plan on setting up soon is

  • GeoEvent Server

I create a docker for each component. They all use Ubuntu Server, so I have a docker set up for that. I run Web Adaptor on Tomcat 8, so I have a tomcat8 docker.

Where do they hide the data?

I have an idea that I might be able to just use the official ESRI backup script(s) to create a backup of the data, confirm that I can restore, and then figure out what it's backing up. This begs the question:

How do I back up ArcGIS Enterprise?

The official resource: http://server.arcgis.com/en/server/latest/administer/linux/back-up-and-restore-your-arcgis-server-site-configuration.htm This page covers what they don't back up, too, which includes the Web Adaptor configuration, it says you have to reconfigure it every time, sigh. Later for that.

Backup utility for ArcGIS Server is documented here: http://server.arcgis.com/en/server/latest/administer/linux/backup-utility.htm

server/tools/admin/backup -u siteadmin -p password -s http://arcgis.wildsong.biz:6080/ -f backup_folder

It appears this could run over a network connection so I can in theory create a new Docker container that does backups.

The docs say it will create a ".agssite" file, which hopefully breaks with the long tradition of useless proprietary files and is in some format I can open and examine.

It says you can put a webadaptor URL in there for the site URL; I have not tried that yet.

When I run the command it says

$ Python can only be started by the install owner (arcgis).  This script must be run by the installation owner (arcgis)

Hmmm. Great. "backup" is a shell script that calls "python backup.py". "python" is also a shell script. The "python" script checks to see if the installer = the logged in user.

$ whoami
arcgis

Curious. Why do they feel a need to make things so complicated?

Now this part is interesting. It runs wine "C:/Python27/ArcGISx6410.5/python.exe". It must be invoking wine so that it can load special ESRI ArcPy code.

Indeed. After sourcing a script, it runs

source server/framework/etc/arcenv
wine "C:/Python27/ArcGISx6410.5/python.exe"
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import arcpy
>>>

Cool... arcpy on Linux... but I wonder why it won't run backup??

I finally figured out it is missing an environment variable, if I do this

export LOGNAME="arcgis"

then it runs.

Examining each docker

Another idea is to see what is getting written when I configure each component... that is the obvious way to do it.

Composing a swarm

Once things are limping along correctly and restartable I want to simplify config by creating "compose" files to tie everything together.