Skip to content

Commit

Permalink
Added Dockerfile for from CSA , changed to keep .a files
Browse files Browse the repository at this point in the history
Added action to push docker package
  • Loading branch information
Sarthak-Shaha committed Sep 20, 2024
1 parent 8bec7e7 commit 64c6b38
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: publish
on: [push]
jobs:
publish-efr32-image:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the Simplicity SDK Docker image
run: |
docker build -f Integrations/docker/images/Dockerfile . --tag ghcr.io/siliconlabssoftware/simplicity-sdk:latest
docker run ghcr.io/siliconlabssoftware/simplicity-sdk:latest
docker push ghcr.io/siliconlabssoftware/simplicity-sdk:latest
75 changes: 75 additions & 0 deletions Integrations/docker/images/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@

ARG VERSION=1
FROM ghcr.io/project-chip/chip-build:${VERSION} as build
LABEL org.opencontainers.image.source /~https://github.com/project-chip/connectedhomeip

# Requirements to clone SDKs in temporary container
RUN set -x \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \
git \
git-lfs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/ \
&& : # last line


# Download Simplicity SDK v2024.6.1 (a1a37fa)
RUN wget /~https://github.com/SiliconLabs/simplicity_sdk/releases/download/v2024.6.1-0/sisdk-sdk.zip -O /tmp/simplicity_sdk.zip \
&& unzip /tmp/simplicity_sdk.zip -d /tmp/simplicity_sdk \
&& rm -rf /tmp/simplicity_sdk.zip \
# Deleting files that are not needed to save space
&& rm -rf /tmp/simplicity_sdk/protocol/flex /tmp/simplicity_sdk/protocol/z-wave /tmp/simplicity_sdk/protocol/zigbee /tmp/simplicity_sdk/protocol/wisun \
&& find /tmp/simplicity_sdk/protocol/openthread -name "*efr32mg21*" -delete \
&& : # last line

# Clone WiSeConnect Wi-Fi and Bluetooth Software 2.10.0 (f94b83d)
RUN git clone --depth=1 --single-branch --branch=2.10.0 /~https://github.com/SiliconLabs/wiseconnect-wifi-bt-sdk.git /tmp/wiseconnect-wifi-bt-sdk && \
cd /tmp/wiseconnect-wifi-bt-sdk && \
rm -rf .git \
&& : # last line

# Clone WiSeConnect SDK v3.3.1 (841ea3f)
RUN git clone --depth=1 --single-branch --branch=v3.3.1 /~https://github.com/SiliconLabs/wiseconnect.git /tmp/wifi_sdk && \
cd /tmp/wifi_sdk && \
rm -rf .git \
&& : # last line

# SLC-cli install
# TODO: figure out a way to make this a fixed version. Currently a moving target.
RUN wget https://www.silabs.com/documents/login/software/slc_cli_linux.zip && \
unzip ./slc_cli_linux.zip -d /tmp && \
rm ./slc_cli_linux.zip \
&& : # last line

# Final SDK container for compiling using Silabs SDK
FROM ghcr.io/project-chip/chip-build:${VERSION}

ADD requirements.txt /tmp/requirements.txt

# GNU ARM Embedded toolchain, cross compiler for various platform builds
RUN set -x \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \
gcc-arm-none-eabi \
binutils-arm-none-eabi \
openjdk-17-jdk-headless \
ccache \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/ \
# Install Python Packages
&& pip3 install --break-system-packages -r /tmp/requirements.txt \
&& rm /tmp/requirements.txt \
&& : # last line

# Keep GSDK_ROOT name until rename transition to SISDK is completed
ENV GSDK_ROOT=/opt/silabs/simplicity_sdk/
ENV SISDK_ROOT=/opt/silabs/simplicity_sdk/
ENV WISECONNECT_SDK_ROOT=/opt/silabs/wiseconnect-wifi-bt-sdk/
ENV WIFI_SDK_ROOT=/opt/silabs/wifi_sdk/
ENV PATH="${PATH}:/opt/silabs/slc_cli/"

COPY --from=build /tmp/simplicity_sdk /opt/silabs/simplicity_sdk
COPY --from=build /tmp/wiseconnect-wifi-bt-sdk/ /opt/silabs/wiseconnect-wifi-bt-sdk/
COPY --from=build /tmp/wifi_sdk /opt/silabs/wifi_sdk
COPY --from=build /tmp/slc_cli /opt/silabs/slc_cli
1 change: 1 addition & 0 deletions Integrations/docker/images/build.sh
9 changes: 9 additions & 0 deletions Integrations/docker/images/requirements.txt
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
1 change: 1 addition & 0 deletions Integrations/docker/images/run.sh
1 change: 1 addition & 0 deletions Integrations/docker/images/version
9 changes: 9 additions & 0 deletions requirements.txt
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

0 comments on commit 64c6b38

Please sign in to comment.