Skip to content

Commit

Permalink
Merge branch 'matter_dev_docker' into 'main'
Browse files Browse the repository at this point in the history
ESP Matter Developement docker image with IDF v4.4.3

See merge request app-frameworks/esp-matter!268
  • Loading branch information
dhrishi committed Jan 11, 2023
2 parents 308e92b + 7927d3b commit 6e6448f
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 50 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@ name: Docker Image CI

on:
push:
# Runs when chip-builds file changes
branches: [ "main" ]
paths:
- "tools/docker/chip-builds"

# Can be run manually
workflow_dispatch:

env:
# Platforms to build the image for
BUILD_PLATFORMS: linux/amd64,linux/arm64
# Github runner is running out of space when we are building for multiple architectures in single runner
BUILD_PLATFORMS: linux/amd64
DOCKERHUB_REPO: ${{ github.repository }}
TAG_NAME: chip
TAG_NAME: latest

jobs:
build:
Expand All @@ -55,7 +53,7 @@ jobs:
uses: docker/build-push-action@v3
with:
context: tools/docker
file: tools/docker/chip-builds
file: tools/docker/matter-builds
push: true
tags: ${{ env.DOCKERHUB_REPO }}:${{ env.TAG_NAME }}
platforms: ${{ env.BUILD_PLATFORMS }}
38 changes: 14 additions & 24 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
name: Build and Deploy example bins to github pages

on:
push:
branches: ["main"]
workflow_run:
workflows: ["Docker Image CI"]
types: [completed]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -36,46 +37,38 @@ concurrency:
cancel-in-progress: true

jobs:

Build:
# Disable the job in forks
if: ${{ github.repository_owner == 'espressif' }}

runs-on: ubuntu-latest
container:
image: espressif/esp-matter:chip
image: espressif/esp-matter:latest
strategy:
matrix:
build-dir: ['examples/light', 'examples/light_switch']
targets: ['esp32', 'esp32c3']

steps:
- name: Checkout
uses: actions/checkout@v3

- name: idf stuff
run: |
rm -rf connectedhomeip/connectedhomeip
ln -s $CHIP_PATH connectedhomeip
mkdir -p images
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
- run: mkdir -p images
- name: build application
run: |
export ESP_MATTER_PATH=$PWD
. $IDF_PATH/export.sh
. $ESP_MATTER_PATH/export.sh
cd ${{matrix.build-dir}}
cd $ESP_MATTER_PATH/${{matrix.build-dir}}
idf.py set-target ${{matrix.targets}} build
cd build
TARGET_CHIP=`cat project_description.json | python3 -c 'import sys,json; print(json.load(sys.stdin)["target"])'`
APP_BIN=`cat project_description.json | python3 -c 'import sys,json; print(json.load(sys.stdin)["app_bin"])'`
esptool.py --chip $TARGET_CHIP merge_bin -o "$ESP_MATTER_PATH/images/$TARGET_CHIP"_"$APP_BIN" `cat flash_args | tr '\n' '\ '`
esptool.py --chip $TARGET_CHIP merge_bin -o "$GITHUB_WORKSPACE/images/$TARGET_CHIP"_"$APP_BIN" `cat flash_args | tr '\n' '\ '`
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: build-images
path: 'images/'
path: images/

deploy:
# Disable the job in forks
Expand All @@ -88,12 +81,9 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
container:
image: espressif/esp-matter:chip
image: espressif/esp-matter:latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download builds
uses: actions/download-artifact@v3
with:
Expand All @@ -102,17 +92,17 @@ jobs:

- name: generate launchpad config
run: |
cd images
cd images/
ls
../tools/launchpad/generate_launchpad_config.sh
$ESP_MATTER_PATH/tools/launchpad/generate_launchpad_config.sh
- name: Setup Pages
uses: actions/configure-pages@v2

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'images/'
path: images/

- name: Deploy to GitHub Pages
id: deployment
Expand Down
2 changes: 2 additions & 0 deletions docs/en/developing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ For using VSCode for developement, please check `Developing in WSL <https://code
git clone --recursive https://github.com/espressif/esp-idf.git
cd esp-idf; git checkout v4.4.2; git submodule update --init --recursive;
./install.sh
. ./export.sh
cd ..

.. only:: esp32h2
Expand All @@ -63,6 +64,7 @@ For using VSCode for developement, please check `Developing in WSL <https://code
git clone --recursive https://github.com/espressif/esp-idf.git
cd esp-idf; git checkout 20949d444f; git submodule update --init --recursive;
./install.sh
. ./export.sh
cd ..

Cloning the esp-matter repository takes a while due to a lot of submodules in the upstream connectedhomeip,
Expand Down
20 changes: 0 additions & 20 deletions tools/docker/chip-builds

This file was deleted.

16 changes: 16 additions & 0 deletions tools/docker/matter-builds
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ARG VERSION=latest
FROM connectedhomeip/chip-build-esp32:${VERSION} as build

WORKDIR /opt/espressif
ENV ESP_MATTER_PATH=/opt/espressif/esp-matter

RUN set -x \
&& git clone --depth 1 https://github.com/espressif/esp-matter.git \
&& cd esp-matter \
&& git submodule update --init --depth 1 \
&& ./connectedhomeip/connectedhomeip/scripts/checkout_submodules.py --platform esp32 --shallow \
&& . $IDF_PATH/export.sh \
&& ./install.sh \
&& : # last line

WORKDIR /opt/espressif/esp-matter

0 comments on commit 6e6448f

Please sign in to comment.