Skip to content

Commit

Permalink
ZAP in Docker with reproducible builds (#17434)
Browse files Browse the repository at this point in the history
* Squashed commit of the following:

commit bd52637
Author: Austin Bozowski <[email protected]>
Date:   Fri Apr 15 18:37:47 2022 -0700

    Final clean

commit db33367
Author: Austin Bozowski <[email protected]>
Date:   Fri Apr 15 18:00:57 2022 -0700

    README and style

commit f3e81c9
Author: Austin Bozowski <[email protected]>
Date:   Fri Apr 15 17:19:36 2022 -0700

    Style

commit febdef6
Author: Austin Bozowski <[email protected]>
Date:   Fri Apr 15 16:51:08 2022 -0700

    Fix small err

commit a77fbe1
Author: Austin Bozowski <[email protected]>
Date:   Fri Apr 15 16:45:00 2022 -0700

    Commit to go back from test; add helper messages

commit 4947867
Author: Austin Bozowski <[email protected]>
Date:   Fri Apr 15 16:31:01 2022 -0700

    Clean; create commit for test:

commit 21eff2e
Author: Austin Bozowski <[email protected]>
Date:   Fri Apr 15 15:18:12 2022 -0700

    Clean

commit 95866de
Author: Austin Bozowski <[email protected]>
Date:   Fri Apr 15 13:58:21 2022 -0700

    Place zap hash in dockerfile and verify origin

    Remove logic around zap from build.sh
    Create generic method to set up build context in build.sh
    Add script to create build context
    Add logic in dockerfile to ensure origin stays in sync

commit 0bfc8a1
Author: Austin Bozowski <[email protected]>
Date:   Thu Apr 14 16:24:08 2022 -0700

    Adding a readme just so this branch is clear

commit 10818f6
Author: Austin Bozowski <[email protected]>
Date:   Thu Apr 14 08:36:28 2022 -0700

    Fix error from replace text, remove zapinfo clean which can fail

commit f7a5435
Author: Austin Bozowski <[email protected]>
Date:   Thu Apr 14 08:00:37 2022 -0700

    Zap in docker e2e

commit 6ba3306
Author: Austin Bozowski <[email protected]>
Date:   Wed Apr 13 18:44:59 2022 -0700

    Build from hashes instead of dirs

commit c2f5f4f
Author: Austin Bozowski <[email protected]>
Date:   Wed Apr 13 15:43:02 2022 -0700

    Build zap in images from local sources; log SHAs

* Remove test artifacts for PR

* Spelling and a space

* Remove checks around remote. Update README.

* Remove missed delete zapverify.sh

* Restyle README.md

Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Oct 31, 2023
1 parent 639f8ee commit 4795139
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM connectedhomeip/chip-build:${VERSION} as build
RUN set -x \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \
git=1:2.25.1-1ubuntu3.2 \
git=1:2.25.1-1ubuntu3.3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/ \
&& : # last line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN set -x \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \
ninja-build=1.10.0-1build1 \
git=1:2.25.1-1ubuntu3.2 \
git=1:2.25.1-1ubuntu3.3 \
libgcrypt20-dev=1.8.5-5ubuntu1.1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/ \
Expand Down
2 changes: 1 addition & 1 deletion integrations/docker/images/chip-build-esp32/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM connectedhomeip/chip-build:${VERSION} as build
RUN set -x \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \
git=1:2.25.1-1ubuntu3.2 \
git=1:2.25.1-1ubuntu3.3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/ \
&& : # last line
Expand Down
3 changes: 3 additions & 0 deletions integrations/docker/images/chip-build-vscode/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ FROM connectedhomeip/chip-build-ameba:${VERSION} AS ameba
FROM connectedhomeip/chip-build-k32w:${VERSION} AS k32w
FROM connectedhomeip/chip-build-imx:${VERSION} AS imx
FROM connectedhomeip/chip-build-ti:${VERSION} AS ti
FROM connectedhomeip/chip-build-zap:${VERSION} AS zap
FROM connectedhomeip/chip-build:${VERSION}

# qemu-src copied over because qemu directory contains symlinks to the src
Expand Down Expand Up @@ -46,6 +47,8 @@ COPY --from=imx /opt/fsl-imx-xwayland /opt/fsl-imx-xwayland

COPY --from=ti /opt/ti/sysconfig_1.11.0 /opt/ti/sysconfig_1.11.0

COPY --from=zap /opt/zap /opt/zap

# Android license file "acceping" is done by writing license hashes
# into the 'licenses' subfolder. This allows any user (in particular
# 'vscode' to accept licenses)
Expand Down
33 changes: 10 additions & 23 deletions integrations/docker/images/chip-build-zap/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
FROM alpine:3.14
ARG VERSION=latest
FROM connectedhomeip/chip-build:${VERSION}

RUN apk add --no-cache \
nodejs=14.19.0-r0 \
openjdk11=11.0.14_p9-r0 \
npm=7.17.0-r0 \
python3=3.9.5-r2 \
pixman-dev=0.40.0-r2 \
cairo-dev=1.16.0-r3 \
pango-dev=1.48.5-r0 \
make=4.3-r0 \
g++=10.3.1_git20210424-r2 \
libjpeg-turbo-dev=2.1.0-r0 \
giflib-dev=5.2.1-r0 \
git=2.32.0-r0 \
clang-dev=11.1.0-r1 \
py3-pip=20.3.4-r1
ENV ZAP_COMMIT=7ab717d08dfe9b0ba9de907fc7c6eb6549c86bf7

# Generator dependencies
RUN pip3 install --no-cache-dir \
click==8.0.3 \
coloredlogs==15.0.1 \
jinja2==3.0.3 \
lark==1.0.0 \
stringcase==1.2.0
ENV ZAP_ORIGIN=https://github.com/project-chip/zap.git

WORKDIR /opt
RUN git clone $ZAP_ORIGIN
WORKDIR ./zap
RUN git checkout $ZAP_COMMIT
RUN npm ci
8 changes: 8 additions & 0 deletions integrations/docker/images/chip-build-zap/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ZAP

- This Dockerfile builds https://github.com/project-chip/zap.git, which gets
copied into `chip-build-vscode`
- ZAP is also a submodule in `third_party/zap/repo`. You can check the commit
of ZAP used in the submodule by running
`git ls-tree master third_party/zap/repo | awk '{print $3}'` from the
repository root.
9 changes: 5 additions & 4 deletions integrations/docker/images/chip-build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,14 @@ RUN set -x \

# NodeJS: install a newer version than what apt-get would read
# This installs the latest LTS version of nodejs
ENV CHIP_NODE_VERSION=v16.13.2
RUN set -x \
&& mkdir node_js \
&& cd node_js \
&& wget https://nodejs.org/dist/v12.19.0/node-v12.19.0-linux-x64.tar.xz \
&& tar xfvJ node-v12.19.0-linux-x64.tar.xz \
&& mv node-v12.19.0-linux-x64 /opt/ \
&& ln -s /opt/node-v12.19.0-linux-x64 /opt/node \
&& wget https://nodejs.org/dist/$CHIP_NODE_VERSION/node-$CHIP_NODE_VERSION-linux-x64.tar.xz \
&& tar xfvJ node-$CHIP_NODE_VERSION-linux-x64.tar.xz \
&& mv node-$CHIP_NODE_VERSION-linux-x64 /opt/ \
&& ln -s /opt/node-$CHIP_NODE_VERSION-linux-x64 /opt/node \
&& ln -s /opt/node/bin/* /usr/bin \
&& cd .. \
&& rm -rf node_js \
Expand Down

0 comments on commit 4795139

Please sign in to comment.