Quick start

    This topic is intended to help developers who are new to MOSN projects quickly set up a development environment for building, testing, packaging, and running the sample code.

    • If you want to run MOSN with docker, first.
    • If you are using a local machine, set up a Unix-like environment.
    • Install the compilation environment of Go.

    Obtain the code

    Code for MOSN projects is hosted at . Run the following command to obtain the code.

    If the go get command fails, manually create a project.

    1. cd $GOPATH/src
    2. # Create the mosn.io directory.
    3. mkdir -p mosn.io
    4. cd mosn.io
    5. git clone git@github.com:mosn/mosn.git
    6. cd mosn

    The MOSN source code is finally saved to $GOPATH/src/mosn.io/mosn.

    Import $GOPATH/src/mosn.io/mosn into your preferred Go IDE (Goland is recommended).

    Compile the code

    MOSN support xDS v2 and xDS v3, which are represented by Istio 1.5.2 and Istio 1.10.6 respectively. It can be switched between different versions according to needs. The default version is 1.10.6.

    Switch to Istio 1.5.2 (xDS v2)

    1. make istio-1.5.2

    Switch to Istio 1.10.6 (xDS v3)

    Run the following command to compile a local executable binary file.

    1. make build-local

    Find the compiled binary file in build/bundles/${version}/binary.

    Run the following command in the project’s root directory to start the integration test (which takes some time).

    1. make integrate
    2. make integrate-new

    Start MOSN from the configuration file

    Run the following command to start MOSN from the configuration file.

    1. ./mosn start -c '$CONFIG_FILE'

    Refer to the example projects in the directory to run samples.

    Build the Service Mesh platform with MOSN

    For more information, see the Istio integration.