Skip to content
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

[cirque] Download chip-cirque-device-base from docker hub when available #4940

Merged
merged 4 commits into from
Feb 22, 2021
Merged
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
4 changes: 3 additions & 1 deletion .github/workflows/cirque.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ jobs:
submodules: true
- name: Bootstrap
run: |
integrations/docker/images/chip-build-cirque/run.sh scripts/tests/cirque_tests.sh bootstrap
integrations/docker/images/chip-build-cirque/run.sh \
--env GITHUB_ACTION_RUN=1 \
-- scripts/tests/cirque_tests.sh bootstrap
- name: Artifact suffix
id: outsuffix
uses: haya14busa/action-cond@v1.0.0
Expand Down
21 changes: 17 additions & 4 deletions integrations/docker/images/chip-cirque-device-base/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ VERSION=${DOCKER_BUILD_VERSION:-$(cat version)}
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
--try-download try to download latest image from dockerhub and skip whole
build procedure if the expected image version is downloaded.
--no-cache passed as a docker build argument
--latest update latest to the current built (or downloaded) version (\"$VERSION\")
--push push image(s) to docker.io (requires docker login for \"$ORG\")
--help get this message

"
exit 0
Expand All @@ -58,6 +60,17 @@ set -ex

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

if [[ ${*/--try-download//} != "${*}" ]]; then
docker pull "$ORG"/"$IMAGE":"$VERSION"
if [[ $? -eq 0 ]]; then
# tag it as latest for this version, note: this should only be used on CI
[[ ${*/--latest//} != "${*}" ]] && {
docker tag "$ORG"/"$IMAGE":"$VERSION" "$ORG"/"$IMAGE":latest
}
exit 0
fi
fi

# 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%:*}
Expand Down
8 changes: 7 additions & 1 deletion scripts/tests/cirque_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ function cirquetest_bootstrap() {
cd "$REPO_DIR"/third_party/cirque/repo
pip3 install pycodestyle==2.5.0 wheel
make NO_GRPC=1 install -j
"$REPO_DIR"/integrations/docker/images/chip-cirque-device-base/build.sh

if [[ "x$GITHUB_ACTION_RUN" = "x1" ]]; then
"$REPO_DIR"/integrations/docker/images/chip-cirque-device-base/build.sh --try-download --latest
else
"$REPO_DIR"/integrations/docker/images/chip-cirque-device-base/build.sh --try-download
fi

__cirquetest_build_ot
pip3 install -r requirements_nogrpc.txt

Expand Down