From 8b2aa02480c6b05e223751db1d1da31bb85d6c74 Mon Sep 17 00:00:00 2001 From: Yonatan Goldschmidt Date: Mon, 12 Jul 2021 23:23:12 +0300 Subject: [PATCH 1/8] Build async-profiler on centos:7 No reason to build on centos:6 really - centos:7 builds work on centos:6 as well. --- Dockerfile | 4 ++-- pyi.Dockerfile | 3 ++- scripts/async_profiler_env.sh | 5 ----- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index f8f64115f..d43774c8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,8 +46,8 @@ COPY scripts/phpspy_build.sh . RUN ./phpspy_build.sh # async-profiler -# centos:6 -FROM centos@sha256:dec8f471302de43f4cfcf82f56d99a5227b5ea1aa6d02fa56344986e1f4610e7 AS async-profiler-builder +# centos:7 +FROM centos@sha256:0f4ec88e21daf75124b8a9e5ca03c37a5e937e0e108a255d890492430789b60e AS async-profiler-builder COPY scripts/async_profiler_env.sh . RUN ./async_profiler_env.sh COPY scripts/async_profiler_build.sh . diff --git a/pyi.Dockerfile b/pyi.Dockerfile index 8e630ac04..08206b324 100644 --- a/pyi.Dockerfile +++ b/pyi.Dockerfile @@ -35,7 +35,8 @@ COPY scripts/phpspy_build.sh . RUN ./phpspy_build.sh # async-profiler -FROM centos@sha256:dec8f471302de43f4cfcf82f56d99a5227b5ea1aa6d02fa56344986e1f4610e7 AS async-profiler-builder +# centos:7 +FROM centos@sha256:0f4ec88e21daf75124b8a9e5ca03c37a5e937e0e108a255d890492430789b60e AS async-profiler-builder COPY scripts/async_profiler_env.sh . RUN ./async_profiler_env.sh COPY scripts/async_profiler_build.sh . diff --git a/scripts/async_profiler_env.sh b/scripts/async_profiler_env.sh index 8839eb4a4..7bab54dae 100755 --- a/scripts/async_profiler_env.sh +++ b/scripts/async_profiler_env.sh @@ -5,9 +5,4 @@ # set -euo pipefail -# fix legacy yum repos. slightly adapted from https://stackoverflow.com/a/53848450 -# this basically comments out all mirrorlist URLs, uncomments all baseurls (all seem to be commented) -# and replaces the domain from mirror.centos.org to vault.centos.org. -sed -i -e 's|^mirrorlist|#mirrorlist|' -e 's|^# *baseurl|baseurl|' -e 's|mirror.centos.org|vault.centos.org|' /etc/yum.repos.d/* - yum install -y gcc g++ gcc-c++.x86_64 make java-1.8.0-openjdk-devel glibc-static git From a9aef69d72abed6af651d094bce4b3158593f166 Mon Sep 17 00:00:00 2001 From: Yonatan Goldschmidt Date: Mon, 12 Jul 2021 23:24:06 +0300 Subject: [PATCH 2/8] Build async-profiler with -static-libstdc++ --- scripts/async_profiler_build.sh | 2 +- scripts/async_profiler_env.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/async_profiler_build.sh b/scripts/async_profiler_build.sh index 6f3ed8d8e..ecd216bef 100755 --- a/scripts/async_profiler_build.sh +++ b/scripts/async_profiler_build.sh @@ -5,5 +5,5 @@ # set -euo pipefail -git clone --depth 1 -b v2.0g3 https://github.com/Granulate/async-profiler.git && cd async-profiler && git reset --hard 51447a849d686e899c1cd393e83f0f7c41685d95 +git clone --depth 1 -b static-libstdcpp https://github.com/Granulate/async-profiler.git && cd async-profiler && git reset --hard 6483566ab9560e882c29e08cea92a37fae4cf77e make release diff --git a/scripts/async_profiler_env.sh b/scripts/async_profiler_env.sh index 7bab54dae..df524332c 100755 --- a/scripts/async_profiler_env.sh +++ b/scripts/async_profiler_env.sh @@ -5,4 +5,4 @@ # set -euo pipefail -yum install -y gcc g++ gcc-c++.x86_64 make java-1.8.0-openjdk-devel glibc-static git +yum install -y gcc g++ gcc-c++.x86_64 libstdc++-static make java-1.8.0-openjdk-devel glibc-static git From cbe1dc5779a6b8c4b7286a2c2f4ec486d9f2be86 Mon Sep 17 00:00:00 2001 From: Yonatan Goldschmidt Date: Tue, 13 Jul 2021 00:18:24 +0300 Subject: [PATCH 3/8] Use static jattach (jattach built on centos:7 doesn't run on centos:6) And anyway there's no reason not to build statically. --- scripts/async_profiler_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/async_profiler_build.sh b/scripts/async_profiler_build.sh index ecd216bef..7aedb8408 100755 --- a/scripts/async_profiler_build.sh +++ b/scripts/async_profiler_build.sh @@ -5,5 +5,5 @@ # set -euo pipefail -git clone --depth 1 -b static-libstdcpp https://github.com/Granulate/async-profiler.git && cd async-profiler && git reset --hard 6483566ab9560e882c29e08cea92a37fae4cf77e +git clone --depth 1 -b static-libstdcpp https://github.com/Granulate/async-profiler.git && cd async-profiler && git reset --hard 9d29169e34abc004f534a85ba6a4cf8920250381 make release From d7188a124bbdf3cedcce0b289a06834c214fc86e Mon Sep 17 00:00:00 2001 From: Yonatan Goldschmidt Date: Tue, 13 Jul 2021 12:18:39 +0300 Subject: [PATCH 4/8] Update async-profiler tag --- scripts/async_profiler_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/async_profiler_build.sh b/scripts/async_profiler_build.sh index 7aedb8408..aeb7c82e1 100755 --- a/scripts/async_profiler_build.sh +++ b/scripts/async_profiler_build.sh @@ -5,5 +5,5 @@ # set -euo pipefail -git clone --depth 1 -b static-libstdcpp https://github.com/Granulate/async-profiler.git && cd async-profiler && git reset --hard 9d29169e34abc004f534a85ba6a4cf8920250381 +git clone --depth 1 -b v2.0g4 https://github.com/Granulate/async-profiler.git && cd async-profiler && git reset --hard 9d29169e34abc004f534a85ba6a4cf8920250381 make release From 1e3714c3a0b5f338db0b57e9db6f8227f174c0d7 Mon Sep 17 00:00:00 2001 From: Yonatan Goldschmidt Date: Tue, 13 Jul 2021 12:19:44 +0300 Subject: [PATCH 5/8] Keep git revision in a variable --- scripts/async_profiler_build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/async_profiler_build.sh b/scripts/async_profiler_build.sh index e529e7f64..8194886cf 100755 --- a/scripts/async_profiler_build.sh +++ b/scripts/async_profiler_build.sh @@ -6,9 +6,10 @@ set -euo pipefail VERSION=v2.0g4 +GIT_REV=9d29169e34abc004f534a85ba6a4cf8920250381 OUTPUT=async-profiler-2.0-linux-x64.tar.gz -git clone --depth 1 -b "$VERSION" https://github.com/Granulate/async-profiler.git && cd async-profiler && git reset --hard 9d29169e34abc004f534a85ba6a4cf8920250381 +git clone --depth 1 -b "$VERSION" https://github.com/Granulate/async-profiler.git && cd async-profiler && git reset --hard "$GIT_REV" make release # add a version file to the build directory From 0defbb464d51b9bc3bb4ab45052d69564a67e98c Mon Sep 17 00:00:00 2001 From: Yonatan Goldschmidt Date: Tue, 13 Jul 2021 12:20:28 +0300 Subject: [PATCH 6/8] Bump gProfiler version --- gprofiler/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gprofiler/__init__.py b/gprofiler/__init__.py index c72e3798a..1436d8fe8 100644 --- a/gprofiler/__init__.py +++ b/gprofiler/__init__.py @@ -1 +1 @@ -__version__ = "1.1.4" +__version__ = "1.1.6" From edd840d5fe8c980ede990a110840765e03e26a10 Mon Sep 17 00:00:00 2001 From: Yonatan Goldschmidt Date: Tue, 13 Jul 2021 15:31:43 +0300 Subject: [PATCH 7/8] Revert "Build async-profiler on centos:7" This reverts commit 8b2aa02480c6b05e223751db1d1da31bb85d6c74. The assumption that it's okay was incorrect. --- Dockerfile | 4 ++-- pyi.Dockerfile | 3 +-- scripts/async_profiler_env.sh | 5 +++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index d43774c8b..f8f64115f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,8 +46,8 @@ COPY scripts/phpspy_build.sh . RUN ./phpspy_build.sh # async-profiler -# centos:7 -FROM centos@sha256:0f4ec88e21daf75124b8a9e5ca03c37a5e937e0e108a255d890492430789b60e AS async-profiler-builder +# centos:6 +FROM centos@sha256:dec8f471302de43f4cfcf82f56d99a5227b5ea1aa6d02fa56344986e1f4610e7 AS async-profiler-builder COPY scripts/async_profiler_env.sh . RUN ./async_profiler_env.sh COPY scripts/async_profiler_build.sh . diff --git a/pyi.Dockerfile b/pyi.Dockerfile index 08206b324..8e630ac04 100644 --- a/pyi.Dockerfile +++ b/pyi.Dockerfile @@ -35,8 +35,7 @@ COPY scripts/phpspy_build.sh . RUN ./phpspy_build.sh # async-profiler -# centos:7 -FROM centos@sha256:0f4ec88e21daf75124b8a9e5ca03c37a5e937e0e108a255d890492430789b60e AS async-profiler-builder +FROM centos@sha256:dec8f471302de43f4cfcf82f56d99a5227b5ea1aa6d02fa56344986e1f4610e7 AS async-profiler-builder COPY scripts/async_profiler_env.sh . RUN ./async_profiler_env.sh COPY scripts/async_profiler_build.sh . diff --git a/scripts/async_profiler_env.sh b/scripts/async_profiler_env.sh index df524332c..b598caf4a 100755 --- a/scripts/async_profiler_env.sh +++ b/scripts/async_profiler_env.sh @@ -5,4 +5,9 @@ # set -euo pipefail +# fix legacy yum repos. slightly adapted from https://stackoverflow.com/a/53848450 +# this basically comments out all mirrorlist URLs, uncomments all baseurls (all seem to be commented) +# and replaces the domain from mirror.centos.org to vault.centos.org. +sed -i -e 's|^mirrorlist|#mirrorlist|' -e 's|^# *baseurl|baseurl|' -e 's|mirror.centos.org|vault.centos.org|' /etc/yum.repos.d/* + yum install -y gcc g++ gcc-c++.x86_64 libstdc++-static make java-1.8.0-openjdk-devel glibc-static git From 96bca668bb547f45f335b5e9e71f61f4ef7359ea Mon Sep 17 00:00:00 2001 From: Yonatan Goldschmidt Date: Tue, 13 Jul 2021 15:51:37 +0300 Subject: [PATCH 8/8] Build async-profiler with devtoolset 7 (for new GCC) Need newer GCC for -static-libstdc++ --- Dockerfile | 1 + pyi.Dockerfile | 2 ++ scripts/async_profiler_build.sh | 3 +++ scripts/async_profiler_env.sh | 15 ++++++++++----- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index f8f64115f..4024885da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,6 +46,7 @@ COPY scripts/phpspy_build.sh . RUN ./phpspy_build.sh # async-profiler +# requires CentOS 6, so the built DSO can be loaded into machines running with old glibc. # centos:6 FROM centos@sha256:dec8f471302de43f4cfcf82f56d99a5227b5ea1aa6d02fa56344986e1f4610e7 AS async-profiler-builder COPY scripts/async_profiler_env.sh . diff --git a/pyi.Dockerfile b/pyi.Dockerfile index 8e630ac04..8abd49dfa 100644 --- a/pyi.Dockerfile +++ b/pyi.Dockerfile @@ -35,6 +35,8 @@ COPY scripts/phpspy_build.sh . RUN ./phpspy_build.sh # async-profiler +# requires CentOS 6, so the built DSO can be loaded into machines running with old glibc. +# centos:6 FROM centos@sha256:dec8f471302de43f4cfcf82f56d99a5227b5ea1aa6d02fa56344986e1f4610e7 AS async-profiler-builder COPY scripts/async_profiler_env.sh . RUN ./async_profiler_env.sh diff --git a/scripts/async_profiler_build.sh b/scripts/async_profiler_build.sh index 8194886cf..a42a0d995 100755 --- a/scripts/async_profiler_build.sh +++ b/scripts/async_profiler_build.sh @@ -10,6 +10,9 @@ GIT_REV=9d29169e34abc004f534a85ba6a4cf8920250381 OUTPUT=async-profiler-2.0-linux-x64.tar.gz git clone --depth 1 -b "$VERSION" https://github.com/Granulate/async-profiler.git && cd async-profiler && git reset --hard "$GIT_REV" +set +eu # this funny script has errors :shrug: +source scl_source enable devtoolset-7 +set -eu make release # add a version file to the build directory diff --git a/scripts/async_profiler_env.sh b/scripts/async_profiler_env.sh index b598caf4a..9c8c9717f 100755 --- a/scripts/async_profiler_env.sh +++ b/scripts/async_profiler_env.sh @@ -5,9 +5,14 @@ # set -euo pipefail -# fix legacy yum repos. slightly adapted from https://stackoverflow.com/a/53848450 -# this basically comments out all mirrorlist URLs, uncomments all baseurls (all seem to be commented) -# and replaces the domain from mirror.centos.org to vault.centos.org. -sed -i -e 's|^mirrorlist|#mirrorlist|' -e 's|^# *baseurl|baseurl|' -e 's|mirror.centos.org|vault.centos.org|' /etc/yum.repos.d/* +function fix_legacy_repos() { + # fix legacy yum repos. slightly adapted from https://stackoverflow.com/a/53848450 + # this basically comments out all mirrorlist URLs, uncomments all baseurls (all seem to be commented) + # and replaces the domain from mirror.centos.org to vault.centos.org. + sed -i -e 's|^mirrorlist|#mirrorlist|' -e 's|^# *baseurl|baseurl|' -e 's|mirror.centos.org|vault.centos.org|' /etc/yum.repos.d/* +} -yum install -y gcc g++ gcc-c++.x86_64 libstdc++-static make java-1.8.0-openjdk-devel glibc-static git +fix_legacy_repos +yum install -y centos-release-scl +fix_legacy_repos # fix again, after adding new scl repos +yum install -y devtoolset-7-toolchain make java-1.8.0-openjdk-devel glibc-static git