Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2b8f937
ruby spec updates
seebees Nov 14, 2025
d0f16e0
Start on instruction failures
seebees Nov 15, 2025
496a8db
Instruction files that pass and fail
seebees Nov 17, 2025
54853fa
starting to add raw
seebees Nov 17, 2025
f0aa6f7
adding ruby to raw support
seebees Nov 17, 2025
7c4ddb8
update names
seebees Nov 17, 2025
39c7799
Merge branch 'fireegg-test-servers' into seebees/instruction-files
seebees Nov 17, 2025
7c0ef74
Merge branch 'fireegg-test-servers' into seebees/instruction-files
seebees Nov 17, 2025
aeb359c
speed up the build
seebees Nov 17, 2025
270f2d5
speed up wait
seebees Nov 17, 2025
271fcba
update client building
seebees Nov 17, 2025
1d87600
faster parallel tests
seebees Nov 17, 2025
e68f788
Updates to gradle and maybe git
seebees Nov 17, 2025
0c5f087
run it this way
seebees Nov 17, 2025
567c145
try and do better parallel
seebees Nov 18, 2025
2552699
maybe simpler
seebees Nov 18, 2025
d99055c
Yet better names
seebees Nov 18, 2025
886b722
actional error messages
seebees Nov 18, 2025
4bbc4b8
logging who is building slow?
seebees Nov 18, 2025
d2c4102
do it right!
seebees Nov 18, 2025
58fbea0
better faster builds! I hope so!
seebees Nov 18, 2025
666f9db
Where is the build slow?
seebees Nov 18, 2025
3e5b5ba
Net supports AES
seebees Nov 18, 2025
24aa158
log the last second
seebees Nov 18, 2025
7819aaf
thread safe cpp clients
ajewellamz Nov 18, 2025
40333f1
what is going on?
seebees Nov 18, 2025
81ea595
m
ajewellamz Nov 18, 2025
d77506b
Merge branch 'seebees/instrcution-files-parallel' of github.com:aws/a…
ajewellamz Nov 18, 2025
25ccb41
run in the right place
seebees Nov 18, 2025
eb89d5e
its dotnet
seebees Nov 18, 2025
4b50ced
faster c?
seebees Nov 18, 2025
23f3f16
m
ajewellamz Nov 18, 2025
47fa469
Merge branch 'seebees/instrcution-files-parallel' of github.com:aws/a…
ajewellamz Nov 18, 2025
3936089
disable cpp for a sec
seebees Nov 18, 2025
ab14133
fix for Java?
seebees Nov 18, 2025
d5d8b6a
java transition
seebees Nov 18, 2025
e9ea9f5
chore: bump s3ec net to get the fix for raw wrapping key cek alg (#108)
rishav-karanjit Nov 19, 2025
9b5fc73
better error and better Java
seebees Nov 19, 2025
8fbcf0c
another test
seebees Nov 19, 2025
d53f0c6
bump java commit
imabhichow Nov 19, 2025
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
35 changes: 16 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ jobs:
git config --global credential.helper store
echo "https://x-token-auth:${{ secrets.PAT_FOR_PRIVATE_RUBY }}@github.com" > ~/.git-credentials

- name: Cache git submodules
uses: actions/cache@v4
with:
path: |
.git/modules
test-server/*/.git
key: ${{ runner.os }}-submodules-${{ hashFiles('.gitmodules') }}
restore-keys: |
${{ runner.os }}-submodules-
# - name: Cache git submodules
# uses: actions/cache@v4
# with:
# path: |
# .git/modules
# test-server/*/.git
# key: ${{ runner.os }}-submodules-${{ hashFiles('.gitmodules') }}
# restore-keys: |
# ${{ runner.os }}-submodules-

- name: Optimize git for performance
run: |
Expand All @@ -59,13 +59,12 @@ jobs:

- name: Checkout submodules with --jobs
run: |
git submodule update --init --depth 1 --jobs ${{ steps.cpu-count.outputs.count }}
git submodule update --init --depth 1 --single-branch --jobs ${{ steps.cpu-count.outputs.count }}

- name: Update cpp submodules recursively with --jobs
run: |
git submodule update --init --recursive \
--depth 1 \
--filter=blob:none \
--depth 1 --single-branch \
--jobs ${{ steps.cpu-count.outputs.count }} \
--force \
test-server/cpp-v2-transition-server/aws-sdk-cpp \
Expand Down Expand Up @@ -156,27 +155,25 @@ jobs:
aws-region: us-west-2

- name: Build the servers
run: cd test-server && make build-all-servers
run: cd test-server && make build-all-servers FILTER=ruby,java,php,net,go
env:
MAKEFLAGS: -j${{ steps.cpu-count.outputs.count }}
AWS_REGION: us-west-2

- name: Start the servers
run: cd test-server && make start-all-servers
run: cd test-server && make start-all-servers FILTER=ruby,java,php,net,go
env:
AWS_REGION: us-west-2
TEST_SERVER_S3_BUCKET: ${{ vars.TEST_SERVER_S3_BUCKET }}
TEST_SERVER_KMS_KEY_ARN: ${{ vars.TEST_SERVER_KMS_KEY_ARN }}

- name: Wait for servers to start
run: cd test-server && make wait-all-servers
run: cd test-server && make wait-all-servers FILTER=ruby,java,php,net,go
env:
AWS_REGION: us-west-2
TEST_SERVER_S3_BUCKET: ${{ vars.TEST_SERVER_S3_BUCKET }}
TEST_SERVER_KMS_KEY_ARN: ${{ vars.TEST_SERVER_KMS_KEY_ARN }}
MAKEFLAGS: -j${{ steps.cpu-count.outputs.count }}

- name: Run run-tests
run: cd test-server && make run-tests
run: cd test-server && make run-tests FILTER=ruby,java,php,net,go
env:
AWS_REGION: us-west-2
TEST_SERVER_S3_BUCKET: ${{ vars.TEST_SERVER_S3_BUCKET }}
Expand Down
20 changes: 11 additions & 9 deletions test-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

.PHONY: all start-servers run-tests stop-servers clean ci check-env help

# Default target
all: start-all-servers wait-all-servers run-tests

# CI target for GitHub Actions
ci:
$(MAKE) build-all-servers
Expand All @@ -20,13 +17,19 @@ START_SERVER_TARGETS := $(addprefix start-, $(SERVER_DIRS))
WAIT_SERVER_TARGETS := $(addprefix wait-, $(SERVER_DIRS))

# Build all servers in parallel
build-all-servers: export MAKEFLAGS=-j$(shell sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo 1)
build-all-servers: $(BUILD_SERVER_TARGETS)
build-all-servers:
@echo "[`date +%H:%M:%S`] Building all servers..."
@$(MAKE) $(BUILD_SERVER_TARGETS)
@echo "[`date +%H:%M:%S`] All servers built."
@echo "Stopping dotnet servers... this is here to speed up CI because if this target is run with -j it will stay open until it shutdown."
@dotnet build-server shutdown
@echo "[`date +%H:%M:%S`] Dotnet build servers stopped"

$(BUILD_SERVER_TARGETS): build-%:
@if [ -f $*/Makefile ]; then \
echo "Building server in $*..."; \
echo "[`date +%H:%M:%S`] Building server in $*..."; \
$(MAKE) -C $* build-server; \
echo "[`date +%H:%M:%S`] Server $* built successfully"; \
else \
echo "❌ Error: no Makefile found in $*"; \
exit 1; \
Expand All @@ -44,9 +47,8 @@ start-servers:
$(MAKE) -C $$dir wait-for-server; \
done

# Start servers sequentially (no parallel execution)
start-all-servers:
@$(MAKE) MAKEFLAGS= $(START_SERVER_TARGETS)
@$(MAKE) $(START_SERVER_TARGETS)

$(START_SERVER_TARGETS): start-%:
@if [ -f $*/Makefile ]; then \
Expand Down Expand Up @@ -82,7 +84,7 @@ run-tests:
AWS_SECRET_ACCESS_KEY="$$AWS_SECRET_ACCESS_KEY" \
AWS_SESSION_TOKEN="$$AWS_SESSION_TOKEN" \
AWS_REGION="us-west-2" \
./gradlew --build-cache --info --parallel integ -Dtest.filter.servers="$(FILTER)"
./gradlew --build-cache --info --parallel --no-daemon integ -Dtest.filter.servers="$(FILTER)"
@echo "Tests completed successfully"

# Stop the servers
Expand Down
2 changes: 1 addition & 1 deletion test-server/cpp-v2-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build/s3ec-server:

build-server: | build/s3ec-server
@echo "Building Cpp V2 server..."
cd build && make
cd build && $(MAKE)

start-server:
@echo "Starting Cpp V2 server..."
Expand Down
44 changes: 26 additions & 18 deletions test-server/cpp-v2-server/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
using json = nlohmann::json;
using namespace Aws::S3Encryption;
using Aws::S3Encryption::Materials::KMSWithContextEncryptionMaterials;
std::unordered_map<std::string, std::shared_ptr<S3EncryptionClientV2>>
client_cache;
std::unordered_map<std::string, std::shared_ptr<S3EncryptionClientV2>> client_cache_secret;
std::mutex client_mutex;

std::string generate_uuid() {
uuid_t uuid;
Expand All @@ -27,6 +27,23 @@ std::string generate_uuid() {
return std::string(uuid_str);
}

std::shared_ptr<S3EncryptionClientV2> get_client(const std::string &client_id)
{
std::lock_guard<std::mutex> lock(client_mutex);
auto it = client_cache_secret.find(client_id);
if (it == client_cache_secret.end()) {
return std::shared_ptr<S3EncryptionClientV2>();
} else {
return it->second;
}
}

void set_client(const std::string &client_id, std::shared_ptr<S3EncryptionClientV2> client)
{
std::lock_guard<std::mutex> lock(client_mutex);
client_cache_secret[client_id] = client;
}

std::string get_header_value(struct MHD_Connection *connection,
const char *key) {
const char *value =
Expand Down Expand Up @@ -74,7 +91,7 @@ MHD_Result handle_create_client(struct MHD_Connection *connection,
auto encryption_client = std::make_shared<S3EncryptionClientV2>(config);

std::string client_id = generate_uuid();
client_cache[client_id] = encryption_client;
set_client(client_id, encryption_client);

json response = {{"clientId", client_id}};
return send_response(connection, 200, response.dump());
Expand Down Expand Up @@ -144,8 +161,8 @@ MHD_Result handle_get_object(struct MHD_Connection *connection,
const std::string &bucket, const std::string &key,
const std::string &client_id,
const std::string &metadata) {
auto it = client_cache.find(client_id);
if (it == client_cache.end()) {
auto client = get_client(client_id);
if (!client) {
return send_response(connection, 404, "{\"error\":\"Client not found\"}");
}

Expand All @@ -154,18 +171,9 @@ MHD_Result handle_get_object(struct MHD_Connection *connection,
request.SetBucket(bucket);
request.SetKey(key);

// S3EncryptionGetObjectOutcome outcome ;
// if (metadata.empty()) {
// outcome = it->second->GetObject(request);
// } else {
// Aws::Map<Aws::String, Aws::String> kmsContextMap;
// fill_context(kmsContextMap, metadata);
// outcome = it->second->GetObject(request, kmsContextMap);
// }

Aws::Map<Aws::String, Aws::String> kmsContextMap;
fill_context(kmsContextMap, metadata);
auto outcome = it->second->GetObject(request, kmsContextMap);
auto outcome = client->GetObject(request, kmsContextMap);

if (outcome.IsSuccess()) {
auto &stream = outcome.GetResult().GetBody();
Expand All @@ -187,8 +195,8 @@ MHD_Result handle_put_object(struct MHD_Connection *connection,
const std::string &client_id,
const std::string &body,
const std::string &metadata) {
auto it = client_cache.find(client_id);
if (it == client_cache.end()) {
auto client = get_client(client_id);
if (!client) {
return send_response(connection, 404, "{\"error\":\"Client not found\"}");
}

Expand All @@ -203,7 +211,7 @@ MHD_Result handle_put_object(struct MHD_Connection *connection,
auto stream = std::make_shared<std::stringstream>(body);
request.SetBody(stream);

auto outcome = it->second->PutObject(request, kmsContextMap);
auto outcome = client->PutObject(request, kmsContextMap);
if (outcome.IsSuccess()) {
json response = {{"bucket", bucket}, {"key", key}};
return send_response(connection, 200, response.dump());
Expand Down
2 changes: 1 addition & 1 deletion test-server/cpp-v2-transition-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build/s3ec-server:

build-server: | build/s3ec-server
@echo "Building Cpp transition server..."
cd build && make
cd build && $(MAKE)

start-server:
@echo "Starting Cpp transition server..."
Expand Down
44 changes: 26 additions & 18 deletions test-server/cpp-v2-transition-server/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
using json = nlohmann::json;
using namespace Aws::S3Encryption;
using Aws::S3Encryption::Materials::KMSWithContextEncryptionMaterials;
std::unordered_map<std::string, std::shared_ptr<S3EncryptionClientV2>>
client_cache;
std::unordered_map<std::string, std::shared_ptr<S3EncryptionClientV2>> client_cache_secret;
std::mutex client_mutex;

std::string generate_uuid() {
uuid_t uuid;
Expand All @@ -27,6 +27,23 @@ std::string generate_uuid() {
return std::string(uuid_str);
}

std::shared_ptr<S3EncryptionClientV2> get_client(const std::string &client_id)
{
std::lock_guard<std::mutex> lock(client_mutex);
auto it = client_cache_secret.find(client_id);
if (it == client_cache_secret.end()) {
return std::shared_ptr<S3EncryptionClientV2>();
} else {
return it->second;
}
}

void set_client(const std::string &client_id, std::shared_ptr<S3EncryptionClientV2> client)
{
std::lock_guard<std::mutex> lock(client_mutex);
client_cache_secret[client_id] = client;
}

std::string get_header_value(struct MHD_Connection *connection,
const char *key) {
const char *value =
Expand Down Expand Up @@ -99,7 +116,7 @@ MHD_Result handle_create_client(struct MHD_Connection *connection,
auto encryption_client = std::make_shared<S3EncryptionClientV2>(config);

std::string client_id = generate_uuid();
client_cache[client_id] = encryption_client;
set_client(client_id, encryption_client);

json response = {{"clientId", client_id}};
return send_response(connection, 200, response.dump());
Expand Down Expand Up @@ -169,8 +186,8 @@ MHD_Result handle_get_object(struct MHD_Connection *connection,
const std::string &bucket, const std::string &key,
const std::string &client_id,
const std::string &metadata) {
auto it = client_cache.find(client_id);
if (it == client_cache.end()) {
auto client = get_client(client_id);
if (!client) {
return send_response(connection, 404, "{\"error\":\"Client not found\"}");
}

Expand All @@ -179,18 +196,9 @@ MHD_Result handle_get_object(struct MHD_Connection *connection,
request.SetBucket(bucket);
request.SetKey(key);

// S3EncryptionGetObjectOutcome outcome ;
// if (metadata.empty()) {
// outcome = it->second->GetObject(request);
// } else {
// Aws::Map<Aws::String, Aws::String> kmsContextMap;
// fill_context(kmsContextMap, metadata);
// outcome = it->second->GetObject(request, kmsContextMap);
// }

Aws::Map<Aws::String, Aws::String> kmsContextMap;
fill_context(kmsContextMap, metadata);
auto outcome = it->second->GetObject(request, kmsContextMap);
auto outcome = client->GetObject(request, kmsContextMap);

if (outcome.IsSuccess()) {
auto &stream = outcome.GetResult().GetBody();
Expand All @@ -212,8 +220,8 @@ MHD_Result handle_put_object(struct MHD_Connection *connection,
const std::string &client_id,
const std::string &body,
const std::string &metadata) {
auto it = client_cache.find(client_id);
if (it == client_cache.end()) {
auto client = get_client(client_id);
if (!client) {
return send_response(connection, 404, "{\"error\":\"Client not found\"}");
}

Expand All @@ -228,7 +236,7 @@ MHD_Result handle_put_object(struct MHD_Connection *connection,
auto stream = std::make_shared<std::stringstream>(body);
request.SetBody(stream);

auto outcome = it->second->PutObject(request, kmsContextMap);
auto outcome = client->PutObject(request, kmsContextMap);
if (outcome.IsSuccess()) {
json response = {{"bucket", bucket}, {"key", key}};
return send_response(connection, 200, response.dump());
Expand Down
16 changes: 13 additions & 3 deletions test-server/cpp-v3-server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set(CMAKE_CXX_STANDARD 17)
set(BUILD_ONLY "kms;s3;s3-encryption" CACHE STRING "Build only KMS, S3, and S3-encryption components")
set(ENABLE_TESTING OFF CACHE BOOL "Disable testing")
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build static libraries")
set(ENABLE_ADDRESS_SANITIZER ON CACHE BOOL "Enable Address Sanitizer")

# Add AWS SDK as subdirectory
add_subdirectory(aws-sdk-cpp)
Expand All @@ -18,12 +19,21 @@ find_package(nlohmann_json REQUIRED)

add_executable(s3ec-server main.cpp)

target_include_directories(s3ec-server PRIVATE
# Enable Address Sanitizer for the executable
target_compile_options(s3ec-server PRIVATE -fsanitize=address -fno-omit-frame-pointer)
target_link_options(s3ec-server PRIVATE -fsanitize=address)

target_include_directories(s3ec-server PRIVATE
${LIBMICROHTTPD_INCLUDE_DIRS}
/opt/homebrew/include
)

target_include_directories(s3ec-server PRIVATE
${LIBMICROHTTPD_INCLUDE_DIRS}
/opt/homebrew/include
)

target_link_directories(s3ec-server PRIVATE
target_link_directories(s3ec-server PRIVATE
${LIBMICROHTTPD_LIBRARY_DIRS}
/opt/homebrew/lib
)
Expand All @@ -36,4 +46,4 @@ target_link_libraries(s3ec-server
aws-cpp-sdk-s3-encryption
nlohmann_json::nlohmann_json
uuid
)
)
2 changes: 1 addition & 1 deletion test-server/cpp-v3-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build/s3ec-server:

build-server: | build/s3ec-server
@echo "Building Cpp V3 server..."
cd build && make
cd build && $(MAKE)

start-server:
@echo "Starting Cpp V3 server..."
Expand Down
Loading
Loading