Skip to content

Commit 4f8675b

Browse files
authored
Merge branch 'main' into byte-buf-fix
2 parents 27e5818 + 9c401c4 commit 4f8675b

23 files changed

Lines changed: 1321 additions & 2094 deletions

NOTICE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
11
AWS Crt Java
22
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
SPDX-License-Identifier: Apache-2.0.
4+
5+
** XXHash - https://xxhash.com/
6+
Copyright (c) 2012-2021 Yann Collet
7+
All rights reserved.
8+
9+
BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php)
10+
11+
Redistribution and use in source and binary forms, with or without modification,
12+
are permitted provided that the following conditions are met:
13+
14+
* Redistributions of source code must retain the above copyright notice, this
15+
list of conditions and the following disclaimer.
16+
17+
* Redistributions in binary form must reproduce the above copyright notice, this
18+
list of conditions and the following disclaimer in the documentation and/or
19+
other materials provided with the distribution.
20+
21+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
25+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
28+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,3 +298,6 @@ To debug native code with VSCode or CLion or any other IDE:
298298
3. Set the parameters to be the ones used by the ```mvn``` script, as per above
299299
4. Set the working directory to the `aws-crt-java` directory
300300
5. On windows, you will need to manually load the PDB via the Modules window in Visual Studio, as it is not embedded in the JAR. It will be in the ```target/cmake-build/lib/windows/<arch>``` folder.
301+
302+
## Attribution
303+
This library exposes native XXHash implementation (https://github.com/Cyan4973/xxHash) through JNI interface.

codebuild/CanaryWrapper.py

Lines changed: 0 additions & 330 deletions
This file was deleted.

codebuild/CanaryWrapper_24_7.py

Lines changed: 0 additions & 398 deletions
This file was deleted.

codebuild/CanaryWrapper_Classes.py

Lines changed: 0 additions & 1288 deletions
This file was deleted.

codebuild/CanaryWrapper_MetricFunctions.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

codebuild/mqtt5-java-canary-test.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 0.2
22
env:
33
shell: bash
44
variables:
5-
CANARY_DURATION: 25200
5+
CANARY_DURATION: 300
66
CANARY_THREADS: 3
77
CANARY_TPS: 50
88
CANARY_CLIENT_COUNT: 10
@@ -25,9 +25,36 @@ phases:
2525
- sudo apt-get install pip -y -f
2626
- python3 -m pip install psutil
2727
- python3 -m pip install boto3
28+
pre_build:
29+
commands:
30+
# Retrieve the private key from Secrets Manager
31+
- DEPLOY_KEY=$(aws secretsmanager get-secret-value --secret-id Aws-crt-canaries-deploy-key --query SecretString --output text)
32+
33+
# Set up SSH configuration
34+
- mkdir -p ~/.ssh
35+
- echo "$DEPLOY_KEY" > ~/.ssh/id_rsa
36+
- chmod 600 ~/.ssh/id_rsa
37+
38+
# Add GitHub to known hosts to avoid host verification prompt
39+
- ssh-keyscan -H github.com >> ~/.ssh/known_hosts
40+
41+
# Configure SSH to use the key for GitHub
42+
- |
43+
cat > ~/.ssh/config << EOF
44+
Host github.com
45+
HostName github.com
46+
User git
47+
IdentityFile ~/.ssh/id_rsa
48+
StrictHostKeyChecking no
49+
EOF
50+
- chmod 600 ~/.ssh/config
2851
build:
2952
commands:
3053
- echo Build started on `date`
54+
# pull and copy canary scripts
55+
- git clone git@github.com:awslabs/aws-crt-canaries.git
56+
- cp aws-crt-canaries/source/mqtt5/*.py codebuild
57+
# Build CRT
3158
- mvn install -DskipTests
3259
# Get secrets needed
3360
- export S3_DST=$(aws secretsmanager get-secret-value --secret-id "$CANARY_BUILD_S3_DST" --query "SecretString" | cut -f2,3 -d":" | sed -e 's/[\\\"\}]//g')
@@ -36,7 +63,9 @@ phases:
3663
- export ENDPOINT=$(aws secretsmanager get-secret-value --secret-id ${CANARY_SERVER_ARN} --query "SecretString" | cut -f2 -d":" | sed -e 's/[\\\"\}]//g')
3764
# Run the Canary
3865
- cd ./utils/Canary
39-
- python3 ../../codebuild/CanaryWrapper.py --canary_executable mvn --canary_arguments "compile exec:java -Dexec.mainClass=canary.mqtt5.Mqtt5Canary -Dexec.args=\"--endpoint \"${ENDPOINT}\" --port 1883 --seconds ${CANARY_DURATION} --threads ${CANARY_THREADS} --tps ${CANARY_TPS} --clients ${CANARY_CLIENT_COUNT}\" -Daws.crt.debugnative=true -Daws.crt.log.destination=Stdout -Daws.crt.log.level=${CANARY_LOG_LEVEL}" --git_hash ${GIT_HASH} --git_repo_name $PACKAGE_NAME --codebuild_log_path $CODEBUILD_LOG_PATH --ticket_item "${CODEBUILD_TICKET_ITEM}"
66+
- python3 ../../codebuild/CanaryWrapper.py --canary_executable mvn --canary_arguments "compile exec:java -Dexec.mainClass=canary.mqtt5.Mqtt5Canary -Dexec.args=\"--endpoint \"${ENDPOINT}\" --port 1883 --seconds ${CANARY_DURATION} --threads ${CANARY_THREADS} --tps ${CANARY_TPS} --clients ${CANARY_CLIENT_COUNT}\"" --git_hash ${GIT_HASH} --git_repo_name $PACKAGE_NAME --ticket_item "${CODEBUILD_TICKET_ITEM}" --cloudwatch_namespace mqtt5_canary
4067
post_build:
4168
commands:
4269
- echo Build completed on `date`
70+
# Clean up SSH keys for security
71+
- rm -rf ~/.ssh/id_rsa ~/.ssh/config

crt/aws-c-io

0 commit comments

Comments
 (0)