Skip to content

Request response workspace #618

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

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
84 changes: 43 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ env:
DA_SHADOW_PROPERTY: datest
DA_SHADOW_VALUE_SET: ON
DA_SHADOW_VALUE_DEFAULT: OFF
CI_UTILS_FOLDER: "./aws-iot-device-sdk-python-v2/utils"
CI_SAMPLES_CFG_FOLDER: "./aws-iot-device-sdk-python-v2/.github/workflows"
CI_SAMPLES_FOLDER: "./aws-iot-device-sdk-python-v2/samples"
CI_UTILS_FOLDER: "./utils"
CI_SAMPLES_CFG_FOLDER: "./.github/workflows"
CI_SAMPLES_FOLDER: "./samples"
CI_PUBSUB_ROLE: arn:aws:iam::180635532705:role/CI_PubSub_Role
CI_COGNITO_ROLE: arn:aws:iam::180635532705:role/CI_Cognito_Role
CI_X509_ROLE: arn:aws:iam::180635532705:role/CI_X509_Role
Expand All @@ -34,7 +34,7 @@ env:
CI_MQTT5_ROLE: arn:aws:iam::180635532705:role/CI_MQTT5_Role
CI_BUILD_AND_TEST_ROLE: arn:aws:iam::180635532705:role/V2_SDK_Unit_Testing
CI_JOBS_SERVICE_CLIENT_ROLE: arn:aws:iam::180635532705:role/CI_JobsServiceClient_Role
CI_SERVICE_ROLE_CFG_FOLDER: "./aws-iot-device-sdk-python-v2/servicetests/test_cases"
CI_SERVICE_ROLE_CFG_FOLDER: "./servicetests/test_cases"
CI_SHADOW_SERVICE_CLIENT_ROLE: arn:aws:iam::180635532705:role/CI_ShadowServiceClient_Role

jobs:
Expand All @@ -48,7 +48,7 @@ jobs:
run: |
python -m pip install boto3
- name: configure AWS credentials (containers)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_BUILD_AND_TEST_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -57,7 +57,7 @@ jobs:
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 }}
- name: configure AWS credentials (PubSub)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_PUBSUB_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -68,15 +68,15 @@ jobs:
run: |
python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_windows_cert_connect_cfg.json
- name: configure AWS credentials (MQTT5 samples)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_MQTT5_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: run MQTT5 PubSub sample
run: |
python ${{ 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
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_DEVICE_ADVISOR }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -103,7 +103,7 @@ jobs:
source .venv/bin/activate
python3 -m pip install boto3
- name: configure AWS credentials (containers)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_BUILD_AND_TEST_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -114,7 +114,7 @@ jobs:
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }}
- name: configure AWS credentials (PubSub)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_PUBSUB_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -131,7 +131,7 @@ jobs:
source .venv/bin/activate
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_pkcs12_connect_cfg.json
- name: configure AWS credentials (MQTT5 samples)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_MQTT5_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -140,7 +140,7 @@ jobs:
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
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_DEVICE_ADVISOR }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -155,46 +155,48 @@ jobs:
permissions:
id-token: write # This is required for requesting the JWT
steps:
- name: Running samples in CI setup
- name: Install AWS SDK for Python
run: |
python -m pip install boto3
- name: configure AWS credentials (containers)
python3 -m pip install boto3
- name: Checkout Sources
uses: actions/checkout@v2
- name: Build ${{ env.PACKAGE_NAME }}
run: |
python3 -m pip install .
- name: configure AWS credentials (MQTT5)
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ env.CI_BUILD_AND_TEST_ROLE }}
role-to-assume: ${{ env.CI_MQTT5_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Build ${{ env.PACKAGE_NAME }}
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }}
- name: Running samples in CI setup
- name: Local tests
shell: bash
run: |
python3 -m pip install boto3
source utils/test_setup.sh s3://iot-sdk-ci-bucket-us-east1/IotUsProdMqtt5EnvironmentVariables.txt us-east-1
python3 -m unittest
source utils/test_cleanup.sh
- name: configure AWS credentials (PubSub)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_PUBSUB_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: run PubSub sample
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_pubsub_cfg.json
- name: configure AWS credentials (MQTT5 samples)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_MQTT5_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: run MQTT5 PubSub sample
run: |
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
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_DEVICE_ADVISOR }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: run DeviceAdvisor
run: |
cd ./aws-iot-device-sdk-python-v2
python3 ./deviceadvisor/script/DATestRun.py

# Runs the samples and ensures that everything is working
Expand All @@ -210,7 +212,7 @@ jobs:
sudo apt-get install softhsm -y
softhsm2-util --version
- name: configure AWS credentials (containers)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_BUILD_AND_TEST_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -221,7 +223,7 @@ jobs:
./builder build -p ${{ env.PACKAGE_NAME }}

- name: configure AWS credentials (service tests Fleet Provisioning)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_FLEET_PROVISIONING_ROLE}}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -247,7 +249,7 @@ jobs:
python3 ./test_cases/test_fleet_provisioning.py --config-file test_cases/mqtt5_fleet_provisioning_with_csr_cfg.json --thing-name-prefix Fleet_Thing_

- name: configure AWS credentials (service tests Shadow)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_SHADOW_SERVICE_CLIENT_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -273,7 +275,7 @@ jobs:
python3 ./test_cases/test_shadow_update.py --config-file test_cases/mqtt3_named_shadow_cfg.json

- name: configure AWS credentials (service tests Jobs)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_JOBS_SERVICE_CLIENT_ROLE}}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -289,7 +291,7 @@ jobs:
python3 ./test_cases/test_jobs_execution.py --config-file test_cases/mqtt5_jobs_cfg.json

- name: configure AWS credentials (Connect and PubSub)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_PUBSUB_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -309,23 +311,23 @@ jobs:
echo "directories.tokendir = /tmp/tokens" > /tmp/softhsm2.conf
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_pkcs11_connect_cfg.json
- name: configure AWS credentials (Cognito)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_COGNITO_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: run Cognito Connect sample
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_cognito_connect_cfg.json
- name: configure AWS credentials (X509)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_X509_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- 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 (MQTT5 samples)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_MQTT5_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -348,15 +350,15 @@ jobs:
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_mqtt5_shared_subscription_cfg.json
- name: configure AWS credentials (Custom Authorizer)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_CUSTOM_AUTHORIZER_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: run CustomAuthorizerConnect sample
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_custom_authorizer_connect_cfg.json
- name: configure AWS credentials (Shadow)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_SHADOW_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -367,7 +369,7 @@ jobs:
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_mqtt5_shadow_cfg.json
- name: configure AWS credentials (Jobs)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_JOBS_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -378,7 +380,7 @@ jobs:
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_mqtt5_jobs_cfg.json
- name: configure AWS credentials (Fleet provisioning)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_FLEET_PROVISIONING_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -404,7 +406,7 @@ jobs:
run: |
python3 -m pip install boto3
- name: configure AWS credentials (containers)
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_BUILD_AND_TEST_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -418,7 +420,7 @@ jobs:
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
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_GREENGRASS_INSTALLER_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_run_basic_connect_cfg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"language": "Python",
"sample_file": "./aws-iot-device-sdk-python-v2/samples/basic_connect.py",
"sample_file": "./samples/basic_connect.py",
"sample_region": "us-east-1",
"sample_main_class": "",
"arguments": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_run_cognito_connect_cfg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"language": "Python",
"sample_file": "./aws-iot-device-sdk-python-v2/samples/cognito_connect.py",
"sample_file": "./samples/cognito_connect.py",
"sample_region": "us-east-1",
"sample_main_class": "",
"arguments": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"language": "Python",
"sample_file": "./aws-iot-device-sdk-python-v2/samples/custom_authorizer_connect.py",
"sample_file": "./samples/custom_authorizer_connect.py",
"sample_region": "us-east-1",
"sample_main_class": "",
"arguments": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_run_fleet_provisioning_cfg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"language": "Python",
"sample_file": "./aws-iot-device-sdk-python-v2/samples/fleetprovisioning.py",
"sample_file": "./samples/deprecated/fleetprovisioning.py",
"sample_region": "us-east-1",
"sample_main_class": "",
"arguments": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_run_jobs_cfg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"language": "Python",
"sample_file": "./aws-iot-device-sdk-python-v2/samples/jobs.py",
"sample_file": "./samples/deprecated/jobs.py",
"sample_region": "us-east-1",
"sample_main_class": "",
"arguments": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_run_mqtt5_custom_authorizer_cfg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"language": "Python",
"sample_file": "./aws-iot-device-sdk-python-v2/samples/mqtt5_custom_authorizer_connect.py",
"sample_file": "./samples/mqtt5_custom_authorizer_connect.py",
"sample_region": "us-east-1",
"sample_main_class": "",
"arguments": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"language": "Python",
"sample_file": "./aws-iot-device-sdk-python-v2/samples/mqtt5_custom_authorizer_connect.py",
"sample_file": "./samples/mqtt5_custom_authorizer_connect.py",
"sample_region": "us-east-1",
"sample_main_class": "",
"arguments": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_run_mqtt5_fleet_provisioning_cfg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"language": "Python",
"sample_file": "./aws-iot-device-sdk-python-v2/samples/fleetprovisioning_mqtt5.py",
"sample_file": "./samples/deprecated/fleetprovisioning_mqtt5.py",
"sample_region": "us-east-1",
"sample_main_class": "",
"arguments": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_run_mqtt5_jobs_cfg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"language": "Python",
"sample_file": "./aws-iot-device-sdk-python-v2/samples/jobs_mqtt5.py",
"sample_file": "./samples/deprecated/jobs_mqtt5.py",
"sample_region": "us-east-1",
"sample_main_class": "",
"arguments": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_run_mqtt5_pkcs11_connect_cfg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"language": "Python",
"sample_file": "./aws-iot-device-sdk-python-v2/samples/mqtt5_pkcs11_connect.py",
"sample_file": "./samples/mqtt5_pkcs11_connect.py",
"sample_region": "us-east-1",
"sample_main_class": "",
"arguments": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_run_mqtt5_pubsub_cfg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"language": "Python",
"sample_file": "./aws-iot-device-sdk-python-v2/samples/mqtt5_pubsub.py",
"sample_file": "./samples/mqtt5_pubsub.py",
"sample_region": "us-east-1",
"sample_main_class": "mqtt5.pubsub.PubSub",
"arguments": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_run_mqtt5_shadow_cfg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"language": "Python",
"sample_file": "./aws-iot-device-sdk-python-v2/samples/shadow_mqtt5.py",
"sample_file": "./samples/deprecated/shadow_mqtt5.py",
"sample_region": "us-east-1",
"sample_main_class": "",
"arguments": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"language": "Python",
"sample_file": "./aws-iot-device-sdk-python-v2/samples/mqtt5_shared_subscription.py",
"sample_file": "./samples/mqtt5_shared_subscription.py",
"sample_region": "us-east-1",
"sample_main_class": "",
"arguments": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_run_pkcs11_connect_cfg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"language": "Python",
"sample_file": "./aws-iot-device-sdk-python-v2/samples/pkcs11_connect.py",
"sample_file": "./samples/pkcs11_connect.py",
"sample_region": "us-east-1",
"sample_main_class": "",
"arguments": [
Expand Down
Loading
Loading