Skip to content

Commit

Permalink
debug: support pprof
Browse files Browse the repository at this point in the history
  • Loading branch information
yangkaa committed Oct 28, 2024
1 parent 1a62ec1 commit 5a664b2
Show file tree
Hide file tree
Showing 2 changed files with 241 additions and 0 deletions.
235 changes: 235 additions & 0 deletions .github/workflows/release-v6-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
name: "release-v6"
on:
workflow_dispatch:
inputs:
branch:
description: 'branch'
required: true
default: 'V6.0'
version:
description: 'version'
required: true
default: 'V6.0-dev'
build-who:
description: 'build-who'
required: true
default: 'mq'
type: choice
options:
- all
- operator
- region
- console
build-component:
description: 'Specify component to build (only when build-who is all or region)'
required: false
default: ''
type: choice
options:
- api
- chaos
- worker
- init-probe
- mq
platforms:
description: 'platforms'
required: true
default: 'linux/amd64'
type: choice
options:
- linux/amd64
- linux/amd64,linux/arm64

env:
VERSION: ${{ github.event.inputs.version }}

jobs:
rainbond-region:
runs-on: ubuntu-latest
environment: release-v6
if: ${{ github.event.inputs.build-who == 'all' || github.event.inputs.build-who == 'region' }}
strategy:
matrix:
component: []

steps:
- name: Set matrix component dynamically
id: set-matrix
run: |
COMPONENTS=""
if [[ "${{ github.event.inputs.build-component }}" != "" ]]; then
COMPONENTS="${{ github.event.inputs.build-component }}"
else
COMPONENTS="api chaos worker init-probe mq"
fi
echo "component_list=$(echo $COMPONENTS | jq -R 'split(" ")')" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to Aliyun Container Registry
uses: docker/login-action@v3
with:
registry: registry.cn-hangzhou.aliyuncs.com
username: ${{ secrets.DOMESTIC_DOCKER_USERNAME }}
password: ${{ secrets.DOMESTIC_DOCKER_PASSWORD }}

- name: Set release description
run: |
buildTime=$(date +%F-%H)
git_commit=$(git log -n 1 --pretty --format=%h)
release_desc="${{ env.VERSION }}-${git_commit}-${buildTime}"
echo "release_desc=$release_desc" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: ${{ github.event.inputs.platforms }}
build-args: |
RELEASE_DESC=${{ env.release_desc }}
context: .
file: hack/contrib/docker/${{ matrix.component }}/Dockerfile
push: true
tags: |
rainbond/rbd-${{ matrix.component }}:${{ env.VERSION }}
registry.cn-hangzhou.aliyuncs.com/goodrain/rbd-${{ matrix.component }}:${{ env.VERSION }}
rainbond-operator:
runs-on: ubuntu-latest
environment: release-v6
if: ${{ github.event.inputs.build-who == 'all' || github.event.inputs.build-who == 'operator' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
repository: goodrain/rainbond-operator
ref: ${{ github.event.inputs.branch }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to Aliyun Container Registry
uses: docker/login-action@v3
with:
registry: registry.cn-hangzhou.aliyuncs.com
username: ${{ secrets.DOMESTIC_DOCKER_USERNAME }}
password: ${{ secrets.DOMESTIC_DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: ${{ github.event.inputs.platforms }}
context: .
file: ./Dockerfile
push: true
tags: |
rainbond/rainbond-operator:${{ env.VERSION }}
regist
rainbond-ui:
runs-on: ubuntu-latest
environment: release-v6
if: ${{ github.event.inputs.build-who == 'all' || github.event.inputs.build-who == 'console' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
repository: goodrain/rainbond-ui
ref: ${{ github.event.inputs.branch }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: ${{ github.event.inputs.platforms }}
context: .
file: ./Dockerfile
push: true
tags: |
rainbond/rainbond-ui:${{ env.VERSION }}
rainbond-allinone:
runs-on: ubuntu-latest
needs: [rainbond-ui]
environment: release-v6
if: ${{ github.event.inputs.build-who == 'all' || github.event.inputs.build-who == 'console' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
repository: goodrain/rainbond-console
ref: ${{ github.event.inputs.branch }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to Aliyun Container Registry
uses: docker/login-action@v3
with:
registry: registry.cn-hangzhou.aliyuncs.com
username: ${{ secrets.DOMESTIC_DOCKER_USERNAME }}
password: ${{ secrets.DOMESTIC_DOCKER_PASSWORD }}

- name: Set release description
run: |
buildTime=$(date +%F-%H)
git_commit=$(git log -n 1 --pretty --format=%h)
release_desc="${{ env.VERSION }}-${git_commit}-${buildTime}"
echo "release_desc=$release_desc" >> $GITHUB_ENV
- ry.cn-hangzhou.aliyuncs.com/goodrain/rainbond-operator:${{ env.VERSION }}
name: Build and push
uses: docker/build-push-action@v6
with:
platforms: ${{ github.event.inputs.platforms }}
build-args: |
RELEASE_DESC=${{ env.release_desc }}
VERSION=${{ env.VERSION }}
context: .
file: ./Dockerfile.allinone
push: true
tags: |
rainbond/rainbond:${{ env.VERSION }}-allinone
registry.cn-hangzhou.aliyuncs.com/goodrain/rainbond:${{ env.VERSION }}-allinone
6 changes: 6 additions & 0 deletions cmd/mq/mq.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@ import (
"github.com/goodrain/rainbond/pkg/component"
"github.com/goodrain/rainbond/pkg/rainbond"
"github.com/sirupsen/logrus"
"log"
"net/http"
"os"

"github.com/goodrain/rainbond/cmd"
_ "net/http/pprof"
)

func main() {
go func() {
log.Println(http.ListenAndServe("localhost:6789", nil))
}()
if len(os.Args) > 1 && os.Args[1] == "version" {
cmd.ShowVersion("mq")
}
Expand Down

0 comments on commit 5a664b2

Please sign in to comment.