Skip to content

Commit

Permalink
[devcontainer] Version bump and enhanced UX. (#35403)
Browse files Browse the repository at this point in the history
* Version bump, remove unnecessary libs

* Allow environment location modification

* Add apt installs to base image

* Speed-up image building

* Remove unneeded apt installs

* Expose and document important env variable

* Add all pigweed environments to .gitignore

* Revert and reformat comment

* Compatibility fix
  • Loading branch information
XToripuru authored Sep 10, 2024
1 parent ecf66e6 commit 60d6c6b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 20 deletions.
38 changes: 22 additions & 16 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,19 @@ ARG USER_UID=1000
ARG USER_GID=$USER_UID
ENV LANG en_US.utf8

# these are installed for terminal/dev convenience. If more tooling for build is required, please
# add them to chip-build (in integrations/docker/images/chip-build)

# These are installed for terminal/dev convenience. If more tooling for build is required, please
# add them to chip-build (in integrations/docker/images/chip-build).
RUN apt-get update \
&& apt-get install -y locales \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \
&& apt-get -fy install git vim emacs sudo \
&& apt-get -fy install vim emacs sudo \
apt-utils dialog zsh \
iproute2 procps lsb-release \
lsb-release \
bash-completion \
build-essential cmake cppcheck valgrind \
wget curl telnet \
valgrind \
docker.io \
iputils-ping net-tools \
libncurses5 \
libncursesw5 \
libpython2.7 \
iputils-ping \
&& :

RUN groupadd -g $USER_GID $USERNAME \
Expand All @@ -55,13 +52,22 @@ RUN curl https://raw.githubusercontent.com/restyled-io/restyler/master/bin/resty
RUN mkdir -p /opt/sdk/sdks/ \
&& chown -R $USERNAME:$USERNAME \
/opt/sdk/sdks/ `# NXP uses a patch_sdk script to change SDK files` \
/opt/NordicSemiconductor/nrfconnect/ `# $USERNAME needs to own west configuration to build nRF Connect examples` \
$IDF_PATH `# $USERNAME needs to own the esp-idf and tools for the examples to build` \
$ANDROID_HOME \
$IDF_TOOLS_PATH \
&& find $AMEBA_PATH -name "inc_lp" -print0 | xargs -0 chown -R $USERNAME:$USERNAME \
&& find $AMEBA_PATH -name "inc_hp" -print0 | xargs -0 chown -R $USERNAME:$USERNAME \
&& find $AMEBA_PATH -name "project_lp" -print0 | xargs -0 chown -R $USERNAME:$USERNAME \
&& find $AMEBA_PATH -name "project_hp" -print0 | xargs -0 chown -R $USERNAME:$USERNAME \
&& chmod -R +x \
$ANDROID_HOME/tools/bin `# sdkmanager for accepting licenses`\
&& chmod -R +w \
$IDF_TOOLS_PATH \
$SYSROOT_AARCH64 `# allow read/write access to header and libraries` \
$ANDROID_HOME `# allow licenses to be accepted` \
$AMEBA_PATH `# AmebaD requires access to change build_info.h` \
$IMX_SDK_ROOT \
&& find $AMEBA_PATH -name "inc_lp" -print0 | xargs -0 chmod -R +w \
&& find $AMEBA_PATH -name "inc_hp" -print0 | xargs -0 chmod -R +w \
&& find $AMEBA_PATH -name "project_lp" -print0 | xargs -0 chmod -R +w \
&& find $AMEBA_PATH -name "project_hp" -print0 | xargs -0 chmod -R +w \
# Safe directory is preffered over chown.
&& git config --global --add safe.directory "*" \
&& :

# Fix Tizen SDK paths for new user
Expand Down
5 changes: 4 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
],
"initializeCommand": "bash .devcontainer/build.sh --tag matter-dev-environment:local --version 22",
"initializeCommand": "bash .devcontainer/build.sh --tag matter-dev-environment:local --version 74",
"image": "matter-dev-environment:local",
"remoteUser": "vscode",
"containerEnv": {
"PW_ENVIRONMENT_ROOT": "${containerWorkspaceFolder}/.environment-vscode"
},
"customizations": {
"vscode": {
// Add the IDs of extensions you want installed when the container is created in the array below.
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ out/
/src/darwin/Framework/build/

# Pigweed Environment
.environment/
.environment*/
build_overrides/pigweed_environment.gni

# Temporary Directories
Expand Down Expand Up @@ -84,4 +84,3 @@ examples/*/esp32/dependencies.lock

# jupyter temporary files
.ipynb_checkpoints

Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ ENV NXP_K32W0_SDK_ROOT=/opt/k32w/core
ENV NXP_K32W1_SDK_ROOT=/opt/k32w/k32w1
ENV NXP_SDK_ROOT=/opt/nxp-sdk/rw61x
ENV OPENOCD_PATH=/opt/openocd/
ENV PW_ENVIRONMENT_ROOT=/home/vscode/pigweed/env
ENV QEMU_ESP32=/opt/espressif/qemu/qemu-system-xtensa
ENV QEMU_ESP32_DIR=/opt/espressif/qemu
ENV SYSROOT_AARCH64=/opt/ubuntu-22.04.1-aarch64-sysroot
Expand All @@ -144,6 +143,10 @@ ENV ZEPHYR_NXP_BASE=/opt/nxp-zephyr/zephyrproject/zephyr
ENV ZEPHYR_NXP_SDK_INSTALL_DIR=/opt/nxp-zephyr/zephyr-sdk-0.16.5
ENV NXP_UPDATE_SDK_SCRIPT_DOCKER=/opt/nxp/nxp_matter_support/scripts/update_nxp_sdk.py

# Places bootstrap files there instead of the default one which is `.environment`.
# NOTE: This directory is NOT persistent.
ENV PW_ENVIRONMENT_ROOT=/home/vscode/pigweed/env

ENV TIZEN_VERSION 7.0
ENV TIZEN_SDK_ROOT /opt/tizen-sdk
ENV TIZEN_SDK_TOOLCHAIN $TIZEN_SDK_ROOT/tools/arm-linux-gnueabi-gcc-9.2
Expand Down

0 comments on commit 60d6c6b

Please sign in to comment.