Preparations

Updated at:

Service Mesh decouples the software development kit (SDK) and runs it in a separate process. This allows your business process to focus on business logic. Service communication and administration components are organized into a mesh of sidecars to provide unified administration for heterogeneous networks. To use Service Mesh, you must publish a service. Before you publish a service, you must complete the required preparations.

Service Mesh supports SOFA, Dubbo, and Spring Cloud microservices. This topic uses a SOFABoot project as an example to help you get started with Service Mesh. The build, publishing, and management processes differ for each publishing method. The following sections describe the preparations for classic virtual machine publishing and container service publishing.

Demonstration video

Watch the following video to quickly learn how to make the required preparations:

The following table describes the time segments in the video.

Procedure

Time segment

1. Install the basic environment

Start–7:47

2. Create a project

7:48–14:26

3. Import SOFA middleware

14:27–18:24

4. Create the deployment package

18:25–19:24

5. Create an image

19:25–26:19

6. Upload the image

26:19–End

Classic virtual machine publishing

Classic virtual machine publishing requires you to deploy a JAR package. You can obtain the required JAR package in one of the following two ways:

Download a sample JAR package

Obtain a JAR package from a local project

  1. Set up the local environment.

    For more information, see Set up the environment.

  2. Generate a sample project.

    You can generate a demo project in one of the following two ways.

    • Create a project

      You can use Maven commands to create a web project and a core project. For more information, see Create a project.

    • Download a sample project

      You can download sample projects from the following links:

  3. Import SOFA middleware.

    For more information, see Import SOFA middleware.

  4. Open the command line and navigate to the project's root directory.

    For example, if the project root directory is D:\SOFABoot\web-app, run the following command:

  5. Run the following command to package the project.

    mvn clean package

    You can find the packaged project JAR file in the target folder of the root directory.

Container service publishing

Container service publishing requires you to deploy an image. You can prepare the required image in one of the following two ways:

Download a sample image

Ant Financial Technology provides a series of sample images. You can select an image based on the region where your application service is located. For a list of images, see Sample image list.

Use a local image

Alternatively, you can build a custom image locally and upload it to an Alibaba Cloud ACR image repository. The procedure is as follows:

  1. Create a local project.

    For more information, see Create a project.

  2. Create a custom image.

    1. Install Docker.

      The Docker version must be 1.6.0 or later. For installation steps, see the official Docker installation guide.

    2. Create the image.

      For more information, see Create a Docker image for a SOFABoot application.

  3. Upload the image.

    For more information about Finance (Gold) and non-Finance regions, see Finance regions (Gold Zones).

  4. You can obtain the image.

    1. Log on to the SOFAStack console.

    2. Choose Operations Management > Container Application Service > Image Center > Image Repository.

    3. Click the name of the image repository that you created when you uploaded the image.

    4. On the Image Repository Details page, click the copy icon复制 next to the image version to copy the registry address. The registry address consists of the repository address and the version. The following is an example:

      registry-vpc.cn-hangzhou-finance.aliyuncs.com/sofaboot-public/h****oot:1.0.0