Skip to content

Commit

Permalink
refactor(collector-agent): protocol (#533)
Browse files Browse the repository at this point in the history
* ues pinpoint-grpc-idl@e68bc3963e7ba6f5c7e33f380f45111fddaaf938
* map[string]interface{} to TSpan*
* testcase
* python version

[Task] clue/ctx_key limitation #531

close #531
  • Loading branch information
eeliu authored Oct 13, 2023
1 parent c2f678d commit e152d2a
Show file tree
Hide file tree
Showing 60 changed files with 1,127 additions and 7,204 deletions.
15 changes: 12 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ RUN groupadd --gid $USER_GID $USERNAME \


RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt update && apt install -y gcc g++ gdb pkg-config libxml2-dev libsqlite3-dev libcurl4-openssl-dev zlib1g-dev make cmake wget autoconf git clangd python3-pip clang-format
RUN apt update && apt install -y gcc g++ gdb pkg-config libxml2-dev libsqlite3-dev libcurl4-openssl-dev zlib1g-dev make cmake wget autoconf git clangd python3-pip clang-format protobuf-compiler vim
## enable php-7.4
ENV PHP_VESION=php-7.4.33
RUN cd ~ && wget https://www.php.net/distributions/${PHP_VESION}.tar.gz && tar xvf ${PHP_VESION}.tar.gz && cd ${PHP_VESION} && ./configure --prefix=/opt/${PHP_VESION} --enable-fpm --enable-opcache --enable-debug && make -j && make install
ENV PATH="$PATH:/opt/php/bin/:/opt/php/sbin/"
COPY php.ini /opt/
COPY php.ini /opt/$PHP_VESION/lib

### Build php module
### curl
Expand All @@ -57,4 +57,13 @@ COPY php.ini /opt/
# RUN cd ~ && wget https://www.php.net/distributions/${PHP_VESION}.tar.gz && tar xvf ${PHP_VESION}.tar.gz && cd ${PHP_VESION} && ./configure --prefix=/opt/${PHP_VESION} --enable-fpm --enable-opcache --enable-debug && make -j && make install

# ENV PHP_VESION=php-8.2.10
# RUN cd ~ && wget https://www.php.net/distributions/${PHP_VESION}.tar.gz && tar xvf ${PHP_VESION}.tar.gz && cd ${PHP_VESION} && ./configure --prefix=/opt/${PHP_VESION} --enable-fpm --enable-opcache --enable-debug && make -j && make install
# RUN cd ~ && wget https://www.php.net/distributions/${PHP_VESION}.tar.gz && tar xvf ${PHP_VESION}.tar.gz && cd ${PHP_VESION} && ./configure --prefix=/opt/${PHP_VESION} --enable-fpm --enable-opcache --enable-debug && make -j && make install


# install golang 1.18

RUN wget https://go.dev/dl/go1.18.10.linux-amd64.tar.gz && rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.10.linux-amd64.tar.gz
ENV PATH=$PATH:/usr/local/go/bin
ENV GO_PATH=~/go
ENV PATH=$PATH:/$GO_PATH/bin
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest && go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
25 changes: 16 additions & 9 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,20 @@
"containerUser": "pinpoint",
"postCreateCommand": ".devcontainer/setup.sh",
"extensions": [
"zxh404.vscode-proto3",
"llvm-vs-code-extensions.vscode-clangd",
"vadimcn.vscode-lldb",
"webfreak.debug",
"ms-python.python",
"xaver.clang-format",
"zxh404.vscode-proto3",
"Gruntfuggly.todo-tree"
]
"zxh404.vscode-proto3",
"llvm-vs-code-extensions.vscode-clangd",
"vadimcn.vscode-lldb",
"webfreak.debug",
"ms-python.python",
"xaver.clang-format",
"zxh404.vscode-proto3",
"Gruntfuggly.todo-tree",
"msyrus.go-doc",
"golang.go",
"bierner.github-markdown-preview",
"bierner.markdown-emoji",
"ms-vscode.cmake-tools",
"matepek.vscode-catch2-test-adapter",
"adam-bender.commit-message-editor"
]
}
69 changes: 31 additions & 38 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,28 @@ jobs:
with:
name: valgrind-out
path: common/build/valgrind-out.txt
PHP5:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ["5.6", "5.4", "5.5"]
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- run: |
phpize
./configure
make
make test TESTS=src/PHP/tests5/
# PHP5:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# php-versions: ["5.6", "5.4", "5.5"]
# steps:
# - uses: actions/checkout@v2
# - uses: shivammathur/setup-php@v2
# with:
# php-version: ${{ matrix.php-versions }}
# - run: |
# phpize
# ./configure
# make
# make test TESTS=src/PHP/tests5/

PHP7:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ["7.0", "7.1", "7.2", "7.3", "7.4", "8.0"]
# php-versions: ["7.0", "7.1", "7.2", "7.3", "7.4", "8.0"]
php-versions: ["7.0"]
steps:
- uses: actions/checkout@v2
# - name: set mysql
Expand Down Expand Up @@ -101,23 +102,7 @@ jobs:
# composer install
# cp tests/think .
# php think unit -v
PHP8:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ["8.1"]
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- run: |
phpize
./configure
make
make test TESTS=src/PHP/tests/
Python:
strategy:
matrix:
Expand All @@ -142,7 +127,7 @@ jobs:
Collector-agent:
strategy:
matrix:
go-version: [1.16.x]
go-version: [1.18.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -152,8 +137,16 @@ jobs:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'true'

- name: Setup protoc
uses: arduino/setup-protoc@v2.1.0

- run: |
cd collector-agent
go mod download
go build
go test ./... -v
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest && go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
# cd collector-agent
# go mod download
# go build
# go test ./... -v
cd collector-agent && make && go test ./... -v
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ common/include/common.h
.cache
compile_commands.json
wheelhouse/
.clangd
.clangd
collector-agent/pinpoint-grpc-idl/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "collector-agent/pinpoint-grpc-idl"]
path = collector-agent/pinpoint-grpc-idl
url = https://github.com/pinpoint-apm/pinpoint-grpc-idl.git
2 changes: 2 additions & 0 deletions collector-agent/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
*.exe
*.log
CollectorAgent
collector-agent
pinpoint-grpc-idl
6 changes: 3 additions & 3 deletions collector-agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM golang:1.16.5-alpine3.13 as builder
FROM golang:1.18-alpine3.17 as builder
WORKDIR /apps
COPY collector-agent /apps/collector-agent
RUN cd /apps/collector-agent && go build -o CollectorAgent server.go
RUN cd /apps/collector-agent && go mod tidy && go build -o CollectorAgent

FROM alpine:3.14
FROM alpine:3.17
COPY --from=builder /apps/collector-agent/CollectorAgent /usr/local/bin
ENTRYPOINT [ "CollectorAgent" ]
Loading

0 comments on commit e152d2a

Please sign in to comment.