This is the third day of my participation in the November Gwen Challenge. Check out the details: the last Gwen Challenge 2021

preface

I recently needed to do some functional extensions to SkyWalking, sorting out the steps for configuring the development environment on your idea. Provided by the website have install the steps in the IntelliJ IDEA: How to build the project | Apache SkyWalking, but more patchy, and which may be due to personal environment, some not expected, under the share.

The environment

  • Computers: MacBook Pro (16-inch, 2019) with original OS
  • OS: MAC OS X, Version: 10.15.7, ARCH: x86_64
  • IntelliJ IDEA: Final version 2020.2
  • WebStorem: 2020.3
  • The JDK: 1.8.0 comes with _271
  • Maven: the Apache maven 3.6.3
  • NPM: 7.13.0
  • Git: 2.15.0
  • Skywalking: 8.5.0

The environment is important. For example, if you do not use the MAC OS, some of the following commands should be adjusted according to your environment. If the version of IDEA is older than the version I am using, some of the auto-id configuration features may not be friendly enough, so the steps I documented below may not be fully applicable.

Source code address

Although SkyWalking is mainly divided into several parts, such as backend OAP, UI, Agent, etc. But the back-end code and UI are primarily in two Git repositories:

The backend is: github.com/apache/skyw…

The UI section is at: github.com/apache/skyw…

The UI is a submodule that acts as a back-end repository.

Idea can be directly built from the front and back end of the release package, but development, need to configure the front and back end of the development environment.

Back-end configuration steps

  1. Cloning code
git clone --recurse-submodules https://github.com/apache/skywalking.git
Copy the code

The actual size of the total code file is not small. If the connection to Github network is unstable and the clone fails, you can consider setting up proxy and other solutions.

Download complete, first open the project without IDEA.

  1. compile

Run the following command in the project root directory:

mvn compile -Dmaven.test.skip=true
Copy the code

I compiled it in 5 minutes.

You can also directly execute the package package to test whether your environment can be successfully packaged and published:

mvn package -Dmaven.test.skip=true
Copy the code

If errors such as NPM install node or NPM run build occur during the execution, the network may be faulty. The solution is as follows:

Modify frontend- Maven-plugin in POP. XML under the APM-webApp module to the following configuration:

install -g cnpm --registry=https://registry.npm.taobao.org
Copy the code

Then re-execute the package command and wait until the plug-in is finished or an error occurs:

  1. Opening a project with IDEA, introducing dependencies, etc., may take some time, etc

Thanks to the intelligent identification configuration of IDEA, the source code generated in step 2 is already configured and no additional operations are required

If IDEA is not so smart, refer to the official documentation to configure these source packages

  1. The OAP server starter module runs the OAP server starter module under the OAP-Server module. The default is h2 database, not ES database

  1. Run the Web startup class, in the APM-WebApp module, the default startup log does not output to the console

  1. Visit http://localhost:8080/. If the following information is displayed, the startup is complete

If you were just developing debugging back-end code, this would be fine. But when it comes to the front end, you need to configure the front end development environment separately.

UI Configuration Steps

  1. Clone the code and install
git cloen https://github.com/apache/skywalking-rocketbot-ui.git
cd skywalking-rocketbot-ui
npm install
Copy the code
  1. Open the project with WebStorm

  2. Run the configure

  1. Run, the back-end Web service stops early, and just one OAP server runs. The back-end Web is a gateway that forwards requests to the OAP, where the front-end default configuration directly requests the OAP port

The default port is 8080. Access: http://localhost:8080/

Normal page, configuration complete, can be happy to develop.