Data Viz API Upgrade Guide From 2.0 to 3.0
This guide will help you upgrade the Data Viz API from 2.0 to 3.0.
Changes​
1. Data Viz API​
- The Data Viz API is now a standalone project and it is highly recommended to use the Docker image to run the Data Viz API rather than using submodules.
- We have migrated from Zuul to Spring Cloud Gateway.
- We have added superset proxy module to use it as a connection to Data Viz and superset.
- You can upgrade the Data Viz API by running the following command:
git rm services/api-commons
- Upgrade Your docker compose file to use the new Data Viz Modules images.
Commons​
- This is how to use the api-commons library in your project.
- In your
services/pom.xmlfile, do the following changes:
- Add the DG artifact repository while maintaining the Maven Central repository to your
pom.xmlfile:
services/pom.xml
<repositories>
<repository>
<id>central</id>
<name>Maven Central</name>
<url>https://repo.maven.apache.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>data-viz-release-local</id>
<name>data-viz-release-local</name>
<url>https://artifactory.dgdev.org/artifactory/data-viz-release-local/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
- Replace the old parent pom with the new one:
- pom.xml (New)
- pom.xml (Old)
services/pom.xml
<parent>
<groupId>org.devgateway.viz.api</groupId>
<artifactId>parent</artifactId>
<!-- Use the latest version of the parent pom -->
<version>0.0.9</version>
</parent>
services/pom.xml
<parent>
<groupId>org.devgateway.viz</groupId>
<artifactId>api-commons</artifactId>
<relativePath>api-commons/pom.xml</relativePath>
<version>0.0.1-SNAPSHOT</version>
</parent>
- Import the new commons library in your services:
services/example-service/pom.xml
<dependencies>
<dependency>
<groupId>org.devgateway.viz.api</groupId>
<artifactId>commons</artifactId>
<!-- Use the latest version of the commons library -->
<version>0.0.13</version>
</dependency>
</dependencies>
- If any of your services (micro-services) are using the
api-commonslibrary, you need to replace it with the new one.
API Registry (Eureka)​
- This is how to use the API Registry in the Data Viz API.
- Docker Compose (New)
- Docker Compose (Old)
docker-compose.yml
data-viz-api-registry:
image: registry.developmentgateway.org/data-viz/registry:latest
docker-compose.yml
api-registry:
image: ${REPO}/api-registry:${TAG}
build:
context: ../services
dockerfile: Dockerfile
API Gateway (Spring Cloud Gateway)​
- This is how to use the API Gateway in the Data Viz API.
- Docker Compose (New)
- Docker Compose (Old)
docker-compose.yml
api-gateway:
image: registry.developmentgateway.org/data-viz/api-gateway:latest
docker-compose.yml
api-gateway:
image: ${REPO}/api-gateway:${TAG}
build:
context: ../services/api-gateway
dockerfile: Dockerfile
API Security​
- Docker Compose (New)
- Docker Compose (Old)
docker-compose.yml
api-security:
image: registry.developmentgateway.org/data-viz/api-security:latest
docker-compose.yml
api-security:
image: ${REPO}/api-security:${TAG}
build:
context: ../services/api-commons
dockerfile: Dockerfile
Superset Proxy​
- This is how to use the Superset Proxy in the Data Viz API.
docker-compose.yml
superset-proxy:
image: registry.developmentgateway.org/data-viz/superset-proxy:latest