-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move SDK informations to Matter program folder (#78)
* Move sdk info to matter program folder * fix fetch sdk stuff script * rename matterSettings fix matter module load in version.py * Fix sdk fetch scripts * Fix import references * Update comments * Read matter sdk sha only if exists * Flake8 fixes * Black fixes * Isort fixes * Isort fixes * Isort fixes
- Loading branch information
1 parent
3f9a773
commit 0fd0a4e
Showing
16 changed files
with
270 additions
and
81 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 |
---|---|---|
|
@@ -107,16 +107,6 @@ def get_emails_enabled(cls, v: bool, values: Dict[str, Any]) -> bool: | |
NOTIFIER_TO: str = "[email protected]" | ||
NOTIFIER_SUBJECT: str = "CHIP Tool Crash Log" | ||
|
||
# Test Engine Config | ||
CHIP_TOOL_TRACE: bool = True | ||
SDK_CONTAINER_NAME: str = "th-sdk" | ||
|
||
# SDK Docker Image | ||
SDK_DOCKER_IMAGE: str = "connectedhomeip/chip-cert-bins" | ||
SDK_DOCKER_TAG: str = "9f6d627e0262e1d023986291948bb4e845be803e" | ||
# SDK SHA: used to fetch test YAML from SDK. | ||
SDK_SHA: str = "9f6d627e0262e1d023986291948bb4e845be803e" | ||
|
||
class Config: | ||
case_sensitive = 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
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 was deleted.
Oops, something went wrong.
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,34 @@ | ||
# | ||
# Copyright (c) 2024 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
from pydantic import BaseSettings | ||
|
||
|
||
class MatterSettings(BaseSettings): | ||
# Test Engine Config | ||
CHIP_TOOL_TRACE: bool = True | ||
SDK_CONTAINER_NAME: str = "th-sdk" | ||
|
||
# SDK Docker Image | ||
SDK_DOCKER_IMAGE: str = "connectedhomeip/chip-cert-bins" | ||
SDK_DOCKER_TAG: str = "9f6d627e0262e1d023986291948bb4e845be803e" | ||
# SDK SHA: used to fetch test YAML from SDK. | ||
SDK_SHA: str = "9f6d627e0262e1d023986291948bb4e845be803e" | ||
|
||
class Config: | ||
case_sensitive = True | ||
|
||
|
||
matter_settings = MatterSettings() |
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,76 @@ | ||
#!/bin/bash -e | ||
|
||
# | ||
# Copyright (c) 2023 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
set -x | ||
set -e | ||
|
||
|
||
# Usage: ./test_collections/matter/scripts/update-paa-certs.sh | ||
# | ||
# Will copy PAA certificates from SDK repository | ||
# | ||
# Environment variables can be used to override behaviour | ||
# - SDK_PATH (When set, SDK_SHA is ignored) | ||
# - SDK_SHA | ||
|
||
# Paths | ||
MATTER_PROGRAM_DIR=$(realpath $(dirname "$0")/..) | ||
TMP_SDK_FOLDER="sdk-sparse" | ||
TMP_SDK_PATH="/tmp/$TMP_SDK_FOLDER" | ||
SDK_CERT_PATH="credentials/development/paa-root-certs" | ||
SDK_CERT_DEVELOPMENT_PATH="credentials/development" | ||
CERT_PATH="/var/paa-root-certs" | ||
DEVELOPMENT_PATH="/var/credentials/development" | ||
|
||
# If SDK path is not present, then do local checkout | ||
if [ -z "$SDK_PATH" ] | ||
then | ||
|
||
# If SDK SHA is not present, then fetch from Matter program config file | ||
if [ -z "$SDK_SHA" ] | ||
then | ||
cd $MATTER_PROGRAM_DIR | ||
SDK_SHA=$(cat $MATTER_PROGRAM_DIR/config.py | grep SDK_SHA | cut -d'"' -f 2 | cut -d"'" -f 2) | ||
fi | ||
|
||
# Checkout SDK sparsely | ||
rm -rf $TMP_SDK_PATH | ||
cd /tmp | ||
git clone --filter=blob:none --no-checkout --depth 1 --sparse https://github.com/project-chip/connectedhomeip.git $TMP_SDK_FOLDER | ||
cd $TMP_SDK_FOLDER | ||
git sparse-checkout init | ||
git sparse-checkout set $SDK_CERT_PATH $SDK_CERT_DEVELOPMENT_PATH | ||
git checkout -q $SDK_SHA | ||
SDK_PATH="$TMP_SDK_PATH" | ||
fi | ||
|
||
# Create folder if missing (owned by user) | ||
if [ ! -d "$CERT_PATH" ] | ||
then | ||
sudo mkdir -p $CERT_PATH | ||
sudo chown $USER:$USER $CERT_PATH | ||
fi | ||
|
||
# Create folder if missing (owned by user) | ||
if [ ! -d "$DEVELOPMENT_PATH" ] | ||
then | ||
sudo mkdir -p $DEVELOPMENT_PATH | ||
sudo chown $USER:$USER $DEVELOPMENT_PATH | ||
fi | ||
|
||
# Copy certs from SDK | ||
cp "$SDK_PATH/$SDK_CERT_PATH/"* $CERT_PATH/ | ||
cp -R "$SDK_PATH/$SDK_CERT_DEVELOPMENT_PATH/"** $DEVELOPMENT_PATH/ |
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,29 @@ | ||
#! /usr/bin/env bash | ||
|
||
# | ||
# Copyright (c) 2023 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
MATTER_PROGRAM_DIR=$(realpath $(dirname "$0")/..) | ||
|
||
printf "\n\n**********" | ||
printf "\n*** Update Matter Sample Apps ***\n" | ||
|
||
# We are fetching SDK docker image and tag name from backend | ||
# This is done to minimize the places the SDK version is tracked. | ||
SDK_DOCKER_IMAGE=$(cat $MATTER_PROGRAM_DIR/config.py | grep SDK_DOCKER_IMAGE | cut -d'"' -f 2 | cut -d"'" -f 2) | ||
SDK_DOCKER_TAG=$(cat $MATTER_PROGRAM_DIR/config.py | grep SDK_DOCKER_TAG | cut -d'"' -f 2 | cut -d"'" -f 2) | ||
sudo docker pull $SDK_DOCKER_IMAGE:$SDK_DOCKER_TAG | ||
|
||
sudo docker run -t -v ~/apps:/apps $SDK_DOCKER_IMAGE:$SDK_DOCKER_TAG bash -c "rm -v /apps/*; cp -v * /apps/;" | ||
sudo chown -R `whoami` ~/apps |
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
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
Oops, something went wrong.