Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/upstream_gzip_co…
Browse files Browse the repository at this point in the history
…mpression
  • Loading branch information
korniltsev committed Aug 6, 2022
2 parents 19cefba + 66b592b commit 0d2f487
Show file tree
Hide file tree
Showing 33 changed files with 1,374 additions and 736 deletions.
219 changes: 219 additions & 0 deletions .github/workflows/ci-ffi-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
name: Python Package

on:
push:
paths:
- 'pyroscope_ffi/python/**'
- '.github/workflows/ci-ffi-python.yml'
branches:
- '**'
pull_request:
paths:
- 'pyroscope_ffi/python/**'
- '.github/workflows/ci-ffi-python.yml'
branches:
- '**'

jobs:
linux-build:
strategy:
fail-fast: false
matrix:
build-arch:
- manylinux2010_x86_64

name: Linux - ${{ matrix.build-arch }}
runs-on: ubuntu-latest

steps:
- uses: AutoModality/action-clean@v1
- uses: actions/checkout@v2
with:
submodules: recursive

- if: matrix.build-arch == 'manylinux2014_aarch64'
uses: docker/setup-qemu-action@v1
with:
platforms: arm64

- name: Build in Docker
run: pyroscope_ffi/python/scripts/docker.sh
env:
BUILD_ARCH: ${{ matrix.build-arch }}

- uses: actions/upload-artifact@v2
with:
name: "linux.whl"
path: pyroscope_ffi/python/dist/*

linux-test:
strategy:
fail-fast: false
matrix:
PYROSCOPE_DETECT_SUBPROCESSES: [1, 0]
PYROSCOPE_ONCPU: [1, 0]
PYROSCOPE_GIL_ONLY: [1, 0]
PYROSCOPE_NATIVE: [1, 0]
PYTHON_VERSION: ['2.7', '3.7', '3.8', '3.9', '3.10']
needs: ['linux-build']
name: Linux Test
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.PYTHON_VERSION }}
architecture: x64
- uses: actions/download-artifact@master
with:
name: "linux.whl"
path: "${{github.workspace}}/python"

- run: "cd ${{ github.workspace }}/python && ls -l"
- run: "cd ${{ github.workspace }}/python && pip install *.whl"
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Run Python Script
run: pyroscope_ffi/python/scripts/tests/test.py
env:
PYROSCOPE_RUN_ID: ${{ github.run_id }}
PYROSCOPE_ARCH: x86-64-linux
PYROSCOPE_API_TOKEN: ${{ secrets.PYROSCOPE_API_TOKEN }}
PYROSCOPE_DETECT_SUBPROCESSES: ${{ matrix.PYROSCOPE_DETECT_SUBPROCESSES }}
PYROSCOPE_ONCPU: ${{ matrix.PYROSCOPE_ONCPU }}
PYROSCOPE_GIL_ONLY: ${{ matrix.PYROSCOPE_GIL_ONLY }}
PYROSCOPE_NATIVE: ${{ matrix.PYROSCOPE_NATIVE }}
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}

linux-arm-build:
strategy:
fail-fast: false
matrix:
build-arch:
- manylinux2014_aarch64

name: Linux - ${{ matrix.build-arch }}
runs-on: [self-hosted, Linux, ARM64]

steps:
- uses: AutoModality/action-clean@v1
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Build in Docker
run: pyroscope_ffi/python/scripts/docker.sh
env:
BUILD_ARCH: ${{ matrix.build-arch }}

- uses: actions/upload-artifact@v2
with:
name: "linux-arm.whl"
path: pyroscope_ffi/python/dist/*

macos-build:
strategy:
fail-fast: false
matrix:
include:
- macos-version: "11.0"
target: x86_64-apple-darwin
py-platform: macosx-11_0_x86_64
- macos-version: "11.0"
target: aarch64-apple-darwin
py-platform: macosx-11_0_arm64

name: macOS - ${{ matrix.py-platform }}
runs-on: macos-${{ matrix.macos-version }}

steps:
- uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
profile: minimal
override: true

- uses: actions/setup-python@v2
with:
python-version: 3.9


- name: Build Wheel
run: |
pip install wheel
python3 setup.py bdist_wheel -p ${{ matrix.py-platform }}
working-directory: pyroscope_ffi/python
env:
CARGO_BUILD_TARGET: ${{ matrix.target }}

- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.target }}
path: pyroscope_ffi/python/dist/*

macos-intel-test:
strategy:
fail-fast: false
matrix:
PYROSCOPE_DETECT_SUBPROCESSES: [1, 0]
PYROSCOPE_ONCPU: [1, 0]
PYROSCOPE_GIL_ONLY: [1, 0]
PYROSCOPE_NATIVE: [1, 0]
PYTHON_VERSION: ['2.7', '3.7', '3.8', '3.9', '3.10']
needs: ['macos-build']
name: Macos Test
runs-on: macos-11.0
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.PYTHON_VERSION }}
architecture: x64
- uses: actions/download-artifact@master
with:
name: x86_64-apple-darwin
path: "${{github.workspace}}/python"

- run: "python --version"
- run: "python3 --version"
- run: "cd ${{ github.workspace }}/python && ls -l"
- run: "cd ${{ github.workspace }}/python && pip3 install *.whl"
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Run Python Script
run: pyroscope_ffi/python/scripts/tests/test.py
env:
PYROSCOPE_RUN_ID: ${{ github.run_id }}
PYROSCOPE_ARCH: x86-64-apple-darwin
PYROSCOPE_API_TOKEN: ${{ secrets.PYROSCOPE_API_TOKEN }}
PYROSCOPE_DETECT_SUBPROCESSES: ${{ matrix.PYROSCOPE_DETECT_SUBPROCESSES }}
PYROSCOPE_ONCPU: ${{ matrix.PYROSCOPE_ONCPU }}
PYROSCOPE_GIL_ONLY: ${{ matrix.PYROSCOPE_GIL_ONLY }}
PYROSCOPE_NATIVE: ${{ matrix.PYROSCOPE_NATIVE }}
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}

sdist-build:
name: sdist
runs-on: ubuntu-latest

steps:
- uses: AutoModality/action-clean@v1
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Build sdist
run: python setup.py sdist
working-directory: pyroscope_ffi/python

- uses: actions/upload-artifact@v2
with:
name: "sdist.whl"
path: pyroscope_ffi/python/dist/*
Loading

0 comments on commit 0d2f487

Please sign in to comment.