### Install UPX Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Instructions for installing UPX on different operating systems. ```bash # macOS brew install upx # Ubuntu/Debian sudo apt-get install upx-ucl # CentOS/RHEL sudo yum install upx ``` -------------------------------- ### Start Dubbo Provider Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/beginner_guide_EN.md Starts the Dubbo provider application in the background. ```bash # Start dubbo-provider nohup java -Djava.net.preferIPv4Stack=true -Dproject.name=dubbo-provider -jar dubbo-provider-1.0-SNAPSHOT.jar > provider.nohup.log 2>&1 & ``` -------------------------------- ### Quick Start Build Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD_ZH.md Basic commands for building the project for the current platform. ```bash # 为当前平台构建 make build # 构建所有组件 make build_all ``` -------------------------------- ### Start Dubbo Provider Source: https://github.com/chaosblade-io/chaosblade/wiki/新手指南 Command to start the Dubbo provider application using a JAR file. ```bash nohup java -Djava.net.preferIPv4Stack=true -Dproject.name=dubbo-provider -jar dubbo-provider-1.0-SNAPSHOT.jar > provider.nohup.log 2>&1 & ``` -------------------------------- ### Start Dubbo Consumer Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/beginner_guide_EN.md Starts the dubbo-consumer application and redirects output to a log file. ```bash nohup java -Dserver.port=8080 -Djava.net.preferIPv4Stack=true -Dproject.name=dubbo-consumer -jar dubbo-consumer-1.0-SNAPSHOT.jar > consumer.nohup.log 2>&1 & ``` -------------------------------- ### Manual Version Setting Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD_ZH.md Example of how to manually set the version using an environment variable and then build. ```bash export BLADE_VERSION=1.8.0 make build ``` -------------------------------- ### Container Runtime Configuration Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Examples of how to specify the container runtime (Docker or Podman) for builds. ```bash # Use Docker explicitly make nsexec CONTAINER_RUNTIME=docker # Use Podman explicitly make nsexec CONTAINER_RUNTIME=podman ``` -------------------------------- ### Troubleshooting: UPX Compression Issues Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Command to check if UPX is installed and instructions for installing it on different platforms. ```bash # Check if UPX is installed which upx # Install UPX on different platforms ``` -------------------------------- ### View Help Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Command to view help information. ```bash make help ``` -------------------------------- ### ChaosBlade CLI Help Source: https://github.com/chaosblade-io/chaosblade/wiki/新手指南 Output of the './blade help' command, showing available commands and flags for the ChaosBlade CLI. ```bash An easy to use and powerful chaos engineering experiment toolkit Usage: blade [command] Available Commands: create Create a chaos engineering experiment destroy Destroy a chaos experiment help Help about any command prepare Prepare to experiment revoke Undo chaos engineering experiment preparation status Query preparation stage or experiment status version Print version info Flags: -d, --debug Set client to DEBUG mode -h, --help help for blade Use "blade [command] --help" for more information about a command. ``` -------------------------------- ### RULE003 - Import Packages Example Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/code_styles.md Example of importing packages in sequence: built-in, own, and third-party, with blank lines separating them. ```golang import ( "fmt" "strings" "time" "github.com/chaosblade-io/chaosblade/data" "github.com/chaosblade-io/chaosblade/util" "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) ``` -------------------------------- ### Help Commands Source: https://github.com/chaosblade-io/chaosblade/wiki/代码逻辑流程介绍 Examples of using help commands to get assistance within ChaosBlade. ```bash blade help blade create help blade create cpu help ``` -------------------------------- ### Create CPU Full Load Experiment Source: https://github.com/chaosblade-io/chaosblade/wiki/新手指南 Command to create a CPU full load experiment, causing CPU usage to reach 100%. ```bash ./blade create cpu fullload ``` -------------------------------- ### ChaosBlade CLI Help Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/beginner_guide_EN.md Displays the available commands and flags for the ChaosBlade CLI. ```bash ./blade help ``` -------------------------------- ### Pre-build Preparation Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD_ZH.md Command to prepare the build environment. ```bash make pre_build ``` -------------------------------- ### Build Preparation and Tools Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD_ZH.md Commands for build preparation, dependency synchronization, and cleanup. ```bash # 从 Git 生成版本信息 make generate_version # 同步 go.mod 依赖项与 Makefile 分支配置 make sync_go_mod # 准备构建环境(清理和创建目录) make pre_build # 打包构建产物 make package # 清理所有构建产物 make clean ``` -------------------------------- ### Build All Components Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD_ZH.md Command to build all components for the current platform. ```bash # 构建所有组件 make build_all ``` -------------------------------- ### Comment style example Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/code_styles.md An example demonstrating the correct style for comments, including the initial whitespace and ending period. ```golang // wrong example // ExecContainer execute a process in container. func (c *Client) ExecContainer(ctx context.Context, process *Process) error { ...... } ``` -------------------------------- ### Run Tests Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Command to run all tests. ```bash # Run all tests make test ``` -------------------------------- ### Build Preparation and Utilities Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Commands for build preparation, synchronization, packaging, and cleaning. ```bash # Generate version information from Git make generate_version # Sync go.mod dependencies with Makefile branch configuration make sync_go_mod # Prepare build environment (clean and create directories) make pre_build # Package build artifacts make package # Clean all build artifacts make clean ``` -------------------------------- ### Cross-Compilation Tools Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Commands to check and install cross-compilation tools for musl and aarch64. ```bash # Check available cross-compilers which musl-gcc which aarch64-linux-gnu-gcc # Install cross-compilation tools # Ubuntu/Debian sudo apt-get install musl-tools gcc-aarch64-linux-gnu # macOS brew install FiloSottile/musl-cross/musl-cross ``` -------------------------------- ### Use the default mode Source: https://github.com/chaosblade-io/chaosblade/wiki/v1.3.0-version-feature-introduction Example of using the default deployment mode for a ChaosBlade experiment. ```bash blade c k8s pod-cpu fullload --names logtail-ds-gzd72 --namespace kube-system -d --kubeconfig ~/.kube/config {"code":200,"success":true,"result":"5bf33579c3f768ee"} ``` -------------------------------- ### Check CPU Usage Source: https://github.com/chaosblade-io/chaosblade/wiki/新手指南 Command to check the current CPU usage, typically using the 'top' command. ```bash top ``` -------------------------------- ### Troubleshooting: Missing Cross-Compilation Toolchain Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Commands to install missing cross-compilation toolchains on Ubuntu/Debian and macOS. ```bash # Ubuntu/Debian sudo apt-get install musl-tools gcc-aarch64-linux-gnu # macOS brew install FiloSottile/musl-cross/musl-cross ``` -------------------------------- ### Example Experiment Status Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/beginner_guide_EN.md This snippet shows the expected JSON output for the status of a ChaosBlade experiment. ```json { "Status": "Running", "Error": "", "CreateTime": "2019-03-29T16:19:37.284579975+08:00", "UpdateTime": "2019-03-29T17:05:14.183382945+08:00" } ] } ``` -------------------------------- ### Release script usage examples Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/release_process.md Examples of using the release.sh script for various release-related tasks, including full release, build only, tag creation, Release creation, dry run, and forced release. ```bash # Full release process ./scripts/release.sh 1.8.0 # Build only ./scripts/release.sh -b 1.8.0 # Tag creation only ./scripts/release.sh -t 1.8.0 # Release creation only ./scripts/release.sh -r 1.8.0 # Dry run mode ./scripts/release.sh -d 1.8.0 # Force release (skip checks) ./scripts/release.sh -f 1.8.0 ``` -------------------------------- ### Use download mode Source: https://github.com/chaosblade-io/chaosblade/wiki/v1.3.0-version-feature-introduction Example of using the download deployment mode for a ChaosBlade experiment, specifying a download URL. ```bash blade c k8s pod-cpu fullload --chaosblade-deploy-mode download --chaosblade-download-url https://chaosblade.oss-xxx.aliyuncs.com/agent/github/1.3.0 --names logtail-ds-gzd72 --namespace kube-system -d --kubeconfig ~/.kube/config {"code":200,"success":true,"result":"dcdf0a13814fcacc"} ``` -------------------------------- ### View Available Targets Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Command to view all available make targets. ```bash # View all available make targets make -n help ``` -------------------------------- ### Encouraged return fast example Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/code_styles.md An example of code that follows the 'return fast' principle to reduce indentation. ```golang // correct example if !retry { return nil } t, err := calculateSleepTime(d); if err != nil { return fmt.Errorf("failed to calculate timeout: %v", err) } time.Sleep(t) times++ return retryLoad() ``` -------------------------------- ### ChaosBlade Directory Structure Source: https://github.com/chaosblade-io/chaosblade/wiki/新手指南 The directory structure after unzipping ChaosBlade, showing the 'bin' directory containing executable files and configuration. ```bash ├── bin │ ├── chaos_burncpu │ ├── chaos_burnio │ ├── chaos_changedns │ ├── chaos_delaynetwork │ ├── chaos_dropnetwork │ ├── chaos_filldisk │ ├── chaos_killprocess │ ├── chaos_lossnetwork │ ├── jvm.spec.yaml │ └── tools.jar ├── blade └── lib └── sandbox ``` -------------------------------- ### Build All Components for Specific Platform Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD_ZH.md Commands to build all components for specific platforms and architectures. ```bash # 为特定平台构建所有组件 make darwin_amd64 make darwin_arm64 make linux_amd64 make linux_arm64 make windows_amd64 ``` -------------------------------- ### Help Information Commands Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/version_sync_guide.md Commands to view help information for Makefile and the sync script. ```bash # View Makefile help make help # View script help ./scripts/sync_go_mod.sh --help ``` -------------------------------- ### Windows Build Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Command to build for Windows AMD64 architecture. ```bash # AMD64 architecture make windows_amd64 ``` -------------------------------- ### Experimental query supports action parameter Source: https://github.com/chaosblade-io/chaosblade/wiki/v1.3.0-version-feature-introduction Example of querying experiments using the 'stop' action. ```bash blade s --type c --action stop { "code": 200, "success": true, "result": [ { "Uid": "a6da606fbcdea2cb", "Command": "systemd", "SubCommand": "stop", "Flag": " --service=docker", "Status": "Success", "Error": "", "CreateTime": "2021-08-05T11:07:05.373964934+08:00", "UpdateTime": "2021-08-05T11:07:06.615654415+08:00" } ] } ``` -------------------------------- ### Destroy CPU Full Load Experiment Source: https://github.com/chaosblade-io/chaosblade/wiki/新手指南 Command to destroy or stop the previously created CPU full load experiment using its ID. ```bash ./blade destroy 7c1f7afc281482c8 ``` -------------------------------- ### Component Selection Build Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Build specific components or all components for a target platform. ```bash # Only build CLI and OS components make linux_amd64 MODULES=cli,os # Build all components make linux_amd64 MODULES=all ``` -------------------------------- ### Individual Component Build Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Commands to build individual components for the current platform. ```bash # Build individual components for current platform make cli # Build CLI tool only make os # Build OS experiment scenarios make cloud # Build cloud experiment scenarios make middleware # Build middleware experiment scenarios make java # Build Java experiment scenarios make cplus # Build C/C++ experiment scenarios make cri # Build CRI experiment scenarios make kubernetes # Build Kubernetes experiment scenarios make nsexec # Build nsexec (Linux only) make upx # Compress binaries with UPX make check_yaml # Download check specification YAML files ``` -------------------------------- ### Utility Commands Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Common utility commands for building, testing, and cleaning ChaosBlade artifacts. ```bash # Generate version information make generate_version # Sync dependencies make sync_go_mod # Compress binaries make upx # Download check specifications make check_yaml # Run tests make test # Clean build artifacts make clean ``` -------------------------------- ### Current Platform Build Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Commands to build the CLI tool or all components for the current platform. ```bash # Build CLI tool make build # Build all components make build_all ``` -------------------------------- ### CPU Full Load Experiment Result Source: https://github.com/chaosblade-io/chaosblade/wiki/新手指南 The JSON response indicating the successful creation of the CPU full load experiment, including a unique experiment ID. ```json {"code":200,"success":true,"result":"7c1f7afc281482c8"} ``` -------------------------------- ### Build CLI Tool Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD_ZH.md Command to build the CLI tool for the current platform. ```bash # 构建 CLI 工具 make build ``` -------------------------------- ### Clean Build Artifacts Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Command to clean all build artifacts. ```bash # Clean all build artifacts make clean ``` -------------------------------- ### Prepare JVM Agent for Chaos Experiments Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/beginner_guide_EN.md Prepares the environment for chaos experiments by mounting the required Java agent to the specified process. ```bash ./blade prepare jvm --process dubbo.consumer ``` -------------------------------- ### Linux Build Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Commands to build for Linux AMD64 and ARM64 architectures. ```bash # AMD64 architecture make linux_amd64 # ARM64 architecture make linux_arm64 ``` -------------------------------- ### Experimental query supports flag parameters Source: https://github.com/chaosblade-io/chaosblade/wiki/v1.3.0-version-feature-introduction Example of querying experiments using a flag filter. ```bash blade s --type c --flag-filter service { "code": 200, "success": true, "result": [ { "Uid": "a6da606fbcdea2cb", "Command": "systemd", "SubCommand": "stop", "Flag": " --service=docker", "Status": "Success", "Error": "", "CreateTime": "2021-08-05T11:07:05.373964934+08:00", "UpdateTime": "2021-08-05T11:07:06.615654415+08:00" } ] } ``` -------------------------------- ### RULE002 - Add parameter name in interface definition - Wrong Example Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/code_styles.md An example of an interface definition missing formal parameter names, making it less readable. ```golang // wrong example type ContainerMgr interface { // Start a container. Start(context.Context, string, string) error // Stop a container. Stop(context.Context, string, int64) error ...... } ``` -------------------------------- ### Query Prepare Status Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/beginner_guide_EN.md Queries the status of prepared experiments, useful for finding UIDs if they are not returned. ```bash ./blade status --type prepare ``` -------------------------------- ### Build Specific Components for Specific Platform Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD_ZH.md Commands to build specific components for a given platform and architecture. ```bash # 为特定平台构建特定组件 make linux_amd64 MODULES=cli make linux_amd64 MODULES=cli,os,java make linux_amd64 MODULES=all ``` -------------------------------- ### Systemd Stop Scenario Source: https://github.com/chaosblade-io/chaosblade/wiki/v1.3.0-version-feature-introduction Example of stopping a systemd service and the expected output. ```bash $ blade c systemd stop --service docker {"code":200,"success":true,"result":"a6da606fbcdea2cb"} $ docker ps Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ``` -------------------------------- ### Cross-Platform Build with Containers Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Build Linux AMD64 and ARM64 versions using containers. ```bash # Build Linux AMD64 using musl container make cross_build_linux_amd64_by_container # Build Linux ARM64 using ARM container make cross_build_linux_arm64_by_container ``` -------------------------------- ### Manual Version Sync Commands Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/version_sync_guide.md Commands to manually synchronize go.mod versions and manage backup files. ```bash # Sync versions and clean backup files make sync_go_mod # Or run the script directly ./scripts/sync_go_mod.sh # Keep backup files ./scripts/sync_go_mod.sh --keep-backup ``` -------------------------------- ### Troubleshooting: Restore Original Files Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/version_sync_guide.md Commands to manually restore original go.mod files if issues occur. ```bash # If backup file exists mv go.mod.backup go.mod # Or re-sync make sync_go_mod ``` -------------------------------- ### Specify Container Runtime Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD_ZH.md Commands to manually specify the container runtime (Docker or Podman). ```bash # 明确使用 Docker make nsexec CONTAINER_RUNTIME=docker # 明确使用 Podman make nsexec CONTAINER_RUNTIME=podman ``` -------------------------------- ### macOS (Darwin) Build Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Commands to build for macOS AMD64 and ARM64 architectures. ```bash # AMD64 architecture make darwin_amd64 # ARM64 architecture (Apple Silicon) make darwin_arm64 ``` -------------------------------- ### Specific Platform Build Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Commands to build all components or specific modules for a given platform and architecture. ```bash # Build all components for specific platform make darwin_amd64 make darwin_arm64 make linux_amd64 make linux_arm64 make windows_amd64 # Build specific components for specific platform make linux_amd64 MODULES=cli make linux_amd64 MODULES=cli,os,java make linux_amd64 MODULES=all ``` -------------------------------- ### Image Push Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Command to push the built Docker image to a container image registry. ```bash # Push to container image registry make push_image ``` -------------------------------- ### Troubleshooting: Container Runtime Issues Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Commands to check the status of Docker and Podman, and manually specify the container runtime. ```bash # Check Docker status docker info # Check Podman status podman info # Manually specify container runtime make nsexec CONTAINER_RUNTIME=docker ``` -------------------------------- ### Container Image Build Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Build and push container images for ChaosBlade, optionally with specific modules. ```bash # Build and push images make build_linux_amd64_image make build_linux_arm64_image make push_image # Build images with specific modules make build_linux_amd64_image MODULES=cli,os make build_linux_arm64_image MODULES=all ``` -------------------------------- ### Troubleshooting: Permission Error Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/version_sync_guide.md Command to grant execution permissions to the sync script. ```bash chmod +x scripts/sync_go_mod.sh ``` -------------------------------- ### Specify the download address when deploying the operator Source: https://github.com/chaosblade-io/chaosblade/wiki/v1.3.0-version-feature-introduction Example of deploying the ChaosBlade operator using Helm and specifying a download URL for the agent. ```bash helm install chaosblade-operator chaosblade-operator-1.3.0-v3.tgz --namespace chaosblade --set blade.downloadUrl=https://chaosblade.oss-xxxxx.aliyuncs.com/agent/github/1.3.0 ``` -------------------------------- ### Docker Image Build Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Commands to build Docker images for Linux AMD64 and ARM64, with options for specific modules. ```bash # Build Linux AMD64 image make build_linux_amd64_image # Build Linux ARM64 image make build_linux_arm64_image # Build with specific modules make build_linux_amd64_image MODULES=cli,os make build_linux_arm64_image MODULES=all ``` -------------------------------- ### Automatic Sync Commands Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/version_sync_guide.md Commands that trigger automatic version sync as part of the build process. ```bash # Build for current platform make build make build_all # Build for specific platforms make linux_amd64 make darwin_amd64 # ... other platforms ``` -------------------------------- ### Build for Specific Platform Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Build ChaosBlade for a specified platform (e.g., Linux AMD64, macOS ARM64). ```bash # Build for Linux AMD64 platform make linux_amd64 # Build for macOS ARM64 platform make darwin_arm64 ``` -------------------------------- ### Containerized Compilation for nsexec Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Build the nsexec component using Docker or Podman when a suitable cross-compilation toolchain is not available. ```bash # Using Docker make nsexec CONTAINER_RUNTIME=docker # Using Podman make nsexec CONTAINER_RUNTIME=podman ``` -------------------------------- ### JVM Full GC Scenario Source: https://github.com/chaosblade-io/chaosblade/wiki/v1.3.0-version-feature-introduction Creating a JVM full GC experiment with required parameters. ```bash blade c jvm full-gc --process spring --effect-count 5 --interval 1000 {"code":200,"success":true,"result":"2ee474df48fe5f85"} ``` -------------------------------- ### Destroy Experiment Result Source: https://github.com/chaosblade-io/chaosblade/wiki/新手指南 The JSON response indicating the successful destruction of the experiment. ```json {"code":200,"success":true,"result":"command: cpu fullload --debug false --help false"} ``` -------------------------------- ### Discouraged return fast example Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/code_styles.md An example of code that is discouraged due to unnecessary indentation. ```golang // wrong example if retry { if t, err := calculateSleepTime(d); err == nil { time.Sleep(t) times++ return retryLoad() } return fmt.Errorf("failed to calculate timeout: %v", err) } return nil ``` -------------------------------- ### Helm Install with Download URL Source: https://github.com/chaosblade-io/chaosblade/wiki/v1.3.0-版本特性介绍 Installing the chaosblade-operator using Helm, specifying a download URL for tools. ```bash helm install chaosblade-operator chaosblade-operator-1.3.0-v3.tgz --namespace chaosblade --set blade.downloadUrl=https://chaosblade.oss-xxxxx.aliyuncs.com/agent/github/1.3.0 ``` -------------------------------- ### Corrected comment style example Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/code_styles.md An example showing the preferred comment style, using third-person singular for function comments. ```golang // correct example // ExecContainer executes a process in container. func (c *Client) ExecContainer(ctx context.Context, process *Process) error { ...... } ``` -------------------------------- ### RULE001 - Add blank line between field's comments - Wrong Example Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/code_styles.md An example of incorrect field comment spacing in a struct. ```golang // wrong example // ContainerManager is the default implement of interface ContainerMgr. type ContainerManager struct { // Store stores containers in Backend store. // Element operated in store must has a type of *ContainerMeta. // By default, Store will use local filesystem with json format to store containers. Store *meta.Store // Client is used to interact with containerd. Client ctrd.APIClient // NameToID stores relations between container's name and ID. // It is used to get container ID via container name. NameToID *collect.SafeMap ...... } ``` -------------------------------- ### Run the demo container Source: https://github.com/chaosblade-io/chaosblade/blob/master/README.md Command to run the chaosblade demo container. ```shell docker run -it --privileged chaosbladeio/chaosblade-demo ``` -------------------------------- ### Java Home Configuration Source: https://github.com/chaosblade-io/chaosblade/wiki/v1.3.0-version-feature-introduction Specifying the JAVA_HOME path when creating a JVM experiment. ```bash blade c jvm cpufullload --javaHome /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home --process tomcat ``` -------------------------------- ### Create Dubbo Delay Experiment Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/beginner_guide_EN.md Creates a chaos experiment to delay calls to the 'hello' interface of the com.alibaba.demo.HelloService by 3000ms for the dubbo consumer process. ```bash ./blade create dubbo delay --time 3000 --service com.alibaba.demo.HelloService --methodname hello --consumer --process dubbo.consumer ``` -------------------------------- ### Destroy Dubbo Delay Experiment Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/beginner_guide_EN.md Stops the chaos experiment with the specified experiment UID. ```bash ./blade destroy ec695fee1e458fc6 ``` -------------------------------- ### Logback Delay Source: https://github.com/chaosblade-io/chaosblade/wiki/v1.3.0-version-feature-introduction Creating a logback experiment with log delay. ```bash blade create log delay --logback --time 1000 --effect-count 100 ``` -------------------------------- ### Manual release steps: Prepare release Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/release_process.md Steps to prepare for a manual release, including checking out the master/main branch, ensuring a clean working directory, and pulling the latest code. ```bash # Ensure on master/main branch git checkout master # Ensure working directory is clean git status # Pull latest code git pull origin master ``` -------------------------------- ### Git Version Check and Update Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Commands to check the Git version and update it on Ubuntu/Debian and macOS. ```bash # Check Git version git --version # Update Git if needed # Ubuntu/Debian sudo apt-get update && sudo apt-get install git # macOS brew install git ``` -------------------------------- ### Download image command Source: https://github.com/chaosblade-io/chaosblade/blob/master/README.md Command to download the chaosblade demo image. ```shell docker pull chaosbladeio/chaosblade-demo ``` -------------------------------- ### Troubleshooting: Git Version Too Low Source: https://github.com/chaosblade-io/chaosblade/blob/master/BUILD.md Command to update Git on Ubuntu/Debian and macOS if the version is too low. ```bash # Error message ALERTMSG="please update git to >= 1.8.5" # Solution # Ubuntu/Debian sudo apt-get update && sudo apt-get install git # macOS brew install git ``` -------------------------------- ### Destroy Dubbo Throw Exception Experiment Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/beginner_guide_EN.md Stops the chaos experiment with the specified experiment UID. ```bash ./blade destroy 09dd96f4c062df69 ``` -------------------------------- ### Makefile Branch Configuration Source: https://github.com/chaosblade-io/chaosblade/blob/master/docs/version_sync_guide.md Makefile variables defining the branches for various ChaosBlade projects. ```makefile # chaosblade-exec-os BLADE_EXEC_OS_BRANCH=master # chaosblade-exec-middleware BLADE_EXEC_MIDDLEWARE_BRANCH=main # chaosblade-exec-cloud BLADE_EXEC_CLOUD_BRANCH=main # chaosblade-exec-cri BLADE_EXEC_CRI_BRANCH=main # chaosblade-exec-kubernetes BLADE_OPERATOR_BRANCH=master # chaosblade-exec-jvm BLADE_EXEC_JVM_BRANCH=master # chaosblade-exec-cplus BLADE_EXEC_CPLUS_BRANCH=master # chaosblade-spec-go BLADE_SPEC_GO_BRANCH=master ```