diff --git a/docker/Dockerfile.ci_cortexm b/docker/Dockerfile.ci_cortexm index 50062d9dea35b..a6ea27cf41813 100644 --- a/docker/Dockerfile.ci_cortexm +++ b/docker/Dockerfile.ci_cortexm @@ -76,12 +76,15 @@ COPY install/ubuntu_install_sccache.sh /install/ubuntu_install_sccache.sh RUN bash /install/ubuntu_install_sccache.sh ENV PATH /opt/sccache:$PATH -# Zephyr SDK deps +# Zephyr Project COPY install/ubuntu_install_zephyr.sh /install/ubuntu_install_zephyr.sh COPY install/ubuntu_init_zephyr_project.sh /install/ubuntu_init_zephyr_project.sh -COPY install/ubuntu_install_zephyr_sdk.sh /install/ubuntu_install_zephyr_sdk.sh RUN bash /install/ubuntu_install_zephyr.sh ENV ZEPHYR_BASE=/opt/zephyrproject/zephyr + +#Zephyr SDK +COPY install/ubuntu_install_zephyr_sdk.sh /install/ubuntu_install_zephyr_sdk.sh +RUN bash /install/ubuntu_install_zephyr_sdk.sh /opt/zephyr-sdk ENV PATH /opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin:$PATH # NRF diff --git a/docker/Dockerfile.ci_riscv b/docker/Dockerfile.ci_riscv index a640e996c7be9..c115df423fc32 100644 --- a/docker/Dockerfile.ci_riscv +++ b/docker/Dockerfile.ci_riscv @@ -80,13 +80,17 @@ COPY install/ubuntu_install_sccache.sh /install/ubuntu_install_sccache.sh RUN bash /install/ubuntu_install_sccache.sh ENV PATH /opt/sccache:$PATH -# Zephyr SDK deps +# Zephyr Project COPY install/ubuntu_install_zephyr.sh /install/ubuntu_install_zephyr.sh COPY install/ubuntu_init_zephyr_project.sh /install/ubuntu_init_zephyr_project.sh -COPY install/ubuntu_install_zephyr_sdk.sh /install/ubuntu_install_zephyr_sdk.sh RUN bash /install/ubuntu_install_zephyr.sh ENV ZEPHYR_BASE=/opt/zephyrproject/zephyr +#Zephyr SDK +COPY install/ubuntu_install_zephyr_sdk.sh /install/ubuntu_install_zephyr_sdk.sh +RUN bash /install/ubuntu_install_zephyr_sdk.sh /opt/zephyr-sdk +ENV PATH /opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin:$PATH + # Download RISC-V gcc toolchain (linux) COPY install/ubuntu_download_xuantie_gcc_linux.sh /install/ubuntu_download_xuantie_gcc_linux.sh RUN bash /install/ubuntu_download_xuantie_gcc_linux.sh /opt/riscv/riscv64-unknown-linux-gnu diff --git a/docker/install/ubuntu_install_zephyr.sh b/docker/install/ubuntu_install_zephyr.sh index 6eaa5e5aa16c7..75565f749071c 100755 --- a/docker/install/ubuntu_install_zephyr.sh +++ b/docker/install/ubuntu_install_zephyr.sh @@ -38,7 +38,11 @@ sudo apt-get update sudo apt-install-and-clear -y cmake -pip3 install west +# Current Zephyr version is compatible with python3.8. +# We use a different python env for Zephyr to test the +# real world scenario where TVM and Zephyr could be in different +# python environments. +python3.8 -m pip install west # Init ZephyrProject ZEPHYR_PROJECT_PATH=/opt/zephyrproject @@ -58,10 +62,4 @@ chmod -R o+w ${ZEPHYR_PROJECT_PATH} mkdir zephyr/.cache chmod o+rwx zephyr/.cache -pip3 install -r /opt/zephyrproject/zephyr/scripts/requirements.txt - -# the requirements above overwrite junintparser with an older version, but it is not -# used so overwrite it again with the correct version -pip3 install junitparser==2.4.2 - -bash /install/ubuntu_install_zephyr_sdk.sh /opt/zephyr-sdk +python3.8 -m pip install -r /opt/zephyrproject/zephyr/scripts/requirements.txt diff --git a/docker/install/ubuntu_install_zephyr_sdk.sh b/docker/install/ubuntu_install_zephyr_sdk.sh index 228baf732120a..2c1e926e68da8 100755 --- a/docker/install/ubuntu_install_zephyr_sdk.sh +++ b/docker/install/ubuntu_install_zephyr_sdk.sh @@ -43,9 +43,14 @@ INSTALLATION_PATH=$1 shift ZEPHYR_SDK_FILE_SHA=8e3572fbca9f9ba18a4436c00d680af34a85e239f7fe66c7988da85571a0d23d +ZEPHYR_SDK_FILE_NAME=zephyr-sdk-0.15.2_linux-x86_64.tar.gz wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.15.2/zephyr-sdk-0.15.2_linux-x86_64.tar.gz -echo "$ZEPHYR_SDK_FILE_SHA zephyr-sdk-0.15.2_linux-x86_64.tar.gz" | sha256sum --check +echo "$ZEPHYR_SDK_FILE_SHA ${ZEPHYR_SDK_FILE_NAME}" | sha256sum --check -tar xvf zephyr-sdk-0.15.2_linux-x86_64.tar.gz -mv zephyr-sdk-0.15.2 zephyr-sdk -rm zephyr-sdk-0.15.2_linux-x86_64.tar.gz +mkdir ${INSTALLATION_PATH} +tar -xvf ${ZEPHYR_SDK_FILE_NAME} -C "${INSTALLATION_PATH}" --strip-components=1 +rm ${ZEPHYR_SDK_FILE_NAME} + +# Setup SDK +cd ${INSTALLATION_PATH} +./setup.sh -h