-
Notifications
You must be signed in to change notification settings - Fork 2
tools docker #34
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
base: main
Are you sure you want to change the base?
tools docker #34
Changes from all commits
98c8144
bba96ce
1cd83dc
3e46f4c
43c49cb
a915631
5454e27
d4f764b
123ba70
dd2a8bb
2c8adf1
db9b515
16e773d
db775e9
a2446dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,15 +3,21 @@ name: Publish Docker | |
| on: | ||
| push: | ||
| paths: | ||
| - '.github/workflows/docker-publish.yml' | ||
| - 'docker/*' | ||
| - ".github/workflows/docker-publish.yml" | ||
| - "docker/*" | ||
|
|
||
| workflow_dispatch: | ||
| inputs: | ||
| push_images: | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| push_images: | ||
| required: false | ||
| description: "Push the images" | ||
| type: boolean | ||
| default: true | ||
| tools: | ||
| required: false | ||
| description: "Build the tools image" | ||
| type: boolean | ||
| default: true | ||
|
|
||
| jobs: | ||
| publish-matter-extension-dependencies-image: | ||
|
|
@@ -23,7 +29,7 @@ jobs: | |
| id-token: write | ||
| steps: | ||
| # Checkout repository | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| # Login to GitHub Container Registry | ||
| - name: Login to GitHub Container Registry | ||
|
|
@@ -36,18 +42,14 @@ jobs: | |
| # Set version variable for tagging the image by reading from docker/version file | ||
| - name: Read and print version from docker/version file | ||
| run: | | ||
| SISDK_Tag=$(grep '^SISDK_Tag=' docker/version | cut -d'=' -f2) | ||
| WiFI_SDK_Tag=$(grep '^WiFI_SDK_Tag=' docker/version | cut -d'=' -f2) | ||
| VERSION="SiSDK${SISDK_Tag}_WiFi_SDK${WiFI_SDK_Tag}" | ||
| echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
| echo "Parsed VERSION: $VERSION" | ||
|
|
||
| # Call docker/build.sh and pass version as an argument | ||
| - name: Build and push Docker image | ||
| if [[ "${{ github.event.inputs.tools }}" != "true" ]]; then | ||
| SISDK_Tag=$(grep '^SISDK_Tag=' docker/version | cut -d'=' -f2) | ||
| WiFI_SDK_Tag=$(grep '^WiFI_SDK_Tag=' docker/version | cut -d'=' -f2) | ||
| VERSION="SiSDK${SISDK_Tag}_WiFi_SDK${WiFI_SDK_Tag}" | ||
| echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
| echo "Parsed VERSION: $VERSION" | ||
| fi | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Version Mismatch: Hardcoded Tag Overrides ComputationThe |
||
| - name: Build and push tools Docker image | ||
| run: | | ||
| chmod +x docker/build.sh | ||
| if [[ "${{ github.event.inputs.push_images }}" == "true" ]]; then | ||
| ./docker/build.sh --tag "$VERSION" --push | ||
| else | ||
| ./docker/build.sh --tag "$VERSION" | ||
| fi | ||
| chmod +x docker/tools/build.sh | ||
| ./docker/tools/build.sh --tag "25Q4-Tools" --push | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Build Workflow Ignores Config, Incomplete Images.The workflow unconditionally builds only the tools image with a hardcoded tag, ignoring both the |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,55 +1,6 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
|
|
||
| # Usage: ./build.sh --tag <version> [--push] | ||
| PUSH_IMAGE=false | ||
| while [[ $# -gt 0 ]]; do | ||
| case "$1" in | ||
| --tag) | ||
| TAG="$2" | ||
| shift 2 | ||
| ;; | ||
| --push) | ||
| PUSH_IMAGE=true | ||
| shift | ||
| ;; | ||
| *) | ||
| echo "Usage: $0 --tag <version> [--push]" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| if [[ -z "$TAG" ]]; then | ||
| echo "ERROR: --tag argument required. Usage: $0 --tag <version> [--push]" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Example TAG: SiSDKv2024.12.1-0.de_WiFi_SDKv3.4.1 | ||
| # Extract SISDK_Tag and WiFI_SDK_Tag from TAG | ||
| SISDK_Tag=$(echo "$TAG" | sed -n 's/^SiSDK\([^_]*\)_WiFi_SDK.*$/\1/p') | ||
| WiFI_SDK_Tag=$(echo "$TAG" | sed -n 's/^SiSDK[^_]*_WiFi_SDK\(.*\)$/\1/p') | ||
|
|
||
| if [[ -z "$SISDK_Tag" || -z "$WiFI_SDK_Tag" ]]; then | ||
| echo "ERROR: Could not parse SISDK_Tag or WiFI_SDK_Tag from version tag: $TAG" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Parsed SISDK_Tag: $SISDK_Tag" | ||
| echo "Parsed WiFI_SDK_Tag: $WiFI_SDK_Tag" | ||
|
|
||
| # Compose image tag | ||
| IMAGE_NAME="ghcr.io/siliconlabssoftware/matter_extension_dependencies" | ||
|
|
||
| # Build the Docker image, passing build args | ||
| docker build \ | ||
| --build-arg SISDK_Tag="$SISDK_Tag" \ | ||
| --build-arg WiFI_SDK_Tag="$WiFI_SDK_Tag" \ | ||
| -f docker/Dockerfile \ | ||
| -t "${IMAGE_NAME}:${TAG}" . | ||
|
|
||
| # Push the image only if --push was provided | ||
| if [[ "$PUSH_IMAGE" == "true" ]]; then | ||
| docker push "${IMAGE_NAME}:${TAG}" | ||
| # Call docker/sdks/build.sh and pass version as an argument | ||
| if [[ "${{ github.event.inputs.tools }}" == "false" ]]; then | ||
| ./docker/sdks/build.sh --tag "$VERSION" | ||
| else | ||
| ./docker/tools/build.sh --tag "$VERSION" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Incorrect Syntax and Undefined Variable Break ScriptThe script uses GitHub Actions template syntax |
||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
|
|
||
| # Usage: ./build.sh --tag <version> [--push] | ||
| PUSH_IMAGE=false | ||
| while [[ $# -gt 0 ]]; do | ||
| case "$1" in | ||
| --tag) | ||
| TAG="$2" | ||
| shift 2 | ||
| ;; | ||
| --push) | ||
| PUSH_IMAGE=true | ||
| shift | ||
| ;; | ||
| *) | ||
| echo "Usage: $0 --tag <version> [--push]" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| if [[ -z "$TAG" ]]; then | ||
| echo "ERROR: --tag argument required. Usage: $0 --tag <version> [--push]" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Example TAG: SiSDKv2024.12.1-0.de_WiFi_SDKv3.4.1 | ||
| # Extract SISDK_Tag and WiFI_SDK_Tag from TAG | ||
| SISDK_Tag=$(echo "$TAG" | sed -n 's/^SiSDK\([^_]*\)_WiFi_SDK.*$/\1/p') | ||
| WiFI_SDK_Tag=$(echo "$TAG" | sed -n 's/^SiSDK[^_]*_WiFi_SDK\(.*\)$/\1/p') | ||
|
|
||
| if [[ -z "$SISDK_Tag" || -z "$WiFI_SDK_Tag" ]]; then | ||
| echo "ERROR: Could not parse SISDK_Tag or WiFI_SDK_Tag from version tag: $TAG" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Parsed SISDK_Tag: $SISDK_Tag" | ||
| echo "Parsed WiFI_SDK_Tag: $WiFI_SDK_Tag" | ||
|
|
||
| # Compose image tag | ||
| IMAGE_NAME="ghcr.io/siliconlabssoftware/matter_extension_dependencies" | ||
|
|
||
| # Build the Docker image, passing build args | ||
| docker build \ | ||
| --build-arg SISDK_Tag="$SISDK_Tag" \ | ||
| --build-arg WiFI_SDK_Tag="$WiFI_SDK_Tag" \ | ||
| -f docker/Dockerfile \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| -t "${IMAGE_NAME}:${TAG}" . | ||
|
|
||
| # Push the image only if --push was provided | ||
| if [[ "$PUSH_IMAGE" == "true" ]]; then | ||
| docker push "${IMAGE_NAME}:${TAG}" | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| # Set build argument for base image version | ||
| ARG VERSION=latest | ||
|
|
||
| # Stage 1: Build dependencies and download SDKs/tools | ||
| FROM ghcr.io/project-chip/chip-build:${VERSION} AS build | ||
| LABEL org.opencontainers.image.source=https://github.com/project-chip/connectedhomeip | ||
|
|
||
| # Install required packages for cloning and extracting SDKs | ||
| RUN set -x \ | ||
| && apt-get update \ | ||
| && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ | ||
| git \ | ||
| git-lfs \ | ||
| zip \ | ||
| tar \ | ||
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists/ \ | ||
| && : # last line | ||
|
|
||
| # Set UTF-8 locale to ensure unzip handles non-ASCII filenames correctly | ||
| # util/third_party/ot-br-posix/third_party/cpp-httplib/repo/test/www/#U65e5#U672c#U8a9eDir/#U65e5#U672c#U8a9eFile.txt | ||
| ENV LANG=C.UTF-8 | ||
|
|
||
| # - name: Setup SLT | ||
| # id: setup-action | ||
| # uses: SiliconLabsSoftware/action-setup-slt@main | ||
| #Setup SLT | ||
| RUN set -x \ | ||
| && curl https://www.silabs.com/documents/public/software/slt-cli-1.0.0-linux-x64.zip --output /tmp/slt-cli-1.0.0-linux-x64.zip \ | ||
| && unzip /tmp/slt-cli-1.0.0-linux-x64.zip -d /tmp/slt-cli \ | ||
| && rm /tmp/slt-cli-1.0.0-linux-x64.zip \ | ||
| && chmod +x /tmp/slt-cli/slt \ | ||
| && : # last line | ||
|
|
||
| ENV PATH="${PATH}:/tmp/slt-cli" | ||
| ENV SLT_CI=true | ||
|
|
||
| RUN set -x \ | ||
| && echo "slt-version=$(slt --version)" \ | ||
| && echo "slt-path=$(which slt)" \ | ||
| && : # last line | ||
|
|
||
|
|
||
| RUN set -x \ | ||
| && slt install foo --engine conan || true \ | ||
| && HOME="${HOME:-/root}" \ | ||
| && CONAN_ENGINE_PATH="$HOME/.silabs/slt/engines/conan/conan_engine" \ | ||
| && CONAN_PATH="$HOME/.silabs/slt/engines/conan/conan/conan" \ | ||
| && INSTALL_PATH="$HOME/.local/bin" \ | ||
| && mkdir -p "$INSTALL_PATH" \ | ||
| && if [ -f "$CONAN_ENGINE_PATH" ]; then \ | ||
| ln -s "$CONAN_ENGINE_PATH" "$INSTALL_PATH/conan_engine"; \ | ||
| else \ | ||
| echo "Error: conan_engine not found at $CONAN_ENGINE_PATH" && exit 1; \ | ||
| fi \ | ||
| && echo "conan-engine-version=$(conan_engine --version)" \ | ||
| && echo "conan-engine-path=$(which conan_engine)" \ | ||
| && if [ -f "$CONAN_PATH" ]; then \ | ||
| ln -s "$CONAN_PATH" "$INSTALL_PATH/conan"; \ | ||
| else \ | ||
| echo "Error: conan not found at $CONAN_PATH"; \ | ||
| fi \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| && echo "conan-version=$(conan --version)" \ | ||
| && echo "conan-path=$(which conan)" \ | ||
| && echo "CONAN_HOME=$HOME/.silabs/slt/installs/conan" \ | ||
| && : # last line | ||
|
|
||
| ENV CONAN_HOME=/root/.silabs/slt/installs/conan | ||
|
|
||
| RUN set -x \ | ||
| && slt install slc-cli \ | ||
| && SLC_CLI_PATH=$(slt where slc-cli) \ | ||
| && JAVA_HOME=$(slt where java21) \ | ||
| && echo "SLC_CLI_PATH=$SLC_CLI_PATH" \ | ||
| && echo "JAVA_HOME=$JAVA_HOME" \ | ||
| && echo "export SLC_CLI_PATH=$SLC_CLI_PATH" >> /etc/profile.d/slt-env.sh \ | ||
| && echo "export JAVA_HOME=$JAVA_HOME" >> /etc/profile.d/slt-env.sh \ | ||
| && echo "export PATH=\"\${PATH}:${SLC_CLI_PATH}\"" >> /etc/profile.d/slt-env.sh \ | ||
| && if [ -n "$JAVA_HOME" ]; then \ | ||
| echo "export PATH=\"\${PATH}:${JAVA_HOME}/jre/bin\"" >> /etc/profile.d/slt-env.sh \ | ||
| fi \ | ||
| && : # last line | ||
|
|
||
|
|
||
| RUN set -x \ | ||
| && slt install commander \ | ||
| && COMMANDER_PATH=$(slt where commander) \ | ||
| && echo "COMMANDER_PATH=$COMMANDER_PATH" \ | ||
| && echo "export COMMANDER_PATH=$COMMANDER_PATH" >> /etc/profile.d/slt-env.sh \ | ||
| && echo "export PATH=\"\${PATH}:${COMMANDER_PATH}\"" >> /etc/profile.d/slt-env.sh \ | ||
| && : # last line | ||
|
|
||
|
|
||
| RUN set -x \ | ||
| && slt install gcc-arm-none-eabi \ | ||
| && ARM_GCC_DIR=$(slt where gcc-arm-none-eabi) \ | ||
| && echo "ARM_GCC_DIR=$ARM_GCC_DIR" \ | ||
| && echo "export ARM_GCC_DIR=$ARM_GCC_DIR" >> /etc/profile.d/slt-env.sh \ | ||
| && echo "export PATH=\"\${PATH}:${ARM_GCC_DIR}/bin\"" >> /etc/profile.d/slt-env.sh \ | ||
| && : # last line | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
|
|
||
| # Usage: ./build.sh --tag <version> [--push] | ||
| PUSH_IMAGE=false | ||
| while [[ $# -gt 0 ]]; do | ||
| case "$1" in | ||
| --tag) | ||
| TAG="$2" | ||
| shift 2 | ||
| ;; | ||
| --push) | ||
| PUSH_IMAGE=true | ||
| shift | ||
| ;; | ||
| *) | ||
| echo "Usage: $0 --tag <version> [--push]" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| if [[ -z "$TAG" ]]; then | ||
| echo "ERROR: --tag argument required. Usage: $0 --tag <version> [--push]" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Compose image tag | ||
| IMAGE_NAME="ghcr.io/siliconlabssoftware/matter_build_action_tools" | ||
|
|
||
| # Build the Docker image, passing build args | ||
| docker build \ | ||
| -f docker/tools/Dockerfile \ | ||
| -t "${IMAGE_NAME}:${TAG}" . | ||
|
|
||
| # Push the image only if --push was provided | ||
| if [[ "$PUSH_IMAGE" == "true" ]]; then | ||
| docker push "${IMAGE_NAME}:${TAG}" | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # codegen.py build requirements | ||
| Jinja2==3.1.3 | ||
| lark==1.1.7 | ||
| # Sphinx dependencies (for slc-cli) | ||
| linkify-it-py==2.0.2 | ||
| myst-parser==2.0.0 | ||
| Sphinx==7.2.6 | ||
| sphinx-rtd-theme==1.3.0 | ||
| sphinx-tabs==3.4.1 |
Uh oh!
There was an error while loading. Please reload this page.