Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
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
72b1ada
Java needs Aes
seebees Nov 19, 2025
49a4e7e
update the java to fail succesfuly the new tests
seebees Nov 19, 2025
9103926
enable AES cpp
seebees Nov 19, 2025
0aa2da0
add retry
seebees Nov 19, 2025
878a9a0
fix net
seebees 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
31 changes: 15 additions & 16 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,25 +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:
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
18 changes: 10 additions & 8 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
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
Loading
Loading