Maps API | On‑Premise | 2GIS Documentation
On‑Premise

Updating maps API services

  1. Fetch new installation artifacts.

    To get artifacts for the MapGL JS API service only, add --services=mapgl-js-api after the pull command. Without this parameter artifacts for all services will be fetched by default.

    See the reference of DGCLI command-line arguments.

  2. Check out breaking changes. If necessary, update the settings in the values-mapgl.yaml configuration file. For more information, see the service installation instructions.

  3. Run the command to update the service:

    helm upgrade --version=1.32.0 --atomic --values ./values-mapgl.yaml mapgl-js-api 2gis-on-premise/mapgl-js-api
    
  4. Test if the update succeeded.

You can update the Tiles API service with or without simultaneously updating its data (the tiles themselves).

  1. Fetch new installation artifacts.

    • To update only the service image, add the --only-apps flag after the pull command.
    • To update only data, add the --only-data flag after the pull command.
    • To update both service and data, run the command without flags above.

    See the reference of DGCLI command-line arguments.

  2. Copy the path to a new manifest file from the command output and set it as a value to the dgctlStorage.manifest parameter in the values-tiles.yaml configuration file. For more information, see the service installation instructions.

    Important

    You can configure the process of importing new data for Tiles API. Use the importer settings group of the configuration file. If during a regular update of the Tiles API service you do not want to import new data, specify the manifest used for the previous import. In other cases, using a new manifest is recommended.

  3. Check out breaking changes. If necessary, update other settings in the values-tiles.yaml configuration file.

  4. Run the command to update the service:

    • To update the service only:

      helm upgrade --version=1.32.0 --atomic --wait --timeout 7200s --values ./values-tiles.yaml tiles-api 2gis-on-premise/tiles-api --set importer.enabled=false
      
    • To update data only, set the currently installed On-Premise version to the --version parameter:

      helm upgrade --version=VERSION --atomic --wait --timeout 7200s --values ./values-tiles.yaml tiles-api 2gis-on-premise/tiles-api
      
    • To update both the service and the data:

      helm upgrade --version=1.32.0 --atomic --wait --timeout 7200s --values ./values-tiles.yaml tiles-api 2gis-on-premise/tiles-api
      
  5. Test if the update succeeded.

  1. Fetch new installation artifacts.

    • To update only the service image, add the --only-apps flag after the pull command.
    • To update only data, add the --only-data flag after the pull command.
    • To update both service and data, run the command without flags above.

    To get artifacts for the Floors API service only, add --services=floors-api after the pull command. Without this parameter artifacts for all services will be fetched by default.

    See the reference of DGCLI command-line arguments.

  2. Copy the path to a new manifest file from the command output and set it as a value to the dgctlStorage.manifest parameter in the values-floors-api.yaml configuration file. For more information, see the service installation instructions.

    Important

    You can configure the process of importing new data for Floors API. Use the import settings group of the configuration file. If during a regular update of the Floors API service you do not want to import new data, specify the manifest used for the previous import. In other cases, using a new manifest is recommended.

  3. Check out breaking changes. If necessary, update other settings in the values-floors-api.yaml configuration file.

  4. Run the command to update the service:

    • To update the service only or both service and data:

      helm upgrade --version=1.32.0 --atomic --values ./values-floors-api.yaml floors-api 2gis-on-premise/floors-api
      
    • To update data only, set the currently installed On-Premise version to the --version parameter:

      helm upgrade --version=VERSION --atomic --values ./values-floors-api.yaml floors-api 2gis-on-premise/floors-api
      
  5. Test if the update succeeded.

To store data about tiles, the service uses Cassandra keyspaces.

If Cassandra's security settings allow automatic creation of keyspaces, a new keyspace is created during an upgrade and the service switches to it.

After switching, all the data in an older keyspace become obsolete. You can keep some of the previous keyspaces as a backup and delete the rest to free up disk space.

To automatically delete old data:

  1. Set the importer.cleaner.enabled parameter to true.

  2. Set the importer.cleaner.limit parameter to the amount of old keyspaces to keep. For example, 1 means that only one previous keyspace will be kept while all older ones will be deleted. In this case, you should reserve at least three keyspace sizes (temporary, current, and N previous ones) on the disk.

  3. By default, the deleted data still occupy disk space as a Cassandra table snapshot. You can delete the obsolete snapshots manually by using nodetool clearsnapshot, or you can configure automatic deletion via JMX:

    1. Make sure that remote JMX access is enabled in your Cassandra configuration.
    2. Specify the cassandra.credentials.jmxUser and cassandra.credentials.jmxPassword parameter values.
    3. Set the importer.clearSnapshots parameter to true.

You can apply a new style to the map or update a previously created one.

  1. Open the Style editor and create a new map style or edit an existing one.

    See instructions on creating and configuring styles in the Style editor documentation.

  2. Export the create style:

    1. In the top menu of the Style editor, select Share and then click Export the style.

    2. Select the required style from the list and click Export.

      Generation of an exportable archive starts in a new panel.

    3. When the style is in the Done status, select it from the list again and click Download the style.

    4. Save the generated .tar.gz archive locally.

  3. Upload the style to your On-Premise environment:

    1. Open the Platform Manager in a browser.

    2. Go to the Map Styles tab and click Upload Style.

    3. Add the exported .tar.gz archive and wait until it is uploaded.

      If you upload an updated version of an old style, its ID does not change. Platform Manager detects the update as a new version of an existing style. You can then switch between versions of one style.

  4. If you uplaoded a new style, copy the generated style ID and apply it to the map using MapGL JS API.

    If you uploaded an updated version of an old style, no additional steps are required.

Important

Before deleting a style, make sure that it is not applied to any active map. Otherwise, the map can be displayed incorrectly when the style is removed.

To delete a map style:

  1. Open the Platform Manager in a browser.
  2. Go to the Map Styles tab and click trash icon next to the selected style.