Skip to content

Tile server

DataRobot ships with a tile server that allows geospatial visualizations in the app to have a map in the background.

Downloading tiles

The Small Tiles url s included in the tileservergl subchart by default.

DataRobot provides tiles at different zoom levels which vary from few MBs up to 70 GB. Tiles with different levels of detail can be downloaded from the DataRobot S3 location.

  • Large tiles (69.1 GB): https://datarobot-geospatial.s3.amazonaws.com/geospatial-map-data/mbtiles/tiles-zoom-14-20191202.post1-dr.mbtiles
  • Medium tiles (4.0 GB): https://datarobot-geospatial.s3.amazonaws.com/geospatial-map-data/mbtiles/tiles-zoom-11-20191202.post1-dr.mbtiles
  • Small tiles (245 MB): https://datarobot-geospatial.s3.amazonaws.com/geospatial-map-data/mbtiles/tiles-zoom-08-20191202.post1-dr.mbtiles

A good practice is to start with the default Small tiles first and switch to larger tiles post-install if more detailed maps are required. Medium tiles would normally be quick to download and would not slow down the helm release upgrade process, whereas Large tiles might require significant time to distribute.

Note

If you use S3 as the shared data storage and plan to use tiles larger than 5GB, ensure that multipart uploads are enabled. they're enabled by default but may have been disabled by setting MULTI_PART_S3_UPLOAD to false in datarobot-modeling-envvars. To configure these options, refer to the Tuning DataRobot Environment Variables section of this guide.

Download different tiles

To download either the Medium or Large tile sets, adjust the tileservergl.tiles_url value in your installation umbrella chart and upgrade your DataRobot release.

In the values.yaml file, create or edit the tileservergl section. In the example below, the datarobot-generic umbrella chart is used and the section is added.

# helm chart values snippet
...
core:
  config_env_vars:
    LOGGING_LEVEL: INFO
...
# add this section to override the small tiles url in the tileservergl subchart, and have the Medium charts downloaded
tileservergl:
  init_tiles: true
  tiles_url: MEDIUM_TILES_URL

Installation in restricted network

The tile server installation starts with the initial job downloading the latest tiles from external sources to DataRobot internal storage (e.g., s3). With restricted network conditions (e.g., airgapped), this step is usually disabled in the helm chart (example as follows). Manually download the tiles after the Tile server app is started.

tileservergl:
  init_tiles: false  # disable init job downloading tiles from external source
To install the tile server in a restricted network, you must:

Find tile download URL

For available tile options and corresponding URLs, see the Downloading tiles section.

Download preparation

Before downloading, obtain the SHA sum of the tile to be downloaded. Use it later to compare with the SHA sum of the existing tile to determine whether the tile needs to be downloaded or updated. This step can be skipped if there is no tile ever downloaded.

  1. Find one installation node with internet access and the access to tileservergl-manager-* pod. You find the tileservergl-manager pod as follows:

    kubectl get pods -n <k8s-namespace> | grep "tileservergl-manager-"
    
  2. In the installation node, download and compute the tile SHA with the script below. Make sure to copy the tile SHA value—this is used later to compare the SHA of the existing tiles.

    #!/bin/bash
    
    URL=""  # replace this with the tile URL
    SHA_URL="${URL}.sha1sum"
    DST_FOLDER=""  # replace this with the folder path to download tile sha
    
    get_sha_sum () {
      local target_file="${DST_FOLDER}/$(basename ${SHA_URL})"
      local status_code=$(curl -s -o /dev/null -w "%{http_code}" "${SHA_URL}")
      local result="NO_SHA_SUM_FOUND"
      if [[ $status_code =~ ^2[0-9]{2}$ ]]; then
        curl -s -o "${target_file}" "${SHA_URL}"
        first_line="$(head -n 1 ${target_file})"
        if [[ -n $first_line ]]; then
          result="$(echo ${first_line} | awk '{print $1}')"
        fi
      fi
      echo "${result}"
    }
    
    SHA_SUM="$(get_sha_sum)"
    echo "sha value of ${SHA_URL} is : ${SHA_SUM} Copy this value for later use."
    
  3. Find the tileservergl-manager-* pod and shell into the tileservergl-manager container under it:

    kubectl get pods -n <k8s-namespace> | grep "tileservergl-manager-"
    kubectl exec -it <k8s-tileservergl-manager-pod-name> -n <k8s-namespace> -- sh
    
  4. Run the following script to check whether the existing tile is up to date:

    #!/bin/bash
    
    TILE_SHA_SUM=""  # replace this with tile sha sum from the previous step
    BASE=/opt/datarobot-runtime/app/DataRobot
    MANAGE_TILESERVER="${BASE}/sbin/datarobot-manage-tileservergl"
    EXPECTED_TILE_FILENAME="$(${MANAGE_TILESERVER} get-tileset-name --sha-value ${TILE_SHA_SUM})"
    
    if [[ -n "${EXPECTED_TILE_FILENAME}" ]]; then
      echo "existing mbtiles found. using ${EXPECTED_TILE_FILENAME}"
    else
      echo "mbtiles needs to be downloaded or sync to ${EXPECTED_TILE_FILENAME}"
    fi
    
    echo "Done"
    

Download and update tiles

If tile doesn’t exist or the existing tile isn't up to date, download, and update it. Note that only need to perform this step if it is necessary for your installation.

  1. In the installation node (with internet access), download tile:

    # Replace the URL with link for tiles you intend to install {: #replace-the-url-with-link-for-tiles-you-intend-to-install }
    curl https://datarobot-geospatial.s3.amazonaws.com/geospatial-map-data/mbtiles/tiles-zoom-08-20191202.post1-dr.mbtiles -o <downloaded-tiles>
    
  2. In the installation node, copy downloaded tile to /opt/datarobot-runtime/app/DataRobot/tiles-dist/ of tileservergl-manager container (under tileservergl-manager-* pod). /opt/datarobot-runtime/app/DataRobot/tiles-dist/ is the volume for temporarily storing tiles.

    TILE_DIR="/opt/datarobot-runtime/app/DataRobot/tiles-dist/" # volume mounted to tileservergl-manager container
    
    kubectl cp <downloaded-tiles> <k8s-namespace>/<k8s-tileservergl-manager-pod-name>:$TILE_DIR
    
  3. In the tileservergl-manager container, run tile management command to update the tileserver with downloaded tiles:

    #!/bin/bash
    
    BASE=/opt/datarobot-runtime/app/DataRobot
    MANAGE_TILESERVER="${BASE}/sbin/datarobot-manage-tileservergl"
    TILE_FILE_NAME=""  # replace this with uploaded tile name
    TILE_FILE_PATH="/opt/datarobot-runtime/app/DataRobot/tiles-dist/${TILE_FILE_NAME}"
    
    $MANAGE_TILESERVER push --tileset $TILE_FILE_PATH
    $MANAGE_TILESERVER list
    $MANAGE_TILESERVER switch --tileset $TILE_FILE_PATH
    
  4. Clean up tile in /opt/datarobot-runtime/app/DataRobot/tiles-dist/:

    TILE_FILE_NAME=""  # replace this with uploaded tile name
    TILE_FILE_PATH="/opt/datarobot-runtime/app/DataRobot/tiles-dist/${TILE_FILE_NAME}"
    
    rm $TILE_FILE_PATH  # clean up the tiles in the temp directory