Skip to content

Commit

Permalink
Update our workflows to the new latest docker builds as well fix nRF …
Browse files Browse the repository at this point in the history
…builds (project-chip#4657)

* Initial stab

* Updating dev container

* Working around broken nRF Connect build right now

* Fixing build script for cirque

* latest for now

* Update unit_integration_test.yaml

* Update examples-linux-standalone.yaml

* Update examples-qpg6100.yaml

* Update examples-linux-standalone.yaml

* Update examples-qpg6100.yaml

* Restyle build.sh

* Updating to correct cirque

* More relative images fixes

* Fixing name

* Fixing this image

* Updating copyright

* Typo

* Testing

* Testing disable

* google.com

* Last one?
  • Loading branch information
woody-apple authored Feb 4, 2021
1 parent 9071912 commit ac5ec98
Show file tree
Hide file tree
Showing 25 changed files with 197 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dockerfile": "Dockerfile",
"args": {
// "BUILD_VERSION": "$(cat integrations/docker/images/chip-build/version)" // trying to get this to work
"BUILD_VERSION": "0.4.18"
"BUILD_VERSION": "latest"
}
},
"remoteUser": "vscode",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build-android:0.4.18
image: connectedhomeip/chip-build-android:latest
volumes:
- "/tmp/log_output:/tmp/test_logs"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bloat_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build:0.4.18
image: connectedhomeip/chip-build:latest

steps:
- name: Checkout
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ jobs:
type: [main, clang, mbedtls]
env:
BUILD_TYPE: ${{ matrix.type }}
BUILD_VERSION: 0.2.18
BUILD_IMAGE: chip-build-openssl
BUILD_ORG: connectedhomeip

runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build:0.4.18
image: connectedhomeip/chip-build:latest
volumes:
- "/tmp/log_output:/tmp/test_logs"
options:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/examples-efr32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ jobs:
env:
EFR32_BOARD: BRD4161A
BUILD_TYPE: gn_efr32
BUILD_VERSION: 0.2.14

runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build-efr32:0.4.18
image: connectedhomeip/chip-build-efr32:latest
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
- "/tmp/output_binaries:/tmp/output_binaries"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples-esp32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build-esp32:0.4.18
image: connectedhomeip/chip-build-esp32:latest
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
- "/tmp/output_binaries:/tmp/output_binaries"
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/examples-linux-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ jobs:

env:
BUILD_TYPE: gn_linux
BUILD_VERSION: 0.2.14
BUILD_IMAGE: chip-build
BUILD_ORG: connectedhomeip

runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build:0.4.18
image: connectedhomeip/chip-build:latest
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
- "/tmp/output_binaries:/tmp/output_binaries"
Expand All @@ -58,7 +57,7 @@ jobs:
run:
scripts/examples/gn_build_example.sh examples/shell/standalone
out/shell_debug
- name: Build example Standalone All Clusters Server
- name: Build example Standalone All Clusters Server
run:
scripts/examples/gn_build_example.sh examples/all-clusters-app/linux
out/all_clusters_debug chip_bypass_rendezvous=true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples-nrfconnect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build-nrf-platform:0.4.18
image: connectedhomeip/chip-build-nrf-platform:latest
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
- "/tmp/output_binaries:/tmp/output_binaries"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples-qpg6100.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build:0.4.18
image: connectedhomeip/chip-build:latest
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
- "/tmp/output_binaries:/tmp/output_binaries"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qemu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build-esp32-qemu:0.4.18
image: connectedhomeip/chip-build-esp32-qemu:latest
volumes:
- "/tmp/log_output:/tmp/test_logs"

Expand Down
39 changes: 20 additions & 19 deletions .github/workflows/release_artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build-esp32:0.4.18
image: connectedhomeip/chip-build-esp32:latest

steps:
- name: Checkout
Expand All @@ -42,13 +42,13 @@ jobs:

- name: Upload artifact
run: |
scripts/helpers/upload_release_asset.py \
--github-repository project-chip/connectedhomeip \
--github-api-token "${{ secrets.GITHUB_TOKEN }}" \
--release-tag "${{ github.event.inputs.releaseTag }}" \
--bundle-files $BUILD_DIRECTORY/chip-all-clusters-app.flashbundle.txt \
--working-directory $BUILD_DIRECTORY \
--bundle-name esp32-chip-all-clusters-app
scripts/helpers/upload_release_asset.py \
--github-repository project-chip/connectedhomeip \
--github-api-token "${{ secrets.GITHUB_TOKEN }}" \
--release-tag "${{ github.event.inputs.releaseTag }}" \
--bundle-files $BUILD_DIRECTORY/chip-all-clusters-app.flashbundle.txt \
--working-directory $BUILD_DIRECTORY \
--bundle-name esp32-chip-all-clusters-app
efr32:
name: EFR32
Expand All @@ -59,23 +59,24 @@ jobs:
runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build-efr32:0.4.18
image: connectedhomeip/chip-build-efr32:latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
ref: "${{ github.event.inputs.releaseTag }}"
- name: Build example EFR32 Lock App
- name: Build example EFR32 Lock App
run:
scripts/examples/gn_efr32_example.sh examples/lock-app/efr32/ out/lock_app_debug $EFR32_BOARD

scripts/examples/gn_efr32_example.sh examples/lock-app/efr32/
out/lock_app_debug $EFR32_BOARD

- name: Upload artifact
run: |
scripts/helpers/upload_release_asset.py \
--github-repository project-chip/connectedhomeip \
--github-api-token "${{ secrets.GITHUB_TOKEN }}" \
--release-tag "${{ github.event.inputs.releaseTag }}" \
--bundle-files $BUILD_DIRECTORY/lock_app.flashbundle.txt \
--working-directory $BUILD_DIRECTORY \
--bundle-name efr32-$EFR32_BOARD-chip-lock-example
scripts/helpers/upload_release_asset.py \
--github-repository project-chip/connectedhomeip \
--github-api-token "${{ secrets.GITHUB_TOKEN }}" \
--release-tag "${{ github.event.inputs.releaseTag }}" \
--bundle-files $BUILD_DIRECTORY/lock_app.flashbundle.txt \
--working-directory $BUILD_DIRECTORY \
--bundle-name efr32-$EFR32_BOARD-chip-lock-example
15 changes: 7 additions & 8 deletions .github/workflows/unit_integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ jobs:
type: [main, clang, mbedtls]
env:
BUILD_TYPE: ${{ matrix.type }}
BUILD_VERSION: 0.2.18
BUILD_IMAGE: chip-build-openssl
BUILD_ORG: connectedhomeip

runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build:0.4.18
volumes:
- "/tmp/log_output:/tmp/test_logs"
- "/tmp/happy_test_logs:/tmp/happy_test_logs"
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
image: connectedhomeip/chip-build:latest
volumes:
- "/tmp/log_output:/tmp/test_logs"
- "/tmp/happy_test_logs:/tmp/happy_test_logs"
options:
--privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"

steps:
- name: Checkout
Expand Down Expand Up @@ -78,8 +78,7 @@ jobs:
if: ${{ always() }}
with:
name:
happy_log-${{
steps.outsuffix.outputs.value }}-${{ matrix.type }}
happy_log-${{ steps.outsuffix.outputs.value }}-${{ matrix.type }}
path: /tmp/happy_test_logs/
# TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227
# TODO https://github.com/project-chip/connectedhomeip/issues/1512
Expand Down
4 changes: 2 additions & 2 deletions examples/bridge-app/linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021 Project CHIP Authors
# Copyright (c) 2020-2021 Project CHIP Authors
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,7 +15,7 @@
# limitations under the License.
#

from chip-cirque-device-base
FROM connectedhomeip/chip-cirque-device-base:latest

COPY out/debug/chip-tool-server /usr/bin/
COPY entrypoint.sh /
Expand Down
4 changes: 2 additions & 2 deletions examples/chip-tool/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020 Project CHIP Authors
# Copyright (c) 2020-2021 Project CHIP Authors
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,7 +15,7 @@
# limitations under the License.
#

from chip-cirque-device-base
FROM connectedhomeip/chip-cirque-device-base:latest

COPY out/debug/chip-tool /usr/bin/
COPY entrypoint.sh /
Expand Down
4 changes: 2 additions & 2 deletions examples/lighting-app/linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020 Project CHIP Authors
# Copyright (c) 2020-2021 Project CHIP Authors
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,7 +15,7 @@
# limitations under the License.
#

from chip-cirque-device-base
FROM connectedhomeip/chip-cirque-device-base:latest

COPY out/debug/chip-tool-server /usr/bin/
COPY entrypoint.sh /
Expand Down
4 changes: 2 additions & 2 deletions integrations/docker/images/chip-build-nrf-platform/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ARG NCS_REVISION=v1.4.0
# Tools for flashing software on Nordic devices, and accessing device logs
RUN set -x \
&& (mkdir -p /opt/NordicSemiconductor/nRF5_tools && cd /opt/NordicSemiconductor/nRF5_tools \
&& curl https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF-command-line-tools/sw/Versions-10-x-x/10-7-0/nRFCommandLineTools1070Linuxamd64tar.gz \
&& curl https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF-command-line-tools/sw/Versions-10-x-x/10-7-0/nRFCommandLineTools1070Linuxamd64.tar.gz \
| tar zxvf - \
&& dpkg -i --force-depends JLink_Linux_*.deb \
&& dpkg -i --force-depends nRF-Command-Line-Tools_*.deb \
Expand All @@ -35,7 +35,7 @@ ENV ARM_GCC_INSTALL_ROOT=/opt/ARM-software/gcc-arm-none-eabi-9-2019-q4-major/bin
# ==================================================
RUN set -x \
# Device Tree Compiler 1.4.7
&& curl -o /tmp/dtc.deb http://mirrors.edge.kernel.org/ubuntu/pool/main/d/device-tree-compiler/device-tree-compiler_1.4.7-3ubuntu2_amd64.deb \
&& curl -o /tmp/dtc.deb http://archive.ubuntu.com/ubuntu/pool/main/d/device-tree-compiler/device-tree-compiler_1.4.5-3_amd64.deb \
&& dpkg -i /tmp/dtc.deb \
&& (mkdir -p /opt/nrfconnect/sdk-nrf && cd /opt/nrfconnect/sdk-nrf \
&& pip3 install --no-cache-dir setuptools wheel cmake west \
Expand Down
68 changes: 66 additions & 2 deletions integrations/docker/images/chip-cirque-device-base/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,58 @@
# limitations under the License.
#

set +x
# build.sh - utility for building (and optionally) tagging and pushing
# the a Docker image
#
# This script expects to find a Dockerfile next to $0, so symlink
# in an image name directory is the expected use case.

me=$(basename "$0")
cd "$(dirname "$0")"

ORG=${DOCKER_BUILD_ORG:-connectedhomeip}

# directory name is
IMAGE=${DOCKER_BUILD_IMAGE:-$(basename "$(pwd)")}

# version
VERSION=${DOCKER_BUILD_VERSION:-$(cat version)}

[[ ${*/--help//} != "${*}" ]] && {
set +x
echo "Usage: $me <OPTIONS>
Build and (optionally tag as latest, push) a docker image from Dockerfile in CWD
Options:
--no-cache passed as a docker build argument
--latest update latest to the current built version (\"$VERSION\")
--push push image(s) to docker.io (requires docker login for \"$ORG\")
--help get this message
"
exit 0
}

die() {
echo "$me: *** ERROR: $*"
exit 1
}

set -ex

[[ -n $VERSION ]] || die "version cannot be empty"

# go find and build any CHIP images this image is "FROM"
awk -F/ '/^FROM connectedhomeip/ {print $2}' Dockerfile | while read -r dep; do
dep=${dep%:*}
(cd "../$dep" && ./build.sh "$@")
done

BUILD_ARGS=()
if [[ ${*/--no-cache//} != "${*}" ]]; then
BUILD_ARGS+=(--no-cache)
fi

SOURCE=${BASH_SOURCE[0]}
SOURCE_DIR=$(cd "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)
Expand All @@ -27,4 +78,17 @@ REPO_DIR="$SOURCE_DIR/../../../../"
OT_BR_POSIX=$REPO_DIR/third_party/ot-br-posix/repo
OT_BR_POSIX_CHECKOUT=$(cd "$REPO_DIR" && git rev-parse :third_party/ot-br-posix/repo)

docker build -t chip-cirque-device-base -f "$SOURCE_DIR"/Dockerfile --build-arg OT_BR_POSIX_CHECKOUT="$OT_BR_POSIX_CHECKOUT" "$SOURCE_DIR"
docker build -t "$ORG/$IMAGE:$VERSION" -f "$SOURCE_DIR/Dockerfile" "${BUILD_ARGS[@]}" --build-arg OT_BR_POSIX_CHECKOUT="$OT_BR_POSIX_CHECKOUT" "$SOURCE_DIR"

[[ ${*/--latest//} != "${*}" ]] && {
docker tag "$ORG"/"$IMAGE":"$VERSION" "$ORG"/"$IMAGE":latest
}

[[ ${*/--push//} != "${*}" ]] && {
docker push "$ORG"/"$IMAGE":"$VERSION"
[[ ${*/--latest//} != "${*}" ]] && {
docker push "$ORG"/"$IMAGE":latest
}
}

exit 0
2 changes: 1 addition & 1 deletion integrations/docker/images/chip-cirque-device-base/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1
0.4.19
19 changes: 18 additions & 1 deletion src/app/tests/integration/Dockerfile.initiator
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
from chip-cirque-device-base
#
# Copyright (c) 2020-2021 Project CHIP Authors
# All rights reserved.
#
# 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 connectedhomeip/chip-cirque-device-base:latest

COPY out/chip-im-initiator /usr/bin/
COPY entrypoint.sh /
Expand Down
Loading

0 comments on commit ac5ec98

Please sign in to comment.