-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add-sanitizer-ci-job
- Loading branch information
Showing
26 changed files
with
915 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0. | ||
|
||
import Builder | ||
import os | ||
|
||
|
||
class BuildGGSamples(Builder.Action): | ||
""" | ||
Defines a custom build step for Greengrass samples. | ||
It's used via builder.json config file in the project root directory. | ||
""" | ||
|
||
def run(self, env): | ||
# parse extra cmake configs | ||
cmd_args = env.args | ||
|
||
steps = [] | ||
samples = [ | ||
'samples/greengrass/ipc', | ||
'samples/greengrass/basic_discovery', | ||
] | ||
|
||
for sample_path in samples: | ||
build_path = os.path.join('build', sample_path) | ||
steps.append(['cmake', | ||
f'-B{build_path}', | ||
f'-H{sample_path}', | ||
f'-DCMAKE_PREFIX_PATH={env.install_dir}', | ||
'-DCMAKE_BUILD_TYPE=RelWithDebInfo']) | ||
# append extra cmake configs | ||
steps[-1].extend(cmd_args.cmake_extra) | ||
steps.append(['cmake', | ||
'--build', build_path, | ||
'--config', 'RelWithDebInfo']) | ||
|
||
return Builder.Script(steps) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ env: | |
CI_X509_ROLE: arn:aws:iam::180635532705:role/CI_X509_Role | ||
CI_MQTT5_ROLE: arn:aws:iam::180635532705:role/CI_MQTT5_Role | ||
CI_GREENGRASS_ROLE: arn:aws:iam::180635532705:role/CI_Greengrass_Role | ||
CI_GREENGRASS_INSTALLER_ROLE: arn:aws:iam::180635532705:role/CI_GreengrassInstaller_Role | ||
CI_JOBS_SERVICE_CLIENT_ROLE: arn:aws:iam::180635532705:role/CI_JobsServiceClient_Role | ||
CI_SHADOW_SERVICE_CLIENT_ROLE: arn:aws:iam::180635532705:role/CI_ShadowServiceClient_Role | ||
|
||
|
@@ -325,7 +326,12 @@ jobs: | |
python builder.pyz build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DBUILD_SHARED_LIBS=ON | ||
osx: | ||
runs-on: macos-latest | ||
runs-on: ${{ matrix.runner }} | ||
strategy: | ||
matrix: | ||
runner: | ||
- macos-13 | ||
- macos-latest | ||
permissions: | ||
id-token: write # This is required for requesting the JWT | ||
security-events: write # This is required for pkcs12 sample to sign the key | ||
|
@@ -337,6 +343,8 @@ jobs: | |
./builder build -p ${{ env.PACKAGE_NAME }} --spec=downstream | ||
- name: Running samples in CI setup | ||
run: | | ||
python3 -m venv .venv | ||
source .venv/bin/activate | ||
python3 -m pip install boto3 | ||
- name: configure AWS credentials (PubSub) | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
|
@@ -345,6 +353,7 @@ jobs: | |
aws-region: ${{ env.AWS_DEFAULT_REGION }} | ||
- name: run MQTT3 PubSub sample | ||
run: | | ||
source .venv/bin/activate | ||
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_pubsub_cfg.json | ||
# - name: run PKCS12 sample | ||
# run: | | ||
|
@@ -370,6 +379,7 @@ jobs: | |
aws-region: ${{ env.AWS_DEFAULT_REGION }} | ||
- name: run MQTT5 PubSub sample | ||
run: | | ||
source .venv/bin/activate | ||
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_mqtt5_pubsub_cfg.json | ||
- name: configure AWS credentials (Device Advisor) | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
|
@@ -378,6 +388,7 @@ jobs: | |
aws-region: ${{ env.AWS_DEFAULT_REGION }} | ||
- name: run DeviceAdvisor | ||
run: | | ||
source .venv/bin/activate | ||
cd ./aws-iot-device-sdk-cpp-v2 | ||
python3 ./deviceadvisor/script/DATestRun.py | ||
# Not strictly needed, but allows us to run Device Advisor and PubSub on Linux without needing to run all samples | ||
|
@@ -631,14 +642,66 @@ jobs: | |
- name: run X509 sample | ||
run: | | ||
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_x509_connect_cfg.json | ||
- name: configure AWS credentials (Greengrass) | ||
# Runs the Greengrass samples | ||
linux-greengrass-tests: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write # This is required for requesting the JWT | ||
steps: | ||
- name: Setup C++ | ||
run: | | ||
sudo apt-get -qq update -y | ||
sudo apt-get -qq install -y build-essential | ||
sudo apt install cmake | ||
gcc --version | ||
cmake --version | ||
- name: Build ${{ env.PACKAGE_NAME }} + consumers | ||
run: | | ||
echo "Downloading source" | ||
git clone --recursive https://github.com/aws/aws-iot-device-sdk-cpp-v2.git --branch ${{ env.HEAD_REF || github.ref_name }} | ||
echo "Running builder" | ||
python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" | ||
python builder.pyz build -p ${{ env.PACKAGE_NAME }} --variant build_gg_samples_only | ||
- name: Install Greengrass Development Kit | ||
run: | | ||
python3 -m pip install awsiotsdk | ||
python3 -m pip install -U git+https://github.com/aws-greengrass/[email protected] | ||
- name: Configure AWS credentials (Greengrass) | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
role-to-assume: ${{ env.CI_GREENGRASS_ROLE }} | ||
role-to-assume: ${{ env.CI_GREENGRASS_INSTALLER_ROLE }} | ||
aws-region: ${{ env.AWS_DEFAULT_REGION }} | ||
- name: run Greengrass Discovery sample | ||
- name: Build and run Greengrass basic discovery sample | ||
working-directory: ./aws-iot-device-sdk-cpp-v2/tests/greengrass/basic_discovery | ||
run: | | ||
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_greengrass_discovery_cfg.json | ||
gdk component build | ||
gdk test-e2e build | ||
gdk test-e2e run | ||
- name: Show logs | ||
working-directory: ./aws-iot-device-sdk-cpp-v2/tests/greengrass/basic_discovery | ||
# Print logs unconditionally to provide more details on Greengrass run even if the test failed. | ||
if: always() | ||
run: | | ||
echo "=== greengrass.log" | ||
cat testResults/gg*/greengrass.log | ||
echo "=== software.amazon.awssdk.sdk-gg-test-discovery.log" | ||
cat testResults/gg*/software.amazon.awssdk.sdk-gg-test-discovery.log | ||
- name: Build and run Greengrass IPC sample | ||
working-directory: ./aws-iot-device-sdk-cpp-v2/tests/greengrass/ipc | ||
run: | | ||
gdk component build | ||
gdk test-e2e build | ||
gdk test-e2e run | ||
- name: Show logs | ||
working-directory: ./aws-iot-device-sdk-cpp-v2/tests/greengrass/ipc | ||
# Print logs unconditionally to provide more details on Greengrass run even if the test failed. | ||
if: always() | ||
run: | | ||
echo "=== greengrass.log" | ||
cat testResults/gg*/greengrass.log | ||
echo "=== software.amazon.awssdk.sdk-gg-ipc.log" | ||
cat testResults/gg*/software.amazon.awssdk.sdk-gg-ipc.log | ||
# check that docs can still build | ||
check-docs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,35 @@ | ||
{ | ||
"language": "CPP", | ||
"sample_file": "./aws-iot-device-sdk-cpp-v2/build/samples/greengrass/basic_discovery/basic-discovery", | ||
"sample_region": "us-east-1", | ||
"sample_main_class": "", | ||
"runnable_file": "basic-discovery", | ||
"runnable_region": "us-east-1", | ||
"runnable_main_class": "", | ||
"arguments": [ | ||
{ | ||
"name": "--cert", | ||
"secret": "ci/Greengrass/cert", | ||
"secret": "ci/GreengrassDiscovery/cert", | ||
"filename": "tmp_certificate.pem" | ||
}, | ||
{ | ||
"name": "--key", | ||
"secret": "ci/Greengrass/key", | ||
"secret": "ci/GreengrassDiscovery/key", | ||
"filename": "tmp_key.pem" | ||
}, | ||
{ | ||
"name": "--ca_file", | ||
"secret": "ci/Greengrass/ca", | ||
"filename": "tmp_ca.pem" | ||
"name": "--thing_name", | ||
"data": "CI_Greengrass_Discovery_Thing" | ||
}, | ||
{ | ||
"name": "--region", | ||
"data": "us-east-1" | ||
}, | ||
{ | ||
"name": "--thing_name", | ||
"data": "CI_GreenGrass_Thing" | ||
}, | ||
{ | ||
"name": "--is_ci", | ||
"data": "true" | ||
"name": "--topic", | ||
"data": "clients/CI_Greengrass_Discovery_Thing/hello/world/$INPUT_UUID" | ||
}, | ||
{ | ||
"name": "--print_discover_resp_only", | ||
"data": "" | ||
"name": "--mode", | ||
"data": "publish" | ||
} | ||
] | ||
], | ||
"stdin_file": "messages.txt" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"language": "CPP", | ||
"runnable_file": "greengrass-ipc", | ||
"runnable_region": "us-east-1", | ||
"runnable_main_class": "", | ||
"arguments": [ | ||
{ | ||
"name": "--topic", | ||
"data": "test/gg-ipc-topic" | ||
}, | ||
{ | ||
"name": "--message", | ||
"data": "hello" | ||
}, | ||
{ | ||
"name": "--is_ci", | ||
"data": "true" | ||
} | ||
|
||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.32.6 | ||
1.32.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule aws-crt-cpp
updated
11 files
+1 −1 | VERSION | |
+1 −1 | crt/aws-c-cal | |
+1 −0 | include/aws/crt/Types.h | |
+14 −0 | include/aws/crt/crypto/SymmetricCipher.h | |
+7 −0 | source/Types.cpp | |
+11 −4 | source/crypto/SymmetricCipher.cpp | |
+1 −1 | source/mqtt/Mqtt5Packets.cpp | |
+1 −0 | tests/CMakeLists.txt | |
+28 −0 | tests/Mqtt5ClientTest.cpp | |
+27 −0 | tests/SymmetricCipherTest.cpp | |
+18 −0 | tests/TypesTest.cpp |
Oops, something went wrong.