Skip to content

Commit 2691120

Browse files
authored
Merge pull request #23 from pyroscope-io/0.4.0
0.4.0 release
2 parents 50d7aa7 + 7d2bd8f commit 2691120

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+7281
-367
lines changed

.github/workflows/build.yml

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,28 @@ on: [push, pull_request]
44

55
jobs:
66
build:
7-
name: ${{ matrix.os }}
7+
name: ${{ matrix.package }} - ${{ matrix.os }} - ${{ matrix.target }}
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
11-
os: [macos-latest, ubuntu-latest]
11+
package: [lib, cli, pprofrs, pyspy, rbspy]
12+
os: [ubuntu-latest, macos-latest]
13+
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin]
14+
exclude:
15+
- os: ubuntu-latest
16+
target: x86_64-apple-darwin
17+
- os: ubuntu-latest
18+
target: aarch64-apple-darwin
19+
- os: macos-latest
20+
target: x86_64-unknown-linux-gnu
21+
- os: macos-latest
22+
target: aarch64-unknown-linux-gnu
1223
steps:
24+
- name: install libunwind (for pprof)
25+
if: matrix.os == 'ubuntu-latest'
26+
continue-on-error: true
27+
run: sudo apt install libunwind8-dev
28+
1329
- name: Checkout sources
1430
uses: actions/checkout@v2
1531

@@ -20,7 +36,36 @@ jobs:
2036
toolchain: stable
2137
override: true
2238

23-
- name: Run cargo build
39+
- name: Cargo build for pyroscope library
40+
uses: omarabid-forks/rs-cargo@v1
41+
if: matrix.package == 'lib'
42+
with:
43+
command: build
44+
45+
- name: Cargo build for pyrosocpe-cli
46+
uses: omarabid-forks/rs-cargo@v1
47+
if: matrix.package == 'cli'
48+
with:
49+
args: --manifest-path pyroscope_cli/Cargo.toml
50+
command: build
51+
52+
- name: Cargo build for pprof-rs
53+
uses: omarabid-forks/rs-cargo@v1
54+
if: matrix.package == 'pprofrs'
55+
with:
56+
args: --manifest-path pyroscope_backends/pyroscope_pprofrs/Cargo.toml
57+
command: build
58+
59+
- name: Cargo build for pyspy
60+
uses: omarabid-forks/rs-cargo@v1
61+
if: matrix.package == 'pyspy'
62+
with:
63+
args: --manifest-path pyroscope_backends/pyroscope_pyspy/Cargo.toml
64+
command: build
65+
66+
- name: Cargo build for rbspy
2467
uses: omarabid-forks/rs-cargo@v1
68+
if: matrix.package == 'rbspy'
2569
with:
70+
args: --manifest-path pyroscope_backends/pyroscope_rbspy/Cargo.toml
2671
command: build

.github/workflows/publish.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ on:
77

88
jobs:
99
publish-pyroscope:
10-
name: Publish pyroscope crate
10+
name: pyroscope-lib
1111
runs-on: ubuntu-latest
12+
if: "startsWith(github.event.release.tag_name, 'lib-')"
1213
steps:
1314
- uses: actions/checkout@v1
1415
- uses: actions-rs/toolchain@v1
@@ -20,3 +21,18 @@ jobs:
2021
run: |
2122
cargo login ${{ secrets.CARGO_TOKEN }}
2223
cargo publish
24+
publish-cli:
25+
name: pyroscope-cli
26+
runs-on: ubuntu-latest
27+
if: "startsWith(github.event.release.tag_name, 'cli-')"
28+
steps:
29+
- uses: actions/checkout@v1
30+
- uses: actions-rs/toolchain@v1
31+
with:
32+
toolchain: stable
33+
override: true
34+
- name: publish pyroscope crate
35+
continue-on-error: true
36+
run: |
37+
cargo login ${{ secrets.CARGO_TOKEN }}
38+
cargo publish --manifest-path pyroscope_cli/Cargo.toml

.github/workflows/release.yml

Lines changed: 99 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,109 @@ name: Pre-Release
33
on: [push]
44

55
jobs:
6-
release:
7-
name: Create draft release
6+
lib-release:
7+
name: pyroscope-main
88
runs-on: ubuntu-latest
9-
if: "startsWith(github.ref, 'refs/tags/')"
9+
if: "startsWith(github.ref, 'refs/tags/lib-')"
10+
continue-on-error: true
1011
steps:
1112
- uses: "marvinpinto/[email protected]"
1213
with:
1314
repo_token: "${{ secrets.GITHUB_TOKEN }}"
15+
automatic_release_tag: "${{ github.ref_name }}"
16+
title: "pyroscope-${{ github.ref_name }}"
1417
draft: true
1518
prerelease: false
19+
cli-release:
20+
name: pyroscope-cli
21+
runs-on: ubuntu-latest
22+
if: "startsWith(github.ref, 'refs/tags/cli-')"
23+
steps:
24+
- uses: "marvinpinto/[email protected]"
25+
with:
26+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
27+
automatic_release_tag: "${{ github.ref_name }}"
28+
title: "pyroscope-${{ github.ref_name }}"
29+
draft: true
30+
prerelease: false
31+
cli-artifacts:
32+
name: pyroscope-cli - build aritifacts
33+
needs: ['cli-release']
34+
runs-on: ${{ matrix.os }}
35+
env:
36+
# For some builds, we use cross to test on 32-bit and big-endian
37+
# systems.
38+
CARGO: cargo
39+
# When CARGO is set to CROSS, this is set to `--target matrix.target`.
40+
TARGET_FLAGS: ""
41+
# When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
42+
TARGET_DIR: ./target
43+
# Emit backtraces on panics.
44+
RUST_BACKTRACE: 1
45+
strategy:
46+
matrix:
47+
build: [linux, linux-arm, macos]
48+
include:
49+
- build: linux
50+
os: ubuntu-18.04
51+
rust: stable
52+
target: x86_64-unknown-linux-musl
53+
- build: linux-arm
54+
os: ubuntu-18.04
55+
rust: stable
56+
target: arm-unknown-linux-gnueabihf
57+
- build: macos
58+
os: macos-latest
59+
rust: stable
60+
target: x86_64-apple-darwin
61+
steps:
62+
- name: Checkout repository
63+
uses: actions/checkout@v2
64+
65+
- name: Install Rust
66+
uses: actions-rs/toolchain@v1
67+
with:
68+
toolchain: ${{ matrix.rust }}
69+
profile: minimal
70+
override: true
71+
target: ${{ matrix.target }}
72+
73+
- name: Use Cross
74+
shell: bash
75+
run: |
76+
cargo install cross
77+
echo "CARGO=cross" >> $GITHUB_ENV
78+
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
79+
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
80+
81+
- name: Show command used for Cargo
82+
run: |
83+
echo "cargo command is: ${{ env.CARGO }}"
84+
echo "target flag is: ${{ env.TARGET_FLAGS }}"
85+
echo "target dir is: ${{ env.TARGET_DIR }}"
86+
87+
- name: Build release binary
88+
run: ${{ env.CARGO }} build --manifest-path pyroscope_cli/Cargo.toml --verbose --release ${{ env.TARGET_FLAGS }}
89+
90+
- name: Strip release binary (linux and macos)
91+
if: matrix.build == 'linux' || matrix.build == 'macos'
92+
run: strip "pyroscope_cli/target/${{ matrix.target }}/release/pyroscope-cli"
93+
94+
- name: Strip release binary (arm)
95+
if: matrix.build == 'linux-arm'
96+
run: |
97+
docker run --rm -v \
98+
"$PWD/target:/target:Z" \
99+
rustembedded/cross:arm-unknown-linux-gnueabihf \
100+
arm-linux-gnueabihf-strip \
101+
/target/arm-unknown-linux-gnueabihf/release/pyroscope-cli
102+
103+
- name: Upload release archive
104+
uses: actions/[email protected]
105+
env:
106+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107+
with:
108+
upload_url: ${{ needs.create-release.outputs.upload_url }}
109+
asset_path: "pyroscope_cli/target/${{ matrix.target }}/release/pyroscope-cli"
110+
asset_name: "pyroscope-cli"
111+
asset_content_type: application/octet-stream

.github/workflows/tests.yml

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,70 @@ on: [push, pull_request]
44

55
jobs:
66
test:
7-
name: ${{ matrix.os }}
7+
name: ${{ matrix.package }} - ${{ matrix.os }} - ${{ matrix.target }}
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
11-
os: [macos-latest, ubuntu-latest]
11+
package: [lib, cli, pprofrs, pyspy, rbspy]
12+
os: [ubuntu-latest, macos-latest]
13+
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin]
14+
exclude:
15+
- os: ubuntu-latest
16+
target: x86_64-apple-darwin
17+
- os: ubuntu-latest
18+
target: aarch64-apple-darwin
19+
- os: macos-latest
20+
target: x86_64-unknown-linux-gnu
21+
- os: macos-latest
22+
target: aarch64-unknown-linux-gnu
1223
steps:
24+
- name: install libunwind (for pprof)
25+
if: matrix.os == 'ubuntu-latest'
26+
continue-on-error: true
27+
run: sudo apt install libunwind8-dev
28+
1329
- name: Checkout sources
1430
uses: actions/checkout@v2
1531

1632
- name: Install stable toolchain
1733
uses: omarabid-forks/rs-toolchain@v1
1834
with:
19-
profile: minimal
35+
profile: default
2036
toolchain: stable
37+
target: ${{ matrix.target }}
2138
override: true
2239

2340
- name: Run cargo test
2441
uses: omarabid-forks/rs-cargo@v1
42+
if: matrix.package == 'lib'
43+
with:
44+
command: test
45+
args: --all
46+
47+
- name: Cargo build for pyrosocpe-cli
48+
uses: omarabid-forks/rs-cargo@v1
49+
if: matrix.package == 'cli'
50+
with:
51+
args: --all --manifest-path pyroscope_cli/Cargo.toml
52+
command: test
53+
54+
- name: Cargo build for pprof-rs
55+
uses: omarabid-forks/rs-cargo@v1
56+
if: matrix.package == 'pprofrs'
57+
with:
58+
args: --all --manifest-path pyroscope_backends/pyroscope_pprofrs/Cargo.toml
59+
command: test
60+
61+
- name: Cargo build for pyspy
62+
uses: omarabid-forks/rs-cargo@v1
63+
if: matrix.package == 'pyspy'
64+
with:
65+
args: --all --manifest-path pyroscope_backends/pyroscope_pyspy/Cargo.toml
66+
command: test
67+
68+
- name: Cargo build for rbspy
69+
uses: omarabid-forks/rs-cargo@v1
70+
if: matrix.package == 'rbspy'
2571
with:
72+
args: --all --manifest-path pyroscope_backends/pyroscope_rbspy/Cargo.toml
2673
command: test

Cargo.toml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,63 @@ Pyroscope Profiler
55
"""
66
keywords = ["pyroscope", "profiler"]
77
authors = ["Abid Omar <[email protected]>"]
8-
version = "0.3.1"
8+
version = "0.4.0"
99
edition = "2021"
1010
license = "Apache-2.0"
1111
homepage = "https://pyroscope.io"
1212
documentation = "https://docs.rs/pyroscope"
1313
repository = "https://github.com/pyroscope-io/pyroscope-rs"
1414
readme = "README.md"
15+
autobins = false
16+
autoexamples = true
17+
autotests = true
18+
autobenches = true
19+
20+
[workspace]
21+
members = [
22+
]
23+
exclude = [
24+
"pyroscope_backends",
25+
"pyroscope_cli",
26+
]
27+
28+
[[example]]
29+
name = "internal-backend-void"
30+
path = "examples/internal/backend-void.rs"
31+
32+
[[example]]
33+
name = "internal-backend-void-run"
34+
path = "examples/internal/backend-void-run.rs"
35+
36+
[[example]]
37+
name = "internal-backend-pprof"
38+
path = "examples/internal/backend-pprof.rs"
39+
40+
[[example]]
41+
name = "internal-timer"
42+
path = "examples/internal/timer.rs"
43+
44+
[[example]]
45+
name = "internal-pyspy-connect"
46+
path = "examples/internal/pyspy-connect.rs"
47+
48+
[[example]]
49+
name = "internal-rbspy-connect"
50+
path = "examples/internal/rbspy-connect.rs"
1551

1652
[dependencies]
1753
thiserror ="1.0"
1854
log = "0.4"
1955
reqwest = { version = "0.11", features = ["blocking"]}
20-
pprof = "0.6.2"
2156
libc = "^0.2.66"
2257

2358
[dev-dependencies]
2459
tokio = { version = "1.13", features = ["full"] }
2560
pretty_env_logger = "0.4.0"
2661
assert_matches = "1"
62+
pyroscope_pprofrs = { path = "pyroscope_backends/pyroscope_pprofrs" }
63+
pyroscope_rbspy = { path = "pyroscope_backends/pyroscope_rbspy" }
64+
pyroscope_pyspy = { path = "pyroscope_backends/pyroscope_pyspy" }
2765

2866
[profile.dev]
2967
opt-level=0

0 commit comments

Comments
 (0)