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

GH-20272: [C++] Bump version of bundled AWS SDK #33808

Merged
merged 16 commits into from
Feb 9, 2023

Conversation

js8544
Copy link
Collaborator

@js8544 js8544 commented Jan 20, 2023

Rationale for this change

Bump AWS SDK version to 1.10.55.

What changes are included in this PR?

Bump AWS SDK version to 1.10.55.

@github-actions
Copy link

Comment on lines 4730 to 4732
# Workaround for https://github.com/aws/aws-sdk-cpp/issues/1750
set(AWSSDK_PATCH_COMMAND "sed" "-i.bak" "-e" "s/\"-Werror\"//g"
"<SOURCE_DIR>/cmake/compiler_settings.cmake")
"<SOURCE_DIR>/cmake/compiler_settings.cmake" "&&")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this patch?
It seems that 1.10.55 includes the fix for aws/aws-sdk-cpp#1750 .

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

cpp/cmake_modules/ThirdpartyToolchain.cmake Outdated Show resolved Hide resolved
@@ -4643,7 +4644,7 @@ macro(build_awssdk)
set(AWSSDK_CMAKE_ARGS
${AWSSDK_COMMON_CMAKE_ARGS}
-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_HINT}
-DBUILD_DEPS=OFF
-DBUILD_DEPS=ON # We need to build aws-crt-cpp from source
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we build aws-crt-cpp by ourselves instead of using this and prefetch_crt_dependency.sh like other dependencies such as aws-c-common for portability?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I'll try building it manually.

@js8544
Copy link
Collaborator Author

js8544 commented Jan 22, 2023

I've changed to building aws-crt-cpp manually. It now works on my ubuntu and mac machine. Let's see if the CI checks pass.

@js8544 js8544 force-pushed the jinshang/bump_aws branch from ba9dd47 to ff5f19f Compare January 23, 2023 17:25
@@ -4612,6 +4699,7 @@ endif()
macro(build_awssdk)
message(STATUS "Building AWS C++ SDK from source")
set(AWSSDK_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/awssdk_ep-install")
set(AWSSDK_SOURCE "${CMAKE_CURRENT_BINARY_DIR}/awssdk_ep-prefix/src/awssdk_ep")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set(AWSSDK_SOURCE "${CMAKE_CURRENT_BINARY_DIR}/awssdk_ep-prefix/src/awssdk_ep")

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 530 to 535
if(DEFINED ENV{ARROW_S2N_URL})
set(S2N_SOURCE_URL "$ENV{ARROW_S2N_URL}")
else()
set_urls(S2N_SOURCE_URL
"https://github.com/awslabs/s2n/archive/${ARROW_S2N_BUILD_VERSION}.tar.gz")
endif()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awslabs -> aws: https://github.com/aws/s2n-tls/archive/v1.3.27.tar.gz

Could you use S2N_TLS instead of S2N like ARROW_S2N_TLS_URL for all s2n-tls related variables?

BTW, the latest release is 1.3.35: https://github.com/aws/s2n-tls/releases
Can we use the latest version?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@js854 Could you also confirm the above comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kou Oh sorry I missed it. I am looking at it now.

Copy link
Collaborator Author

@js8544 js8544 Feb 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kou Changed in abfa9774c

Comment on lines 4774 to 4775
crypto
ssl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are they artifacts by s2n-tls?
Then we should not create AWS::crypto and AWS::ssl. We should create AWS::s2n-tls and associate libcrypto.a and libssl.a with AWS::s2n-tls.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out they are not needed. I've removed these two.

BUILD_BYPRODUCTS ${AWS_CPP_SDK_COGNITO_IDENTITY_STATIC_LIBRARY}
${AWS_CPP_SDK_CORE_STATIC_LIBRARY}
${AWS_CPP_SDK_IDENTITY_MANAGEMENT_STATIC_LIBRARY}
${AWS_CPP_SDK_S3_STATIC_LIBRARY}
${AWS_CPP_SDK_STS_STATIC_LIBRARY}
DEPENDS aws_c_event_stream_ep)
DEPENDS aws_c_event_stream_ep aws_crt_cpp_ep)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove aws_c_event_stream_ep here because aws_crt_cpp_ep depends on aws_c_event_stream_ep?

Suggested change
DEPENDS aws_c_event_stream_ep aws_crt_cpp_ep)
DEPENDS aws_crt_cpp_ep)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

"ARROW_AWS_C_S3_URL aws-c-s3-${ARROW_AWS_C_S3_BUILD_VERSION}.tar.gz https://github.com/awslabs/aws-c-s3/archive/${ARROW_AWS_C_S3_BUILD_VERSION}.tar.gz"
"ARROW_AWS_C_SDKUTILS_URL aws-c-sdkutils-${ARROW_AWS_C_SDKUTILS_BUILD_VERSION}.tar.gz https://github.com/awslabs/aws-c-sdkutils/archive/${ARROW_AWS_C_SDKUTILS_BUILD_VERSION}.tar.gz"
"ARROW_AWS_LC_URL aws-lc-${ARROW_AWS_LC_BUILD_VERSION}.tar.gz https://github.com/awslabs/aws-lc/archive/${ARROW_AWS_LC_BUILD_VERSION}.tar.gz"
"ARROW_S2N_URL s2n-${ARROW_S2N_BUILD_VERSION}.tar.gz https://github.com/awslabs/s2n/archive/${ARROW_S2N_BUILD_VERSION}.tar.gz"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you keep alphabetical order?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@js8544
Copy link
Collaborator Author

js8544 commented Jan 30, 2023

I am stuck on this problem for some time. Due to this, we need to initialize AWS SDK twice in arrow-s3fs-test because AWS SDK is statically linked. With the new 1.10 version, its initialization involves adding an OpenSSL engine here. The problem is, OpenSSL is dynamically linked, so the second initialization will fail due to a name conflict. The problem is the same as this issue.

In short, AWS SDK is statically linked but OpenSSL is dynamically linked, so we can't init AWS twice as we have been done in arrow-s3fs-test.

What is the best way to resolve this? Any help is appreciated. cc @kou @pitrou

@pitrou
Copy link
Member

pitrou commented Jan 30, 2023

I think we should simply switch to dynamic linking for the AWS SDK. Static linking is fine for leaf dependencies (such as lz4), but it should be unsupported for complex dependencies such as AWS, gRPC, etc.

@kou
Copy link
Member

kou commented Jan 31, 2023

I'll take a look at this in this week.

In general, we need additional work to use dynamic linking for bundled libraries. If we use dynamic linking for bundled libraries, we need to install them but it may overwrite existing libraries. So we need to install them to not $PREFIX/lib/ like $PREFIX/lib/arrow/. We may need to use rpath or something to load them installed in $PREFIX/lib/arrow/ at runtime.

@pitrou
Copy link
Member

pitrou commented Jan 31, 2023

If we use dynamic linking for bundled libraries, we need to install them but it may overwrite existing libraries.

Well, yes, but so what? People who are concerned about that should use their distribution's packages.

@js8544
Copy link
Collaborator Author

js8544 commented Jan 31, 2023

I found out that S2N provides an option S2N_INTERN_LIBCRYPTO to statically link against and "internalize" libcrypto. With this option on all tests are passing. We can stay with static linkage for now :). cc @kou @pitrou

@kou
Copy link
Member

kou commented Feb 1, 2023

If we use dynamic linking for bundled libraries, we need to install them but it may overwrite existing libraries.

Well, yes, but so what? People who are concerned about that should use their distribution's packages.

I think that this is a bad manner. But I just realized that I have never discussed this before. My concern may be overthinking.

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
I think that we can merge this only with some more small cleanups.

cpp/cmake_modules/ThirdpartyToolchain.cmake Outdated Show resolved Hide resolved
cpp/cmake_modules/ThirdpartyToolchain.cmake Outdated Show resolved Hide resolved
@js8544 js8544 requested a review from kou February 1, 2023 09:34
@js8544 js8544 force-pushed the jinshang/bump_aws branch from c554f03 to 27650c3 Compare February 3, 2023 06:35
@kou
Copy link
Member

kou commented Feb 3, 2023

@github-actions crossbow submit -g cpp -g r

@github-actions

This comment was marked as outdated.

@kou
Copy link
Member

kou commented Feb 8, 2023

@github-actions crossbow submit -g cpp -g r

@github-actions

This comment was marked as outdated.

@kou
Copy link
Member

kou commented Feb 8, 2023

@github-actions crossbow submit -g cpp -g r

@github-actions

This comment was marked as outdated.

@kou
Copy link
Member

kou commented Feb 8, 2023

@github-actions crossbow submit -g cpp -g r

@github-actions
Copy link

github-actions bot commented Feb 8, 2023

Revision: a9b2c3d

Submitted crossbow builds: ursacomputing/crossbow @ actions-31adcf1058

Task Status
conda-linux-aarch64-cpu-r41 Azure
conda-linux-aarch64-cpu-r42 Azure
conda-linux-x64-cpu-r41 Azure
conda-linux-x64-cpu-r42 Azure
conda-osx-arm64-cpu-r41 Azure
conda-osx-arm64-cpu-r42 Azure
conda-osx-x64-cpu-r41 Azure
conda-osx-x64-cpu-r42 Azure
conda-win-x64-cpu-r41 Azure
homebrew-r-autobrew Github Actions
homebrew-r-brew Github Actions
r-binary-packages Github Actions
test-alpine-linux-cpp Github Actions
test-build-cpp-fuzz Github Actions
test-conda-cpp Github Actions
test-conda-cpp-valgrind Azure
test-cuda-cpp Github Actions
test-debian-10-cpp-amd64 Github Actions
test-debian-10-cpp-i386 Github Actions
test-debian-11-cpp-amd64 Github Actions
test-debian-11-cpp-i386 Github Actions
test-fedora-35-cpp Github Actions
test-fedora-r-clang-sanitizer Azure
test-r-arrow-backwards-compatibility Github Actions
test-r-depsource-bundled Azure
test-r-depsource-system Github Actions
test-r-dev-duckdb Github Actions
test-r-devdocs Github Actions
test-r-gcc-11 Github Actions
test-r-gcc-12 Github Actions
test-r-install-local Github Actions
test-r-install-local-minsizerel Github Actions
test-r-library-r-base-latest Azure
test-r-linux-as-cran Github Actions
test-r-linux-rchk Github Actions
test-r-linux-valgrind Azure
test-r-minimal-build Azure
test-r-offline-maximal Github Actions
test-r-offline-minimal Azure
test-r-rhub-debian-gcc-devel-lto-latest Azure
test-r-rhub-debian-gcc-release-custom-ccache Azure
test-r-rhub-ubuntu-gcc-release-latest Azure
test-r-rstudio-r-base-4.1-opensuse153 Azure
test-r-rstudio-r-base-4.2-centos7-devtoolset-8 Azure
test-r-rstudio-r-base-4.2-focal Azure
test-r-ubuntu-22.04 Github Actions
test-r-versions Github Actions
test-ubuntu-18.04-cpp Github Actions
test-ubuntu-18.04-cpp-release Github Actions
test-ubuntu-18.04-cpp-static Github Actions
test-ubuntu-18.04-r-sanitizer Azure
test-ubuntu-20.04-cpp Github Actions
test-ubuntu-20.04-cpp-20 Github Actions
test-ubuntu-20.04-cpp-bundled Github Actions
test-ubuntu-20.04-cpp-thread-sanitizer Github Actions
test-ubuntu-22.04-cpp Github Actions

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

I've disabled arrow-s3fs-test with bundled aws-sdk-cpp.

@kou kou merged commit e11ee40 into apache:master Feb 9, 2023
@ursabot
Copy link

ursabot commented Feb 9, 2023

Benchmark runs are scheduled for baseline = 6b65c84 and contender = e11ee40. e11ee40 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Failed ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed ⬇️0.37% ⬆️0.0%] test-mac-arm
[Failed ⬇️0.26% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.38% ⬆️0.06%] ursa-thinkcentre-m75q
Buildkite builds:
[Failed] e11ee40e ec2-t3-xlarge-us-east-2
[Failed] e11ee40e test-mac-arm
[Failed] e11ee40e ursa-i9-9960x
[Finished] e11ee40e ursa-thinkcentre-m75q
[Failed] 6b65c84a ec2-t3-xlarge-us-east-2
[Failed] 6b65c84a test-mac-arm
[Failed] 6b65c84a ursa-i9-9960x
[Finished] 6b65c84a ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@kou
Copy link
Member

kou commented Feb 9, 2023

@github-actions crossbow submit java-jars

@github-actions
Copy link

github-actions bot commented Feb 9, 2023

Revision: a9b2c3d

Submitted crossbow builds: ursacomputing/crossbow @ actions-d606dbb699

Task Status
java-jars Github Actions

sjperkins pushed a commit to sjperkins/arrow that referenced this pull request Feb 10, 2023
### Rationale for this change

Bump AWS SDK version to 1.10.55.

### What changes are included in this PR?

Bump AWS SDK version to 1.10.55.

* Closes: apache#20272

Lead-authored-by: Jin Shang <shangjin1997@gmail.com>
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
@assignUser
Copy link
Member

@pitrou @kou When updating bundled dependencies please make sure to also update our fallback version in the artifactory to avoid something like #34120 (comment) this was missed in the recent round of version bumps (e.g. #13294).

@kou
Copy link
Member

kou commented Feb 10, 2023

Oh, sorry.
We need a CI job for fallback cases. We can add an environment variable or a CMake variable to force using fallback cases for the job. Could you open an issue for this?

And we should have a script to mirror upstream archives to Artifactory. Could you open an issue for this too?

@assignUser
Copy link
Member

I have updated the missing files for now and opened a few issues: #34131 #34132 #34129

kou added a commit that referenced this pull request Feb 15, 2023
…enSSL (#34159)

Using OpenSSL causes various issues like #33808 (comment) and #34111. We should try to use aws-lc for libcrypto and libssl. We need to hide them inside s2n-tls to avoid name conflicts with OpenSSL used by other libraries.

Some notes:
1. Only linux needs s2n-tls and aws-lc.
2. Because aws-c-http requires curl which requires libcrypto from OpenSSL, we need to hide Aws::libcrypto by S2N_INTERN_LIBCRYPTO=ON. 
3. aws-c-cal also uses libcrypto, but it can't hide it. So we need to use OpenSSL instead of aws-lc for it.
4. Mac and windows don't need s2n-tls, but do need some security libs from system, like `-framework Security` and `ncrypt.lib`. 
5. arrow-s3fs-test is re-enabled.
6. Force Java Gandiva to use static protobuf lib.

* Closes: #34157

Lead-authored-by: Jin Shang <shangjin1997@gmail.com>
Co-authored-by: jinshang <jinshang@tencent.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
gringasalpastor pushed a commit to gringasalpastor/arrow that referenced this pull request Feb 17, 2023
### Rationale for this change

Bump AWS SDK version to 1.10.55.

### What changes are included in this PR?

Bump AWS SDK version to 1.10.55.

* Closes: apache#20272

Lead-authored-by: Jin Shang <shangjin1997@gmail.com>
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
gringasalpastor pushed a commit to gringasalpastor/arrow that referenced this pull request Feb 17, 2023
… of OpenSSL (apache#34159)

Using OpenSSL causes various issues like apache#33808 (comment) and apache#34111. We should try to use aws-lc for libcrypto and libssl. We need to hide them inside s2n-tls to avoid name conflicts with OpenSSL used by other libraries.

Some notes:
1. Only linux needs s2n-tls and aws-lc.
2. Because aws-c-http requires curl which requires libcrypto from OpenSSL, we need to hide Aws::libcrypto by S2N_INTERN_LIBCRYPTO=ON. 
3. aws-c-cal also uses libcrypto, but it can't hide it. So we need to use OpenSSL instead of aws-lc for it.
4. Mac and windows don't need s2n-tls, but do need some security libs from system, like `-framework Security` and `ncrypt.lib`. 
5. arrow-s3fs-test is re-enabled.
6. Force Java Gandiva to use static protobuf lib.

* Closes: apache#34157

Lead-authored-by: Jin Shang <shangjin1997@gmail.com>
Co-authored-by: jinshang <jinshang@tencent.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
fatemehp pushed a commit to fatemehp/arrow that referenced this pull request Feb 24, 2023
### Rationale for this change

Bump AWS SDK version to 1.10.55.

### What changes are included in this PR?

Bump AWS SDK version to 1.10.55.

* Closes: apache#20272

Lead-authored-by: Jin Shang <shangjin1997@gmail.com>
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
fatemehp pushed a commit to fatemehp/arrow that referenced this pull request Feb 24, 2023
… of OpenSSL (apache#34159)

Using OpenSSL causes various issues like apache#33808 (comment) and apache#34111. We should try to use aws-lc for libcrypto and libssl. We need to hide them inside s2n-tls to avoid name conflicts with OpenSSL used by other libraries.

Some notes:
1. Only linux needs s2n-tls and aws-lc.
2. Because aws-c-http requires curl which requires libcrypto from OpenSSL, we need to hide Aws::libcrypto by S2N_INTERN_LIBCRYPTO=ON. 
3. aws-c-cal also uses libcrypto, but it can't hide it. So we need to use OpenSSL instead of aws-lc for it.
4. Mac and windows don't need s2n-tls, but do need some security libs from system, like `-framework Security` and `ncrypt.lib`. 
5. arrow-s3fs-test is re-enabled.
6. Force Java Gandiva to use static protobuf lib.

* Closes: apache#34157

Lead-authored-by: Jin Shang <shangjin1997@gmail.com>
Co-authored-by: jinshang <jinshang@tencent.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
kou added a commit to apache/arrow-java that referenced this pull request Nov 25, 2024
…enSSL (#34159)

Using OpenSSL causes various issues like apache/arrow#33808 (comment) and apache/arrow#34111. We should try to use aws-lc for libcrypto and libssl. We need to hide them inside s2n-tls to avoid name conflicts with OpenSSL used by other libraries.

Some notes:
1. Only linux needs s2n-tls and aws-lc.
2. Because aws-c-http requires curl which requires libcrypto from OpenSSL, we need to hide Aws::libcrypto by S2N_INTERN_LIBCRYPTO=ON. 
3. aws-c-cal also uses libcrypto, but it can't hide it. So we need to use OpenSSL instead of aws-lc for it.
4. Mac and windows don't need s2n-tls, but do need some security libs from system, like `-framework Security` and `ncrypt.lib`. 
5. arrow-s3fs-test is re-enabled.
6. Force Java Gandiva to use static protobuf lib.

* Closes: #34157

Lead-authored-by: Jin Shang <shangjin1997@gmail.com>
Co-authored-by: jinshang <jinshang@tencent.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[C++] Bump version of bundled AWS SDK
5 participants