diff --git a/.dlc.json b/.dlc.json new file mode 100644 index 00000000..8b452f15 --- /dev/null +++ b/.dlc.json @@ -0,0 +1,25 @@ +{ + "ignorePatterns": [ + { + "pattern": "^http://localhost" + }, + { + "pattern": "^http://pgp.mit.edu:11371" + }, + { + "pattern": "^https://twitter.com*" + }, + { + "pattern": "^http://people.apache.org/committer-index.html" + } + ], + "timeout": "10s", + "retryOn429": true, + "retryCount": 10, + "fallbackRetryDelay": "1000s", + "aliveStatusCodes": [ + 200, + 401, + 403 + ] +} diff --git a/.github/workflows/dead-link-checker.yaml b/.github/workflows/dead-link-checker.yaml new file mode 100644 index 00000000..fb8d7e07 --- /dev/null +++ b/.github/workflows/dead-link-checker.yaml @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Dead Link Checker + +on: + pull_request: + paths: + - 'docs/**' + schedule: + - cron: '0 18 * * *' # TimeZone: UTC 0 + +concurrency: + group: dlc-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + CheckDeadLinks: + if: (github.event_name == 'schedule' && github.repository == 'apache/skywalking-rover') || (github.event_name != 'schedule') + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v3 + - run: sudo npm install -g markdown-link-check@3.10.0 + - run: | + for file in $(find . -name "*.md"); do + markdown-link-check -c .dlc.json -q "$file" + done diff --git a/.licenserc.yaml b/.licenserc.yaml index 74481e9b..e484fa1e 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -27,6 +27,7 @@ header: - 'licenses' - '**/go.mod' - '**/go.sum' + - '**/*.json' - 'LICENSE' - 'NOTICE' - '.gitignore' diff --git a/CHANGES.md b/CHANGES.md index e206a6de..a9bc2b3b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ Release Notes. * Fix the base image cannot run in the arm64. #### Documentation +* Add a dead link checker in the CI. #### Issues and PR - All issues are [here](https://github.com/apache/skywalking/milestone/228?closed=1) diff --git a/README.md b/README.md index f117c600..684dbbd9 100644 --- a/README.md +++ b/README.md @@ -28,4 +28,4 @@ Follow the [releases page](https://skywalking.apache.org/downloads/#SkyWalkingRo * [bilibili B站 视频](https://space.bilibili.com/390683219) # License -[Apache 2.0 License.](/LICENSE) +[Apache 2.0 License.](LICENSE) diff --git a/docs/en/concepts-and-designs/module_design.md b/docs/en/concepts-and-designs/module_design.md new file mode 100644 index 00000000..e2c752fa --- /dev/null +++ b/docs/en/concepts-and-designs/module_design.md @@ -0,0 +1,38 @@ +# Module Design +## Overview + +The module is an isolation concept in Rover. Each module completes an independent feature. + +## Life Cycle + +Each concept has a complete life cycle. + +- Start: Start phase is to start the current module. +- NotifyStartSuccess: Execute when all modules have finished starting without any errors. +- Shutdown: The shutdown phase is to close all the used resources. + +## Config + +Each module has its corresponding configurations and only when they're set in the configuration file, the module would be enabled. + +The config data support various data structures, and it could use `${ENV_NAME:DEFAULT}` to read the value from the environment variables. + +## Dependency + +There may have dependencies between modules. + +For example, process and profiling are two separate modules, the profiling module needs to read all registered processes from the processing module. So, we could say the profiling module is dependent on the process module. + +### Module API + +Modules can communicate by calling APIs from dependent modules. + +### Start Sequence + +When Rover starts, it would analyze the dependency order of all enabled modules to a startup module list. + +The startup sequence is following these steps: +1. Modules have the fewest dependent modules. +2. The position of the module declaration in the configuration file. + +After parsing the list of startup modules, it would be started sequentially in a single-threaded manner. \ No newline at end of file diff --git a/docs/en/guides/contribution/how-to-write-module.md b/docs/en/guides/contribution/how-to-write-module.md index 186de184..af5a293c 100644 --- a/docs/en/guides/contribution/how-to-write-module.md +++ b/docs/en/guides/contribution/how-to-write-module.md @@ -6,12 +6,12 @@ Let's use the profiling module as an example of how to write a module. 1. Please read the [Module Design](../../concepts-and-designs/module_design.md) to understand what is module. 2. The module should be written in the **skywalking-rover/pkg** directory. So we create a new directory called profiling as the module codes space. 3. Implement the interface in the **skywalking-rover/pkg/module**. Each module has 6 methods, which are Name, RequiredModules, Config, Start, NotifyStartSuccess, and Shutdown. - - Name returns the unique name of the module, also this name is used to define in the configuration file. - - RequiredModules returns this needs depended on module names. In the profiling module, it needs to query the existing process and send snapshots to the backend, so it needs the core and process module. - - Config returns the config content of this module, which relate to the configuration file, and you could declare the tag(`mapstructure`) with the field to define the name in the configuration file. - - Start is triggered when the module needs to start. if this module start failure, please return the error. - - NotifyStartSuccess is triggered after all the active modules are Start method success. - - Shutdown + - Name returns the unique name of the module, also this name is used to define in the configuration file. + - RequiredModules returns this needs depended on module names. In the profiling module, it needs to query the existing process and send snapshots to the backend, so it needs the core and process module. + - Config returns the config content of this module, which relate to the configuration file, and you could declare the tag(`mapstructure`) with the field to define the name in the configuration file. + - Start is triggered when the module needs to start. if this module start failure, please return the error. + - NotifyStartSuccess is triggered after all the active modules are Start method success. + - Shutdown 4. Add the configuration into the **skywalking-rover/configs/rover_configs.yaml**. It should same as the config declaration. 5. Register the module into **skywalking-rover/pkg/boot/register.go**. 6. Add the Unit test or E2E testing for testing the module is works well. diff --git a/docs/en/setup/configuration/service-discovery.md b/docs/en/setup/configuration/service-discovery.md index 85560a7f..59056618 100644 --- a/docs/en/setup/configuration/service-discovery.md +++ b/docs/en/setup/configuration/service-discovery.md @@ -38,10 +38,6 @@ Each expression must return the boolean value. Otherwise, the decision throws an The context is similar to the entity builder. Using context could help the rover understand which process could build the entity. -##### Process Context - -Is the same with the [process context in scanner](./scanner.md#process), but doesn't need to add the `{{` and `}}` in prefix and suffix. - ##### Pod Context Provide current pod information and judgments.