diff --git a/.github/actions/package_solarwinds_apm/action.yaml b/.github/actions/package_solarwinds_apm/action.yaml index e26f781f..6d673231 100644 --- a/.github/actions/package_solarwinds_apm/action.yaml +++ b/.github/actions/package_solarwinds_apm/action.yaml @@ -10,7 +10,7 @@ description: Package solarwinds_apm runs: using: 'docker' - image: quay.io/pypa/manylinux2014_x86_64:latest + image: quay.io/pypa/manylinux_2_28_x86_64:latest entrypoint: 'make' args: - 'package' \ No newline at end of file diff --git a/.github/workflows/build_publish_packagecloud.yaml b/.github/workflows/build_publish_packagecloud.yaml index 28f32f8f..d1a3ef9f 100644 --- a/.github/workflows/build_publish_packagecloud.yaml +++ b/.github/workflows/build_publish_packagecloud.yaml @@ -13,9 +13,9 @@ jobs: build_publish: runs-on: ubuntu-latest container: - image: quay.io/pypa/manylinux2014_x86_64:latest + image: quay.io/pypa/manylinux_2_28_x86_64:latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install Ruby run: | gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB && \ diff --git a/.github/workflows/build_publish_pypi_and_draft_release.yaml b/.github/workflows/build_publish_pypi_and_draft_release.yaml index 336d1417..7be608f7 100644 --- a/.github/workflows/build_publish_pypi_and_draft_release.yaml +++ b/.github/workflows/build_publish_pypi_and_draft_release.yaml @@ -21,7 +21,7 @@ jobs: name: Check if version valid runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Check version run: cd .github/scripts && ./is_publishable.sh ${{ github.event.inputs.version }} @@ -30,7 +30,7 @@ jobs: needs: is_publishable runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/package_solarwinds_apm - name: Install Twine run: pip install --upgrade --no-cache-dir --prefer-binary twine @@ -48,7 +48,7 @@ jobs: needs: build_publish_and_release runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Initialize git run: | git config user.name "GitHub Actions" diff --git a/.github/workflows/build_publish_testpypi.yaml b/.github/workflows/build_publish_testpypi.yaml index a7bd5373..011d8def 100644 --- a/.github/workflows/build_publish_testpypi.yaml +++ b/.github/workflows/build_publish_testpypi.yaml @@ -13,7 +13,7 @@ jobs: build_publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/package_solarwinds_apm - name: Install Twine run: pip install --upgrade --no-cache-dir --prefer-binary twine diff --git a/.github/workflows/codeql_analysis.yml b/.github/workflows/codeql_analysis.yml index fcfa9cf8..18822018 100644 --- a/.github/workflows/codeql_analysis.yml +++ b/.github/workflows/codeql_analysis.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/create_release_pr.yaml b/.github/workflows/create_release_pr.yaml index f17574c2..51dd29a4 100644 --- a/.github/workflows/create_release_pr.yaml +++ b/.github/workflows/create_release_pr.yaml @@ -21,7 +21,7 @@ jobs: create_release_pr: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Initialize git run: | git config user.name "GitHub Actions" diff --git a/.github/workflows/verify_install.yaml b/.github/workflows/verify_install.yaml index 27bd36cb..bbaadb89 100644 --- a/.github/workflows/verify_install.yaml +++ b/.github/workflows/verify_install.yaml @@ -36,27 +36,13 @@ jobs: # Python 3.7 #-------------------------------------------------------------------- - py37_install_debian9: - runs-on: ubuntu-latest - container: - image: python:3.7-stretch - options: --hostname py3.7-debian9 - steps: - - uses: actions/checkout@v2 - - name: Setup and run install test - working-directory: ./tests/docker/install - run: ./_helper_run_install_tests.sh - shell: sh - env: - MODE: ${{ github.event.inputs.install-registry }} - py37_install_debian10: runs-on: ubuntu-latest container: image: python:3.7-buster options: --hostname py3.7-debian10 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -70,7 +56,7 @@ jobs: image: ubuntu:18.04 options: --hostname py3.7-ubuntu18.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -88,7 +74,21 @@ jobs: run: | yum update -y yum install -y git tar - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - name: Setup and run install test + working-directory: ./tests/docker/install + run: ./_helper_run_install_tests.sh + shell: sh + env: + MODE: ${{ github.event.inputs.install-registry }} + + py37_install_alpine312: + runs-on: ubuntu-latest + container: + image: python:3.7-alpine3.12 + options: --hostname py3.7-alpine3.12 + steps: + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -102,7 +102,21 @@ jobs: image: python:3.7-alpine3.13 options: --hostname py3.7-alpine3.13 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - name: Setup and run install test + working-directory: ./tests/docker/install + run: ./_helper_run_install_tests.sh + shell: sh + env: + MODE: ${{ github.event.inputs.install-registry }} + + py37_install_alpine317: + runs-on: ubuntu-latest + container: + image: python:3.7-alpine3.17 + options: --hostname py3.7-alpine3.17 + steps: + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -120,7 +134,7 @@ jobs: image: python:3.8-buster options: --hostname py3.8-debian10 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -134,7 +148,7 @@ jobs: image: ubuntu:18.04 options: --hostname py3.8-ubuntu18.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -148,21 +162,7 @@ jobs: image: ubuntu:20.04 options: --hostname py3.8-ubuntu20.04 steps: - - uses: actions/checkout@v2 - - name: Setup and run install test - working-directory: ./tests/docker/install - run: ./_helper_run_install_tests.sh - shell: sh - env: - MODE: ${{ github.event.inputs.install-registry }} - - py38_install_centos7: - runs-on: ubuntu-latest - container: - image: centos/python-38-centos7 - options: --hostname py3.8-centos7 - steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -170,13 +170,13 @@ jobs: env: MODE: ${{ github.event.inputs.install-registry }} - py38_install_amazon201803: + py38_install_alpine312: runs-on: ubuntu-latest container: - image: amazonlinux:2018.03 - options: --hostname py3.8-amazon2018.03 + image: python:3.8-alpine3.12 + options: --hostname py3.8-alpine3.12 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -190,7 +190,7 @@ jobs: image: python:3.8-alpine3.13 options: --hostname py3.8-alpine3.13 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -208,7 +208,7 @@ jobs: image: python:3.9-buster options: --hostname py3.9-debian10 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -222,7 +222,7 @@ jobs: image: ubuntu:20.04 options: --hostname py3.9-ubuntu20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -236,7 +236,21 @@ jobs: image: centos:8 options: --hostname py3.9-centos8 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - name: Setup and run install test + working-directory: ./tests/docker/install + run: ./_helper_run_install_tests.sh + shell: sh + env: + MODE: ${{ github.event.inputs.install-registry }} + + py39_install_alpine312: + runs-on: ubuntu-latest + container: + image: python:3.9-alpine3.12 + options: --hostname py3.9-alpine3.12 + steps: + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -250,7 +264,7 @@ jobs: image: python:3.9-alpine3.13 options: --hostname py3.9-alpine3.13 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -264,7 +278,35 @@ jobs: image: python:3.9-alpine3.16 options: --hostname py3.9-alpine3.16 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - name: Setup and run install test + working-directory: ./tests/docker/install + run: ./_helper_run_install_tests.sh + shell: sh + env: + MODE: ${{ github.event.inputs.install-registry }} + + py39_install_alpine317: + runs-on: ubuntu-latest + container: + image: python:3.9-alpine3.17 + options: --hostname py3.9-alpine3.17 + steps: + - uses: actions/checkout@v3 + - name: Setup and run install test + working-directory: ./tests/docker/install + run: ./_helper_run_install_tests.sh + shell: sh + env: + MODE: ${{ github.event.inputs.install-registry }} + + py39_install_rhel8: + runs-on: ubuntu-latest + container: + image: registry.fedoraproject.org/f33/python3 + options: --hostname py3.9-rhel8 + steps: + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -282,7 +324,7 @@ jobs: image: python:3.10-buster options: --hostname py3.10-debian10 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -296,7 +338,7 @@ jobs: image: ubuntu:20.04 options: --hostname py3.10-ubuntu20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -310,7 +352,7 @@ jobs: image: python:3.10-alpine3.13 options: --hostname py3.10-alpine3.13 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -324,7 +366,21 @@ jobs: image: python:3.10-alpine3.16 options: --hostname py3.10-alpine3.16 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - name: Setup and run install test + working-directory: ./tests/docker/install + run: ./_helper_run_install_tests.sh + shell: sh + env: + MODE: ${{ github.event.inputs.install-registry }} + + py310_install_alpine317: + runs-on: ubuntu-latest + container: + image: python:3.10-alpine3.17 + options: --hostname py3.10-alpine3.17 + steps: + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -342,7 +398,7 @@ jobs: image: python:3.11-rc-buster options: --hostname py3.11-debian10 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -356,7 +412,7 @@ jobs: image: ubuntu:20.04 options: --hostname py3.11-ubuntu20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh @@ -367,13 +423,27 @@ jobs: py311_install_alpine316: runs-on: ubuntu-latest container: - image: python:3.11-rc-alpine3.16 + image: python:3.11-alpine3.16 options: --hostname py3.11-alpine3.16 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup and run install test working-directory: ./tests/docker/install run: ./_helper_run_install_tests.sh shell: sh env: MODE: ${{ github.event.inputs.install-registry }} + + py311_install_alpine317: + runs-on: ubuntu-latest + container: + image: python:3.11-alpine3.17 + options: --hostname py3.11-alpine3.17 + steps: + - uses: actions/checkout@v3 + - name: Setup and run install test + working-directory: ./tests/docker/install + run: ./_helper_run_install_tests.sh + shell: sh + env: + MODE: ${{ github.event.inputs.install-registry }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2dbe033b..6861a28b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ lib64/ parts/ sdist/ var/ +wheel/ wheels/ pip-wheel-metadata/ share/python-wheels/ @@ -26,6 +27,7 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST +log.txt # PyInstaller # Usually these files are written by a python script from a template diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b04ef15..41d62ab1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/solarwindscloud/solarwinds-apm-python/compare/rel-0.5.0...HEAD) +### Changed +- SolarWinds c-lib 12.0.0, for gRPC upgrade ([#107](https://github.com/solarwindscloud/solarwinds-apm-python/pull/107)) + +### Removed +- Drop centos7 support ([#107](https://github.com/solarwindscloud/solarwinds-apm-python/pull/107)) +- Drop Debian 9 support ([#107](https://github.com/solarwindscloud/solarwinds-apm-python/pull/107)) +- Drop Amazon Linux 2018.03 support ([#107](https://github.com/solarwindscloud/solarwinds-apm-python/pull/107)) + ## [0.5.0](https://github.com/solarwindscloud/solarwinds-apm-python/releases/tag/rel-0.5.0) - 2023-01-18 ### Added - Add support for OTEL_SERVICE_NAME, OTEL_RESOURCE_ATTRIBUTES environment variables ([#90](https://github.com/solarwindscloud/solarwinds-apm-python/pull/90)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 13ddb89d..9b919d60 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,7 +36,7 @@ docker build -t dev-container . ./run_docker_dev.sh ``` -The build container is based on the [PyPA image](https://github.com/pypa/manylinux) `manylinux2014_x86_64`. It uses [SWIG](https://www.swig.org/Doc1.3/Python.html) to compile required C/C++ libraries into a C-extension dependency. +The build container is based on the [PyPA image](https://github.com/pypa/manylinux) `manylinux_2_28_x86_64`. It uses [SWIG](https://www.swig.org/Doc1.3/Python.html) to compile required C/C++ libraries into a C-extension dependency. ### Regression Tests diff --git a/Dockerfile b/Dockerfile index 237697f4..d9b5d1ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # build development environment to locally build solarwinds_apm Python agent and publish RC versions -FROM quay.io/pypa/manylinux2014_x86_64 +FROM quay.io/pypa/manylinux_2_28_x86_64 # install: # boto3 for interaction with AWS diff --git a/Makefile b/Makefile index 223dbbd5..085ed73a 100644 --- a/Makefile +++ b/Makefile @@ -33,9 +33,9 @@ nothing: #----------------------------------------------------------------------------------------------------------------------# # LIBOBOE is the name of the liboboe shared library -LIBOBOEALPINE := "liboboe-1.0-alpine-x86_64.so.0.0.0" -LIBOBOEORG := "liboboe-1.0-x86_64.so.0.0.0" -LIBOBOESERVERLESS := "liboboe-1.0-lambda-x86_64.so.0.0.0" +LIBOBOEALPINE := "liboboe-1.0-alpine-x86_64.so" +LIBOBOEORG := "liboboe-1.0-x86_64.so" +LIBOBOESERVERLESS := "liboboe-1.0-lambda-x86_64.so" # Version of the C-library extension is stored under /solarwinds_apm/extension/VERSION (Otel export compatible as of 10.3.4) OBOEVERSION := $(shell cat ./solarwinds_apm/extension/VERSION) @@ -122,7 +122,7 @@ check-swig: # recipes for building the package distribution #----------------------------------------------------------------------------------------------------------------------# -wheel_tag := 'manylinux2014_x86_64' +wheel_tag := 'manylinux_2_28_x86_64' # Build the Python wrapper from liboboe headers inside build container wrapper: check-swig download-all @@ -178,8 +178,8 @@ aws-lambda: wrapper @rm ${target_dir}/solarwinds_apm/extension/*.so* @echo -e "Building AWS Lambda version of C-extensions for all supported Python versions in target directory." @set -e; for PYBIN in cp37-cp37m cp38-cp38; do /opt/python/$${PYBIN}/bin/python setup.py build_ext_lambda -b ${target_dir}; done - @echo -e "Copying AWS Lambda specific Oboe library liboboe-1.0-lambda-x86_64.so.0.0.0 into target directory." - @cp solarwinds_apm/extension/liboboe-1.0-lambda-x86_64.so.0.0.0 ${target_dir}/solarwinds_apm/extension/liboboe-1.0.so.0 + @echo -e "Copying AWS Lambda specific Oboe library liboboe-1.0-lambda-x86_64.so into target directory." + @cp solarwinds_apm/extension/liboboe-1.0-lambda-x86_64.so ${target_dir}/solarwinds_apm/extension/liboboe.so @rm -rf ${target_dir}/*-info @find ${target_dir} -type d -name '__pycache__' | xargs rm -rf @if [[ ! -d dist ]]; then mkdir dist; fi @@ -207,7 +207,7 @@ OTELOBOEREPO := /code/solarwinds-apm-liboboe/liboboe copy-liboboe: @echo -e "Copying shared library.\n" @cd solarwinds_apm/extension; \ - cp "${OTELOBOEREPO}/liboboe-1.0-x86_64.so.0.0.0" .; \ + cp "${OTELOBOEREPO}/liboboe-1.0-x86_64.so" .; \ if [ $$? -ne 0 ]; then echo " **** failed to copy shared library ****" ; exit 1; fi; # Copy liboboe header files (Python wrapper for Oboe c-lib) from source specified in OTELOBOEREPO @@ -266,7 +266,7 @@ lint: # clean up extension and intermediate build/dist files. clean: @echo -e "Cleaning up extension and intermediate build/dist files." - @cd solarwinds_apm/extension; rm -f oboe* liboboe-1.0*so* liboboe.so; rm -rf bson + @cd solarwinds_apm/extension; rm -f _oboe* oboe* liboboe*so*; rm -rf bson @cd .. @find . -type f -name '*.pyc' -delete @find . -type d -name '__pycache__' | xargs rm -rf diff --git a/pyproject.toml b/pyproject.toml index a5ed2cf7..3ab16987 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools"] +requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" [tool.black] diff --git a/setup.cfg b/setup.cfg index c6bc6cf4..533edcb2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,7 +29,7 @@ install_requires = packages = solarwinds_apm, solarwinds_apm.certs, solarwinds_apm.extension [options.package_data] -solarwinds_apm = extension/liboboe-1.0.so.0, extension/VERSION, extension/bson/bson.h, extension/bson/platform_hacks.h +solarwinds_apm = extension/liboboe.so, extension/VERSION, extension/bson/bson.h, extension/bson/platform_hacks.h [options.entry_points] opentelemetry_distro = diff --git a/setup.py b/setup.py index 17da8760..5682e89b 100644 --- a/setup.py +++ b/setup.py @@ -48,14 +48,14 @@ def os_supported(): def link_oboe_lib(src_lib): """Set up the C-extension libraries. - Create two .so library symlinks, namely 'liboboe-1.0.so' and 'liboboe-1.0.so.0 which are needed when the + Create two .so library symlinks, namely 'liboboe.so' and 'liboboe.so.0 which are needed when the solarwinds_apm package is built from source. This step is needed since Oboe library is platform specific. The src_lib parameter is the name of the library file under solarwinds_apm/extension the above mentioned symlinks will point to. If a file with the provided name does not exist, no symlinks will be created.""" logger.info("Create links to platform specific liboboe library file") - link_dst = ('liboboe-1.0.so', 'liboboe-1.0.so.0') + link_dst = ('liboboe.so', 'liboboe.so.0') cwd = os.getcwd() try: os.chdir('./solarwinds_apm/extension/') @@ -83,13 +83,13 @@ def run(self): if sys.platform == 'darwin': return - oboe_lib = "liboboe-1.0-alpine-x86_64.so.0.0.0" if is_alpine_distro() else "liboboe-1.0-x86_64.so.0.0.0" + oboe_lib = "liboboe-1.0-alpine-x86_64.so" if is_alpine_distro() else "liboboe-1.0-x86_64.so" link_oboe_lib(oboe_lib) build_ext.run(self) class CustomBuildExtLambda(build_ext): def run(self): - link_oboe_lib("liboboe-1.0-lambda-x86_64.so.0.0.0") + link_oboe_lib("liboboe-1.0-lambda-x86_64.so") build_ext.run(self) @@ -112,7 +112,7 @@ def run(self): 'solarwinds_apm/extension', 'solarwinds_apm' ], - libraries=['oboe-1.0', 'rt'], + libraries=['oboe', 'rt'], library_dirs=['solarwinds_apm/extension'], extra_compile_args=["-std=c++11"], runtime_library_dirs=['$ORIGIN']), diff --git a/solarwinds_apm/apm_config.py b/solarwinds_apm/apm_config.py index ccbc659b..a38379a4 100644 --- a/solarwinds_apm/apm_config.py +++ b/solarwinds_apm/apm_config.py @@ -332,7 +332,8 @@ def _calculate_service_name( See also OTel SDK Resource.create and env vars: * https://github.com/open-telemetry/opentelemetry-python/blob/f5fb6b1353929cf8039b1d38f97450866357d901/opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py#L156-L184 - * https://github.com/open-telemetry/opentelemetry-python/blob/8a0ce154ae27a699598cbf3ccc6396eb012902d6/opentelemetry-sdk/src/opentelemetry/sdk/environment_variables.py#L15-L39""" + * https://github.com/open-telemetry/opentelemetry-python/blob/8a0ce154ae27a699598cbf3ccc6396eb012902d6/opentelemetry-sdk/src/opentelemetry/sdk/environment_variables.py#L15-L39 + """ service_name = "" if agent_enabled: # OTel SDK default service.name is "unknown_service" in-code: @@ -509,7 +510,8 @@ def update_with_kwargs(self, kwargs): # pylint: disable=too-many-branches,too-many-statements def _set_config_value(self, keys: str, val: Any) -> Any: """Sets the value of the config option indexed by 'keys' to 'val', where 'keys' is a nested key (separated by - self.delimiter, i.e., the position of the element to be changed in the nested dictionary)""" + self.delimiter, i.e., the position of the element to be changed in the nested dictionary) + """ def _convert_to_bool(val): """Converts given value to boolean value""" diff --git a/solarwinds_apm/apm_logging.py b/solarwinds_apm/apm_logging.py index dccecdf2..a30f2d1c 100644 --- a/solarwinds_apm/apm_logging.py +++ b/solarwinds_apm/apm_logging.py @@ -41,7 +41,8 @@ class ApmLoggingLevel: """Abstract mapping class providing a conversion between solarwinds_apm agent logging level and Python logging module logging levels. - The solarwinds_apm package has seven different log levels, which are defined in the debug_levels dictionary.""" + The solarwinds_apm package has seven different log levels, which are defined in the debug_levels dictionary. + """ # maps string representation of solarwinds_apm.sw_logging levels to their integer counterpart debug_levels = { diff --git a/solarwinds_apm/extension/VERSION b/solarwinds_apm/extension/VERSION index 68d8f15e..b0d36450 100644 --- a/solarwinds_apm/extension/VERSION +++ b/solarwinds_apm/extension/VERSION @@ -1 +1 @@ -11.1.0 +12.0.0 \ No newline at end of file diff --git a/solarwinds_apm/inbound_metrics_processor.py b/solarwinds_apm/inbound_metrics_processor.py index d3a3d102..7660dbb9 100644 --- a/solarwinds_apm/inbound_metrics_processor.py +++ b/solarwinds_apm/inbound_metrics_processor.py @@ -24,7 +24,6 @@ class SolarWindsInboundMetricsSpanProcessor(SpanProcessor): - _HTTP_METHOD = SpanAttributes.HTTP_METHOD # "http.method" _HTTP_ROUTE = SpanAttributes.HTTP_ROUTE # "http.route" _HTTP_STATUS_CODE = SpanAttributes.HTTP_STATUS_CODE # "http.status_code" diff --git a/solarwinds_apm/version.py b/solarwinds_apm/version.py index 1c2af78f..19de5692 100644 --- a/solarwinds_apm/version.py +++ b/solarwinds_apm/version.py @@ -5,4 +5,4 @@ # 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. """Version of SolarWinds Custom-Distro for OpenTelemetry agents""" -__version__ = "0.5.0" +__version__ = "0.6.0.13" diff --git a/tests/docker/install/_helper_check_sdist.sh b/tests/docker/install/_helper_check_sdist.sh index 03ca00e0..3257f670 100755 --- a/tests/docker/install/_helper_check_sdist.sh +++ b/tests/docker/install/_helper_check_sdist.sh @@ -39,7 +39,7 @@ fi function get_sdist(){ sdist_dir="$PWD/tmp/sdist" - rm -rf sdist_dir + rm -rf "$sdist_dir" if [ "$MODE" == "local" ] then @@ -90,9 +90,9 @@ function check_sdist(){ ./bson ./bson/bson.h ./bson/platform_hacks.h -./liboboe-1.0-alpine-x86_64.so.0.0.0 -./liboboe-1.0-lambda-x86_64.so.0.0.0 -./liboboe-1.0-x86_64.so.0.0.0 +./liboboe-1.0-alpine-x86_64.so +./liboboe-1.0-lambda-x86_64.so +./liboboe-1.0-x86_64.so ./oboe.h ./oboe.py ./oboe_api.cpp diff --git a/tests/docker/install/_helper_check_wheel.sh b/tests/docker/install/_helper_check_wheel.sh index 25d2d01b..07df97de 100755 --- a/tests/docker/install/_helper_check_wheel.sh +++ b/tests/docker/install/_helper_check_wheel.sh @@ -53,7 +53,7 @@ function get_wheel(){ if [ -z "$PIP_INSTALL" ]; then echo -e "PIP_INSTALL not specified." echo -e "Only testing the cp38 x86_64 wheel under ${APM_ROOT}" - tested_wheel=$(find "$APM_ROOT"/dist/* -name "solarwinds_apm-$SOLARWINDS_APM_VERSION-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl") + tested_wheel=$(find "$APM_ROOT"/dist/* -name "solarwinds_apm-$SOLARWINDS_APM_VERSION-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl") else # we need to select the right wheel (there might be multiple wheel versions in the dist directory) pip download \ @@ -105,7 +105,7 @@ function check_wheel(){ ./bson ./bson/bson.h ./bson/platform_hacks.h -./liboboe-1.0.so.0 +./liboboe.so ./oboe.py" unzip "$tested_wheel" -d "$unpack_directory" # shellcheck disable=SC1091 @@ -127,6 +127,9 @@ function get_and_check_wheel(){ # Python wheels are not available under Alpine Linux if [[ -f /etc/os-release && "$(cat /etc/os-release)" =~ "Alpine" ]]; then echo "Wheels are not available on Alpine Linux, skip wheel tests." + # Amazon Linux 2's glibc version is too old to use wheels built by manylinux_2_28 + elif [[ -f /etc/os-release && "$(cat /etc/os-release)" =~ "Amazon" ]]; then + echo "Wheels are not available on Amazon Linux, skip wheel tests." else get_wheel check_wheel "$tested_wheel" diff --git a/tests/docker/install/_helper_run_install_tests.sh b/tests/docker/install/_helper_run_install_tests.sh index c78392c8..f8f35147 100755 --- a/tests/docker/install/_helper_run_install_tests.sh +++ b/tests/docker/install/_helper_run_install_tests.sh @@ -62,16 +62,28 @@ echo "Installing test dependencies for Python $python_version on $pretty_name" # py3.10,3.11 not currently on main apt repo so use deadsnakes apt-get install -y software-properties-common add-apt-repository ppa:deadsnakes/ppa -y + apt-get install -y \ + python3 \ + python3-distutils \ + python3-dev \ + python3-setuptools \ + build-essential \ + unzip \ + wget \ + curl + update-alternatives --install /usr/bin/python python "/usr/bin/python3" 1 + else + apt-get install -y \ + "python$python_version" \ + "python$python_version-distutils" \ + "python$python_version-dev" \ + python3-setuptools \ + build-essential \ + unzip \ + wget \ + curl + update-alternatives --install /usr/bin/python python "/usr/bin/python$python_version" 1 fi - apt-get install -y \ - "python$python_version" \ - "python$python_version-distutils" \ - "python$python_version-dev" \ - build-essential \ - unzip \ - wget \ - curl - update-alternatives --install /usr/bin/python python "/usr/bin/python$python_version" 1 # Make sure we don't install py3.6's pip # Official get-pip documentation: @@ -114,7 +126,7 @@ echo "Installing test dependencies for Python $python_version on $pretty_name" fi } >/dev/null -# need at least pip 19.3 to find manylinux2014 wheels +# need at least pip 19.3 to find manylinux wheels pip install --upgrade pip >/dev/null # run tests using bash so we can use pipefail diff --git a/tests/docker/install/ao_issuer_ca_public_cert.crt b/tests/docker/install/ao_issuer_ca_public_cert.crt old mode 100644 new mode 100755 diff --git a/tests/docker/install/app.py b/tests/docker/install/app.py old mode 100644 new mode 100755 diff --git a/tests/docker/install/client.py b/tests/docker/install/client.py old mode 100644 new mode 100755 diff --git a/tests/docker/install/docker-compose.yml b/tests/docker/install/docker-compose.yml old mode 100644 new mode 100755 index f5beabd1..e2878a41 --- a/tests/docker/install/docker-compose.yml +++ b/tests/docker/install/docker-compose.yml @@ -11,7 +11,7 @@ # under the project dist/ directory # # use the `run` command to get an interactive container for debugging: -# (debian|centos|amazon) $ docker-compose run --rm /bin/bash +# (debian|centos|amazon|fedora) $ docker-compose run --rm /bin/bash # (alpine) $ docker-compose run --rm /bin/sh # # See Confluence for more info: @@ -35,6 +35,7 @@ x-envvars-install-test: &envvars-install-test x-volumes-codebase: &volumes-codebase volumes: - ../../../:/code/python-solarwinds + - ./:/workspace:rw - ./_helper_run_install_tests.sh:/workspace/_helper_run_install_tests.sh - ./_helper_check_extension_files.sh:/workspace/_helper_check_extension_files.sh - ./_helper_check_sdist.sh:/workspace/_helper_check_sdist.sh @@ -93,6 +94,15 @@ services: environment: << : *envvars-install-test + py3.7-install-alpine3.12: + hostname: "py3.7-alpine3.12" + image: "python:3.7-alpine3.12" + << : *command-install-test + << : *workdir + << : *volumes-codebase + environment: + << : *envvars-install-test + py3.7-install-alpine3.13: hostname: "py3.7-alpine3.13" image: "python:3.7-alpine3.13" @@ -102,6 +112,15 @@ services: environment: << : *envvars-install-test + py3.7-install-alpine3.17: + hostname: "py3.7-alpine3.17" + image: "python:3.7-alpine3.17" + << : *command-install-test + << : *workdir + << : *volumes-codebase + environment: + << : *envvars-install-test + #-------------------------------------------------------------------- # Python 3.8 #-------------------------------------------------------------------- @@ -133,19 +152,18 @@ services: environment: << : *envvars-install-test - py3.8-install-centos7: - hostname: "py3.8-centos7" - image: "centos/python-38-centos7" - user: root + py3.8-install-amazon2018.03: + hostname: "py3.8-amazon2018.03" + image: "amazonlinux:2018.03" << : *command-install-test << : *workdir << : *volumes-codebase environment: << : *envvars-install-test - py3.8-install-amazon2018.03: - hostname: "py3.8-amazon2018.03" - image: "amazonlinux:2018.03" + py3.8-install-alpine3.12: + hostname: "py3.8-alpine3.12" + image: "python:3.8-alpine3.12" << : *command-install-test << : *workdir << : *volumes-codebase @@ -192,6 +210,15 @@ services: environment: << : *envvars-install-test + py3.9-install-alpine3.12: + hostname: "py3.9-alpine3.12" + image: "python:3.9-alpine3.12" + << : *command-install-test + << : *workdir + << : *volumes-codebase + environment: + << : *envvars-install-test + py3.9-install-alpine3.13: hostname: "py3.9-alpine3.13" image: "python:3.9-alpine3.13" @@ -210,6 +237,24 @@ services: environment: << : *envvars-install-test + py3.9-install-alpine3.17: + hostname: "py3.9-alpine3.17" + image: "python:3.9-alpine3.17" + << : *command-install-test + << : *workdir + << : *volumes-codebase + environment: + << : *envvars-install-test + + py3.9-install-rhel8: + hostname: "py3.9-rhel8" + image: "registry.fedoraproject.org/f33/python3" + << : *command-install-test + << : *workdir + << : *volumes-codebase + environment: + << : *envvars-install-test + #-------------------------------------------------------------------- # Python 3.10 #-------------------------------------------------------------------- @@ -250,6 +295,15 @@ services: environment: << : *envvars-install-test + py3.10-install-alpine3.17: + hostname: "py3.10-alpine3.17" + image: "python:3.10-alpine3.17" + << : *command-install-test + << : *workdir + << : *volumes-codebase + environment: + << : *envvars-install-test + #-------------------------------------------------------------------- # Python 3.11 #-------------------------------------------------------------------- @@ -274,9 +328,18 @@ services: py3.11-install-alpine3.16: hostname: "py3.11-alpine3.16" - image: "python:3.11-rc-alpine3.16" + image: "python:3.11-alpine3.16" << : *command-install-test << : *workdir << : *volumes-codebase environment: << : *envvars-install-test + + py3.11-install-alpine3.17: + hostname: "py3.11-alpine3.17" + image: "python:3.11-alpine3.17" + << : *command-install-test + << : *workdir + << : *volumes-codebase + environment: + << : *envvars-install-test \ No newline at end of file diff --git a/tests/docker/install/install_tests.sh b/tests/docker/install/install_tests.sh index fb51ee31..28846e94 100755 --- a/tests/docker/install/install_tests.sh +++ b/tests/docker/install/install_tests.sh @@ -44,7 +44,7 @@ function check_installation(){ ./bson ./bson/bson.h ./bson/platform_hacks.h -./liboboe-1.0.so.0 +./liboboe.so ./oboe.py" # agent has been installed already, we only need to find the installed location @@ -156,7 +156,7 @@ function install_test_app_dependencies(){ python_version=$(grep -Eo 'py3.[0-9]+[0-9]*' /etc/hostname | grep -Eo '3.[0-9]+[0-9]*') if [ "$python_version" = "3.10" ] || [ "$python_version" = "3.11" ]; then echo "Re-installing setuptools for Python $python_version" - apt-get remove python-setuptools + apt-get remove -y python3-setuptools pip install --ignore-installed setuptools==65.7.0 fi fi