Skip to content

Commit

Permalink
Merge pull request #111 from solarwindscloud/NH-12708-arm-support
Browse files Browse the repository at this point in the history
NH-12708 Add ARM support
  • Loading branch information
tammy-baylis-swi authored Feb 17, 2023
2 parents 108d7e0 + abed638 commit cbfd1ce
Show file tree
Hide file tree
Showing 21 changed files with 598 additions and 107 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

name: package_solarwinds_apm
name: clean_builds_intermediates

description: Package solarwinds_apm
description: Clean up builds and intermediate files

runs:
using: 'docker'
image: quay.io/pypa/manylinux_2_28_x86_64:latest
entrypoint: 'make'
args:
- 'package'
- 'clean'
27 changes: 12 additions & 15 deletions run_docker_dev.sh → ...package_solarwinds_apm_x86_64/action.yaml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
#!/bin/bash
#
# © 2023 SolarWinds Worldwide, LLC. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
#
# to build the image:
# docker build -t dev-container .
#
# to run the image:
# ./run_docker_dev.sh

docker run -it \
--net=host \
--cap-add SYS_PTRACE \
--workdir /code/solarwinds_apm \
-v "$PWD":/code/solarwinds_apm \
-v "$PWD"/../solarwinds-apm-liboboe/:/code/solarwinds-apm-liboboe \
dev-container bash
name: package_solarwinds_apm_x86_64

description: Package solarwinds_apm for x86_64

runs:
using: 'docker'
image: quay.io/pypa/manylinux_2_28_x86_64:latest
env:
PLATFORM: x86_64
entrypoint: 'make'
args:
- 'package'
49 changes: 38 additions & 11 deletions .github/workflows/build_publish_packagecloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,50 @@ on:
jobs:
build_publish:
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux_2_28_x86_64:latest
steps:
- uses: actions/checkout@v3
- name: Install Ruby
- name: Install Ruby 3.1.1
run: |
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB && \
curl -sSL https://get.rvm.io | bash -s stable && source /etc/profile.d/rvm.sh && \
/usr/local/rvm/bin/rvm install 2.5.1 --disable-binary
sudo apt-get update -y
sudo apt-get install libssl-dev libreadline-dev libgdbm-dev openssl
gpg --keyserver hkp://pgp.mit.edu --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB && \
curl -sSL https://get.rvm.io | bash -s stable && \
source /home/runner/.rvm/scripts/rvm && \
/home/runner/.rvm/bin/rvm install 3.1.1 --disable-binary
- name: Install PackageCloud CLI
run: /usr/local/rvm/bin/rvm 2.5.1 do gem install package_cloud
- uses: ./.github/actions/package_solarwinds_apm
- name: Upload to PackageCloud
run: /home/runner/.rvm/bin/rvm 3.1.1 do gem install package_cloud
- name: Build sdist and x86_64
uses: ./.github/actions/package_solarwinds_apm_x86_64
- name: Upload sdist, x86_64 to PackageCloud
env:
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
run: |
/usr/local/rvm/bin/rvm 2.5.1 do package_cloud push solarwinds/solarwinds-apm-python/python \
/home/runner/.rvm/bin/rvm 3.1.1 do package_cloud push solarwinds/solarwinds-apm-python/python \
dist/solarwinds_apm-$(grep __version__ ./solarwinds_apm/version.py | cut -d= -f 2 | tr -d ' "').tar.gz
/usr/local/rvm/bin/rvm 2.5.1 do package_cloud push solarwinds/solarwinds-apm-python/python \
/home/runner/.rvm/bin/rvm 3.1.1 do package_cloud push solarwinds/solarwinds-apm-python/python \
dist/solarwinds_apm-$(grep __version__ ./solarwinds_apm/version.py | cut -d= -f 2 | tr -d ' "')*.whl
- name: Remove sdist, x86_64 builds and intermediates
uses: ./.github/actions/clean_builds_intermediates
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Build aarch64 in container with QEMU
run: |
sudo docker run \
--platform linux/arm64 \
-e PLATFORM=aarch64 \
-e TWINE_NON_INTERACTIVE=1 \
-e TWINE_USERNAME=__token__ \
-e TWINE_PASSWORD=${{ secrets.SW_APM_PYPI_UPLOAD_TOKEN }} \
-v $(pwd):/home \
-w /home \
--rm quay.io/pypa/manylinux_2_28_aarch64:latest \
/bin/bash -c "yum update -y; yum install -y python3-pip; \
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1; \
pip install --upgrade pip; \
make package"
- name: Upload aarch64 to PackageCloud
env:
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
run: |
/home/runner/.rvm/bin/rvm 3.1.1 do package_cloud push solarwinds/solarwinds-apm-python/python \
dist/solarwinds_apm-$(grep __version__ ./solarwinds_apm/version.py | cut -d= -f 2 | tr -d ' "')*.whl
37 changes: 32 additions & 5 deletions .github/workflows/build_publish_pypi_and_draft_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
- name: Check version
run: cd .github/scripts && ./is_publishable.sh ${{ github.event.inputs.version }}

build_publish_and_release:
name: Build and publish to PyPI
build_publish_sdist_and_x86_64:
name: Build and publish sdist and x86_64
needs: is_publishable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/package_solarwinds_apm
- uses: ./.github/actions/package_solarwinds_apm_x86_64
- name: Install Twine
run: pip install --upgrade --no-cache-dir --prefer-binary twine
- name: Check distribution artifacts
Expand All @@ -42,10 +42,37 @@ jobs:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.SW_APM_PYPI_UPLOAD_TOKEN }}
run: twine upload dist/*


build_publish_aarch64:
name: Build and publish aarch64
needs: is_publishable
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- uses: actions/checkout@v3
- name: Build aarch64 in container with QEMU
run: |
sudo docker run \
--platform linux/arm64 \
-e PLATFORM=aarch64 \
-e TWINE_NON_INTERACTIVE=1 \
-e TWINE_USERNAME=__token__ \
-e TWINE_PASSWORD=${{ secrets.SW_APM_PYPI_UPLOAD_TOKEN }} \
-v $(pwd):/home \
-w /home \
--rm quay.io/pypa/manylinux_2_28_aarch64:latest \
/bin/bash -c "yum update -y; yum install -y python3-pip; \
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1; \
pip install --upgrade pip; \
pip install --upgrade twine; \
make package; \
twine check dist/*; \
twine upload dist/*.whl"
create_release:
name: Create draft release
needs: build_publish_and_release
needs: [build_publish_sdist_and_x86_64, build_publish_aarch64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
35 changes: 32 additions & 3 deletions .github/workflows/build_publish_testpypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ on:
workflow_dispatch:

jobs:
build_publish:
build_publish_sdist_and_x86_64:
name: Build and publish sdist and x86_64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/package_solarwinds_apm
- name: Build x86_64
uses: ./.github/actions/package_solarwinds_apm_x86_64
- name: Install Twine
run: pip install --upgrade --no-cache-dir --prefer-binary twine
- name: Check distribution artifacts
Expand All @@ -25,4 +27,31 @@ jobs:
TWINE_REPOSITORY: testpypi
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.SW_APM_TESTPYPI_UPLOAD_TOKEN }}
run: twine upload dist/*
run: twine upload dist/*

build_publish_aarch64:
name: Build and publish aarch64
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- uses: actions/checkout@v3
- name: Build aarch64 in container with QEMU
run: |
sudo docker run \
--platform linux/arm64 \
-e PLATFORM=aarch64 \
-e TWINE_NON_INTERACTIVE=1 \
-e TWINE_REPOSITORY=testpypi \
-e TWINE_USERNAME=__token__ \
-e TWINE_PASSWORD=${{ secrets.SW_APM_TESTPYPI_UPLOAD_TOKEN }} \
-v $(pwd):/home \
-w /home \
--rm quay.io/pypa/manylinux_2_28_aarch64:latest \
/bin/bash -c "yum update -y; yum install -y python3-pip; \
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1; \
pip install --upgrade pip; \
pip install --upgrade twine; \
make package; \
twine check dist/*; \
twine upload dist/*.whl"
2 changes: 2 additions & 0 deletions .github/workflows/run_tox_lint_format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ jobs:
run: make wrapper
- name: Run tox lint
run: tox -e lint -- --check-only
env:
PLATFORM: x86_64
2 changes: 2 additions & 0 deletions .github/workflows/run_tox_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ jobs:
run: make wrapper
- name: Run tox
run: tox -e py3${{ matrix.python-minor }}-${{ matrix.apm-env }}
env:
PLATFORM: x86_64
Loading

0 comments on commit cbfd1ce

Please sign in to comment.