Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TEMP] Poc arm build wf test #1176

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
8235772
lets try out
intuibase Oct 4, 2023
d703967
next try
intuibase Oct 4, 2023
411ff64
next try
intuibase Oct 4, 2023
d38df4a
test
intuibase Oct 4, 2023
b141c95
test
intuibase Oct 4, 2023
77c0e25
test
intuibase Oct 4, 2023
bf7c4d7
test
intuibase Oct 4, 2023
745ccfb
yet another test
intuibase Oct 5, 2023
12520d6
test
intuibase Oct 5, 2023
8568c5d
Enable build with Elastic conan artifactory
intuibase Oct 5, 2023
4d8e069
fixed url
intuibase Oct 5, 2023
3c74fb0
enable multicpu
intuibase Oct 5, 2023
1ea76c2
remote remove func
intuibase Oct 5, 2023
46f6c6c
running qemu conditionally
intuibase Oct 6, 2023
2b9385f
fixed conditions
intuibase Oct 6, 2023
eada539
Merge branch 'main' into poc_arm_build
intuibase Oct 18, 2023
e788dc9
Merge branch 'main' into poc_conan_artifacts
intuibase Oct 18, 2023
87cfbbb
Merge branch 'poc_conan_artifacts' into poc_arm_build
intuibase Oct 18, 2023
8ebecc3
remove multicpu build
intuibase Oct 18, 2023
c341cb3
fixed flaky test
intuibase Oct 18, 2023
ad349f7
log
intuibase Oct 19, 2023
812fd56
log
intuibase Oct 19, 2023
f3aff84
fixed inferred spans initial interval counter
intuibase Oct 19, 2023
fd9cf65
build on half of cpu cores
intuibase Oct 19, 2023
89fe3ac
build on all cpus
intuibase Oct 19, 2023
51fb61a
disabled multicore build
intuibase Oct 23, 2023
f39daf5
phpt tests
intuibase Oct 23, 2023
4a8634a
forcing platform
intuibase Oct 23, 2023
9bf7919
timeout increase
intuibase Oct 23, 2023
5c162dd
choosing docker platform in makefile
intuibase Nov 3, 2023
8c94cac
fixed choosing of dockerfile
intuibase Nov 3, 2023
77ab8d3
manual trigger with arch selection test
intuibase Nov 20, 2023
db0829a
dynamic matrix generation
intuibase Nov 23, 2023
8b7d3f9
missing checkout
intuibase Nov 23, 2023
5552c70
Merge branch 'main' into poc_arm_build
intuibase Nov 23, 2023
8f9fa67
fixed strings concat
intuibase Nov 23, 2023
4b61de9
default build arch selection
intuibase Nov 23, 2023
6138fcd
temp. allow to trigger release
intuibase Nov 23, 2023
a694912
temp. allow to trigger release
intuibase Nov 23, 2023
0db4d2b
fixed deprecations
intuibase Nov 23, 2023
8641f79
fixed deprecations
intuibase Nov 23, 2023
0c56cbe
yet another try to shared workflow
intuibase Nov 24, 2023
05fe739
yet another try to shared workflow
intuibase Nov 24, 2023
5931aaf
yet another try to shared workflow
intuibase Nov 24, 2023
1013e65
yet another try to shared workflow
intuibase Nov 24, 2023
fe8bb3d
yet another try to shared workflow
intuibase Nov 24, 2023
782b6e1
yet another try to shared workflow
intuibase Nov 24, 2023
85c3575
Merge branch 'main' into poc_arm_build
intuibase Jan 10, 2024
5226a6a
updated conan
intuibase Jan 10, 2024
3b1e00a
removed requirement to specify build arch
intuibase Jan 10, 2024
46aea1f
Merge branch 'main' into poc_arm_build
intuibase Feb 7, 2024
f3187fb
Merge branch 'main' into poc_arm_build
intuibase Jun 26, 2024
4e86d9c
Upated documentation
intuibase Jun 26, 2024
2f4edf0
Enabled ARM build
intuibase Jun 26, 2024
51d30f5
Enabled ARM build
intuibase Jun 26, 2024
f4b78ba
Runing phpt on arm
intuibase Jun 26, 2024
a15c8b9
Fixed matrix include
intuibase Jun 26, 2024
65e77a2
Testing matrix composition
intuibase Jun 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .ci/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
ifeq ($(DOCKERFILE),)
ifeq ($(BUILD_ARCHITECTURE), linuxmusl-x86-64)
DOCKERFILE := Dockerfile.alpine
else ifeq ($(BUILD_ARCHITECTURE), linuxmusl-arm64)
DOCKERFILE := Dockerfile.alpine
else
DOCKERFILE := Dockerfile
endif
endif

DOCKER_PLATFORM := linux/x86_64
ifeq ($(BUILD_ARCHITECTURE), linux-arm64)
DOCKER_PLATFORM := linux/arm64
else ifeq ($(BUILD_ARCHITECTURE), linuxmusl-arm64)
DOCKER_PLATFORM := linux/arm64
endif


SHELL=/bin/bash -o pipefail
MAKEFLAGS += --no-print-directory
IMAGE := test-php
Expand Down Expand Up @@ -45,6 +55,7 @@ prepare: ## Build docker image for building and testing the project
docker build \
--build-arg PHP_VERSION=${PHP_VERSION} --build-arg SEL_DISTRO=${SEL_DISTRO}\
--tag $(IMAGE):${PHP_VERSION}$(SUFFIX) \
--platform $(DOCKER_PLATFORM) \
-f ${DOCKERFILE} .
@echo "::endgroup::"

Expand All @@ -59,8 +70,8 @@ build:
-w /source/agent/native \
-e CONAN_USER_HOME=$(CONAN_USER_HOME) \
elasticobservability/apm-agent-php-dev:native-build-gcc-12.2.0-$(BUILD_ARCHITECTURE)-0.0.2 \
sh -c "cmake --preset $(BUILD_ARCHITECTURE)-release \
&& cmake --build --preset $(BUILD_ARCHITECTURE)-release -j$(nproc)\
sh -c "cmake --preset $(BUILD_ARCHITECTURE)-release \
&& cmake --build --preset $(BUILD_ARCHITECTURE)-release \
&& ctest --preset $(BUILD_ARCHITECTURE)-release --verbose"
@echo "::endgroup::"

Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/build-arch-matrix-generator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---

# Runs the build based on the provided files in test.yml
name: build

on:
workflow_call:
inputs:
build_arch:
required: true
type: string
default: 'x86_64'
outputs:
matrix-combinations:
description: "Matrix of architectures to build for"
value: ${{ jobs.setup-build-matrix.outputs.matrix-combinations }}

jobs:
setup-build-matrix:
name: setup-build-matrix
runs-on: ubuntu-latest
env:
SELECTED_ARCH: ${{ inputs.build_arch }}
outputs:
matrix-combinations: ${{ steps.setup-matrix-combinations.outputs.matrix-combinations }}
steps:
- name: Create build matrix
id: setup-matrix-combinations
run: |
MATRIX=''
if [ "${SELECTED_ARCH}" == "x86_64" ] || [ "${SELECTED_ARCH}" == "all" ]; then
echo "${SELECTED_ARCH} selected. Adding x86_64"
MATRIX+='{"arch": "linux-x86-64"}, {"arch": "linuxmusl-x86-64"}'
fi
if [ "${SELECTED_ARCH}" == "arm64" ] || [ "${SELECTED_ARCH}" == "all" ]; then
echo "${SELECTED_ARCH} selected. Adding arm64"
if [ ! -z "${MATRIX}" ]; then
MATRIX+=','
fi
MATRIX+='{"arch": "linux-arm64", "run_qemu": 1},{"arch": "linuxmusl-arm64", "run_qemu": 1}'
fi
echo "matrix-combinations={\"include\":[$MATRIX]}"

echo "matrix-combinations={\"include\":[$MATRIX]}" >> $GITHUB_OUTPUT
40 changes: 33 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,54 @@
name: build

on:
workflow_call: ~
workflow_call:
inputs:
build_arch:
required: false
type: string
default: 'x86_64'
workflow_dispatch:
inputs:
build_arch:
type: choice
description: Build architecture
default: 'x86_64'
options:
- all
- x86_64
- arm64

permissions:
contents: read

jobs:
setup-build-matrix:
uses: ./.github/workflows/build-arch-matrix-generator.yml
with:
build_arch: ${{ inputs.build_arch }}

build:
name: build-agent-library
runs-on: ubuntu-latest
timeout-minutes: 30
needs: setup-build-matrix
timeout-minutes: 300
strategy:
fail-fast: false
matrix:
arch:
- "linux-x86-64"
- "linuxmusl-x86-64"
matrix: ${{ fromJson(needs.setup-build-matrix.outputs.matrix-combinations) }}
env:
BUILD_ARCHITECTURE: ${{ matrix.arch }}
steps:
- uses: actions/checkout@v4
- if: ${{ matrix.run_qemu }}
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Build
run: make -f .ci/Makefile build
run: |
uname -a
echo "Detected CPUs: $(nproc)"
make -f .ci/Makefile build

- uses: actions/upload-artifact@v3
with:
name: package-parts-${{ matrix.arch }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ permissions:
contents: read

on:
workflow_dispatch: ~
push:
tags: [ "v[0-9]+*" ]
branches:
Expand All @@ -28,6 +29,8 @@ jobs:

build:
uses: ./.github/workflows/build.yml
with:
build_arch: all

build-packages:
permissions:
Expand Down
42 changes: 29 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: test

on:
workflow_call:
inputs:
build_arch:
required: true
type: string
default: 'all'
pull_request:
paths-ignore:
- "**/*.asciidoc"
Expand All @@ -26,13 +32,21 @@ concurrency:
jobs:
build:
uses: ./.github/workflows/build.yml
with:
build_arch: all

setup-build-matrix:
uses: ./.github/workflows/build-arch-matrix-generator.yml
with:
build_arch: all

phpt-tests:
name: phpt-tests
runs-on: ubuntu-latest
needs:
- build
timeout-minutes: 10
- setup-build-matrix
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
Expand All @@ -44,25 +58,27 @@ jobs:
- "8.1"
- "8.2"
- "8.3"
arch:
- "linux-x86-64"
- "linuxmusl-x86-64"
data: ${{ fromJson(needs.setup-build-matrix.outputs.matrix-combinations).include }}
env:
PHP_VERSION: ${{ matrix.php-version }}
BUILD_ARCHITECTURE: ${{ matrix.arch }}
BUILD_ARCHITECTURE: ${{ matrix.data.arch }}
steps:
- uses: actions/checkout@v4
- name: Prepare
run: make -f .ci/Makefile prepare
- uses: actions/download-artifact@v3
with:
name: package-parts-${{ matrix.arch }}
path: agent/native/_build/${{ matrix.arch }}-release/
- name: Display structure of downloaded files
run: ls -R
name: package-parts-${{ matrix.data.arch }}
path: agent/native/_build/${{ matrix.data.arch }}-release/
- if: ${{ matrix.data.run_qemu }}
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Prepare
run: make -f .ci/Makefile prepare
- name: phpt-unit-tests
run: make -f .ci/Makefile run-phpt-tests

run: |
tree agent/native/_build/
uname -a
make -f .ci/Makefile run-phpt-tests
static-checks-unit-tests:
name: static-checks-unit-tests
runs-on: ubuntu-latest
Expand Down
8 changes: 5 additions & 3 deletions docs/setup.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ endif::[]
=== Prerequisites

[discrete]
==== Operating system
The agent is currently only available for the Linux operating system.
==== Operating system and architecture
We officially support Linux systems (glibc, deb and rpm packages) and Alpine Linux (musl libc - apk packages) for x86_64 (AMD64) processors.

NOTE: Experimentally, we also provide packages for the ARM64 architecture - please note that these packages have not been fully tested.

[discrete]
==== PHP
The agent supports PHP versions 7.2-8.2.
The agent supports PHP versions 7.2-8.3.

[discrete]
==== curl
Expand Down
3 changes: 2 additions & 1 deletion docs/supported-technologies.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ We will use the results to add support for the most requested technologies.
[[supported-os]]
=== Operating systems

The agent supports Linux operating system.
We officially support Linux systems (glibc, deb and rpm packages) and Alpine Linux (musl libc - apk packages) for x86_64 (AMD64) processors.
Experimentally, we also provide packages for the ARM64 architecture - please note that these packages have not been fully tested.

[float]
[[supported-php-versions]]
Expand Down
Loading