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

Use AWS C++ SDK for communicating with S3 #149

Draft
wants to merge 69 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
f03e2ff
Include the aws-cpp-sdk in the build
sjperkins Apr 2, 2024
a003a76
Remove unnecessarily introduced os-specific includes in aws-c-event-s…
sjperkins Apr 2, 2024
c0efd6e
@platforms//os:windows
sjperkins Apr 3, 2024
da85486
Remove system.BUILD.bazel
sjperkins Apr 3, 2024
98550fc
build_file formatting
sjperkins Apr 3, 2024
71fd676
Change - to _ in cc_library name field
sjperkins Apr 3, 2024
9672159
#define WIN32_LEAN_AND_MEAN in aws/core/SDKConfig.h
sjperkins Apr 3, 2024
6ffb5c9
Change - to _ in referenced locations
sjperkins Apr 3, 2024
de6b273
More @platforms//os:windows
sjperkins Apr 13, 2024
4c1fcfc
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins Apr 22, 2024
b80b85d
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins Apr 25, 2024
cfcf0d2
Convert patch_cmds to patch file in @com_github_aws_cpp_sdk
sjperkins Apr 26, 2024
5c877d9
Use write_file in com_github_aws_checksums
sjperkins Apr 26, 2024
84cda4a
Generate SDKConfig.h with a write_file
sjperkins Apr 26, 2024
a03e45e
Add s3_encryption
sjperkins Apr 26, 2024
278cb8f
Add s3 context
sjperkins Apr 26, 2024
354f700
header cleanup
sjperkins Apr 26, 2024
e2eac84
sanity check basic credential retrieval
sjperkins Apr 26, 2024
1e1bd30
Remove AuthSigner cruft from s3_context_test.cc
sjperkins Apr 26, 2024
2a08922
Add NewS3RequestBuilder
sjperkins Apr 26, 2024
0c00783
Update BUILD
sjperkins Apr 26, 2024
aac65f2
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins May 3, 2024
25a7209
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins May 3, 2024
33a995d
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins May 8, 2024
2908289
Adapt more AWS classes, improve SDK setup
sjperkins May 8, 2024
6d2a933
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins May 9, 2024
9d9ea8a
Move S3Client code in a separate kvstore/s3_sdk directory
sjperkins May 9, 2024
0e3a781
Move AWS SDK Adapter code into anonymous namespace
sjperkins May 9, 2024
fbcb788
fixups
sjperkins May 9, 2024
484d6b0
Add localstack test
sjperkins May 9, 2024
b843af4
Updates
sjperkins May 9, 2024
1408ed7
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins May 9, 2024
65644fe
Simplify
sjperkins May 10, 2024
83893e9
Add Async S3Client test cases
sjperkins May 10, 2024
edfb694
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins May 24, 2024
f94f55d
Reomve unnecessary Cord construction
sjperkins May 27, 2024
c122d4a
Fix closing namespace typo
sjperkins May 27, 2024
5106902
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins May 28, 2024
47def67
Initial CordStreamBuf implementation
sjperkins May 30, 2024
ce7bdf9
Fix indenting
sjperkins May 30, 2024
6eb3c89
comment
sjperkins May 30, 2024
f885bcc
Header hygiene
sjperkins May 31, 2024
9edf7d7
Remove commented out test case
sjperkins May 31, 2024
d2d7f87
Improve seek from current position case
sjperkins May 31, 2024
171393c
Sharpen test cases
sjperkins May 31, 2024
259792d
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins May 31, 2024
430f947
seekoff improvements
sjperkins Jun 2, 2024
f849e35
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins Jun 6, 2024
24144d3
Prefer defining the CordStreamBuf get area in terms of a Cord chunk
sjperkins Jun 10, 2024
b47fe87
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins Jun 10, 2024
cafd5fa
typo
sjperkins Jun 10, 2024
f8ba211
Fix test cases
sjperkins Jun 10, 2024
4ac69a0
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins Jun 11, 2024
16321f4
Touch up CordStreamBuf and integrate into HttpRequest/Response workflow
sjperkins Jun 14, 2024
d728a79
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins Jun 14, 2024
f156b4d
xsgetn fixes
sjperkins Jun 19, 2024
bb2c423
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins Jun 19, 2024
85b44d9
MoveCord -> DetachCord, TakeCord -> AssignCord
sjperkins Jun 20, 2024
62397fe
Warn on copies of large Http Request/Response bodies
sjperkins Jun 20, 2024
381a62c
Comment grammar
sjperkins Jun 20, 2024
ad453e5
Update logging statements
sjperkins Jun 20, 2024
d851a89
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins Jun 21, 2024
fe5dd54
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins Jun 24, 2024
da0b1b6
workspace whitespace
sjperkins Jun 25, 2024
aee0ce7
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins Jun 25, 2024
1216c4a
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins Jun 26, 2024
16c76c4
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins Jun 28, 2024
6b69c72
Merge branch 'master' into depend-on-aws-cpp-sdk-for-auth
sjperkins Jul 2, 2024
3883f04
Update to more recent version of the AWS C, CRT and C++ SDK's
sjperkins Jul 3, 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
2 changes: 2 additions & 0 deletions tensorstore/kvstore/s3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ tensorstore_cc_library(
"//tensorstore/internal/log:verbose_flag",
"//tensorstore/kvstore:byte_range",
"//tensorstore/kvstore/s3/credentials:aws_credentials",
# TODO: substitute this with just the auth components of the aws sdk
"@com_github_aws_cpp_sdk//:s3",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/log:absl_log",
Expand Down
46 changes: 46 additions & 0 deletions third_party/com_github_aws_c_common/aws_c_common.BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Description:
# AWS C Common

package(default_visibility = ["//visibility:public"])

licenses(["notice"]) # Apache 2.0

exports_files(["LICENSE"])

cc_library(
name = "aws-c-common",
srcs = glob([
"include/aws/common/*.h",
"include/aws/common/private/*.h",
"source/*.c",
]) + select({
"@bazel_tools//src/conditions:windows": glob([
sjperkins marked this conversation as resolved.
Show resolved Hide resolved
"source/windows/*.c",
]),
"//conditions:default": glob([
"source/posix/*.c",
]),
}),
hdrs = [
"include/aws/common/config.h",
],
defines = [],
includes = [
"include",
],
textual_hdrs = glob([
"include/**/*.inl",
]),
deps = [],
)

genrule(
name = "config_h",
srcs = [
"include/aws/common/config.h.in",
],
outs = [
"include/aws/common/config.h",
],
cmd = "sed 's/cmakedefine/undef/g' $< > $@",
)
4 changes: 4 additions & 0 deletions third_party/com_github_aws_c_common/system.BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cc_library(
sjperkins marked this conversation as resolved.
Show resolved Hide resolved
name = "aws_c_common",
visibility = ["//visibility:public"],
)
34 changes: 34 additions & 0 deletions third_party/com_github_aws_c_common/workspace.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2024 The TensorStore Authors
#
# 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.

load("//third_party:repo.bzl", "third_party_http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

def repo():
maybe(
third_party_http_archive,
name = "com_github_aws_c_common",
sha256 = "01c2a58553a37b3aa5914d9e0bf7bf14507ff4937bc5872a678892ca20fcae1f",
strip_prefix = "aws-c-common-0.4.29",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/awslabs/aws-c-common/archive/v0.4.29.tar.gz",
"https://github.com/awslabs/aws-c-common/archive/v0.4.29.tar.gz",
], build_file = Label("//third_party:com_github_aws_c_common/aws_c_common.BUILD.bazel"),
sjperkins marked this conversation as resolved.
Show resolved Hide resolved
system_build_file = Label("//third_party:com_github_aws_c_common/system.BUILD.bazel"),
cmake_name = "aws_c_common",
cmake_target_mapping = {
"@com_github_aws_c_common//:aws_c_common": "aws_c_common::aws_c_common",
},
bazel_to_cmake = {},
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Description:
# AWS C Event Stream

package(default_visibility = ["//visibility:public"])

licenses(["notice"]) # Apache 2.0

exports_files(["LICENSE"])

cc_library(
name = "aws-c-event-stream",
srcs = glob([
"include/**/*.h",
"source/**/*.c",
]),
hdrs = [],
defines = [],
includes = [
"include",
],
deps = [
"@com_github_aws_c_common//:aws-c-common",
"@com_github_aws_checksums//:aws-checksums",
],
)
4 changes: 4 additions & 0 deletions third_party/com_github_aws_c_event_stream/system.BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cc_library(
name = "aws_c_event_stream",
visibility = ["//visibility:public"],
)
34 changes: 34 additions & 0 deletions third_party/com_github_aws_c_event_stream/workspace.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2024 The TensorStore Authors
#
# 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.

load("//third_party:repo.bzl", "third_party_http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

def repo():
maybe(
third_party_http_archive,
name = "com_github_aws_c_event_stream",
sha256 = "31d880d1c868d3f3df1e1f4b45e56ac73724a4dc3449d04d47fc0746f6f077b6",
strip_prefix = "aws-c-event-stream-0.1.4",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/awslabs/aws-c-event-stream/archive/v0.1.4.tar.gz",
"https://github.com/awslabs/aws-c-event-stream/archive/v0.1.4.tar.gz",
], build_file = Label("//third_party:com_github_aws_c_event_stream/aws_c_event_stream.BUILD.bazel"),
system_build_file = Label("//third_party:com_github_aws_c_event_stream/system.BUILD.bazel"),
cmake_name = "aws_c_event_stream",
cmake_target_mapping = {
"@com_github_aws_c_event_stream//:aws_c_event_stream": "aws_c_event_stream::aws_c_event_stream",
},
bazel_to_cmake = {},
)
42 changes: 42 additions & 0 deletions third_party/com_github_aws_checksums/aws_checksums.BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Description:
# AWS CheckSums

package(default_visibility = ["//visibility:public"])

licenses(["notice"]) # Apache 2.0

exports_files(["LICENSE"])

cc_library(
name = "aws-checksums",
sjperkins marked this conversation as resolved.
Show resolved Hide resolved
srcs = glob([
"include/aws/checksums/*.h",
"include/aws/checksums/private/*.h",
"source/*.c",
]) + [
"crc_hw.c",
],
hdrs = [],
sjperkins marked this conversation as resolved.
Show resolved Hide resolved
defines = [],
includes = [
"include",
],
deps = [],
)

genrule(
name = "crc_hw_c",
outs = ["crc_hw.c"],
cmd = "\n".join([
"cat <<'EOF' >$@",
"#include <aws/checksums/private/cpuid.h>",
"#include <aws/checksums/private/crc_priv.h>",
"int aws_checksums_do_cpu_id(int32_t *cpuid) {",
" return 0;",
"}",
"uint32_t aws_checksums_crc32c_hw(const uint8_t *input, int length, uint32_t previousCrc32) {",
" return aws_checksums_crc32c_sw(input, length, previousCrc32);",
"}",
"EOF",
]),
)
4 changes: 4 additions & 0 deletions third_party/com_github_aws_checksums/system.BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cc_library(
name = "aws_checksums",
visibility = ["//visibility:public"],
)
35 changes: 35 additions & 0 deletions third_party/com_github_aws_checksums/workspace.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2024 The TensorStore Authors
#
# 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.

load("//third_party:repo.bzl", "third_party_http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

def repo():
maybe(
third_party_http_archive,
name = "com_github_aws_checksums",
sha256 = "6e6bed6f75cf54006b6bafb01b3b96df19605572131a2260fddaf0e87949ced0",
strip_prefix = "aws-checksums-0.1.5",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/awslabs/aws-checksums/archive/v0.1.5.tar.gz",
"https://github.com/awslabs/aws-checksums/archive/v0.1.5.tar.gz",
],
build_file = Label("//third_party:com_github_aws_checksums/aws_checksums.BUILD.bazel"),
system_build_file = Label("//third_party:com_github_aws_checksums/system.BUILD.bazel"),
cmake_name = "aws_checksums",
cmake_target_mapping = {
"@com_github_aws_checksums//:aws_checksums": "aws_checksums::aws_checksums",
},
bazel_to_cmake = {},
)
Loading
Loading