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

[Docker]Refactor timezone script and NRF installation #13342

Merged
merged 3 commits into from
Nov 10, 2022
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
1 change: 1 addition & 0 deletions apps/microtvm/reference-vm/base-box-tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"docker/install/ubuntu_init_zephyr_project.sh",
"docker/install/ubuntu_install_zephyr_sdk.sh",
"docker/install/ubuntu_install_cmsis.sh",
"docker/install/ubuntu_install_nrfjprog.sh",
]

PACKER_FILE_NAME = "packer.json"
Expand Down
18 changes: 2 additions & 16 deletions apps/microtvm/reference-vm/base-box/base_box_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,8 @@ sed -i "/^# If not running interactively,/ i export ZEPHYR_BASE=$HOME/zephyr/zep
sed -i "/^# If not running interactively,/ i\\ " ~/.bashrc

# nrfjprog
NRF_COMMANDLINE_TOOLS_FILE=nRFCommandLineToolsLinuxamd64.tar.gz
NRF_COMMANDLINE_TOOLS_URL=https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF-command-line-tools/sw/Versions-10-x-x/10-12-1/nRFCommandLineTools10121Linuxamd64.tar.gz
NRF_COMMANDLINE_TOOLS_INSTALLER=nRF-Command-Line-Tools_10_12_1_Linux-amd64.deb
JLINK_LINUX_INSTALLER=JLink_Linux_V688a_x86_64.deb

cd ~
mkdir -p nrfjprog
wget --no-verbose -O $NRF_COMMANDLINE_TOOLS_FILE $NRF_COMMANDLINE_TOOLS_URL
cd nrfjprog
tar -xzvf "../${NRF_COMMANDLINE_TOOLS_FILE}"
sudo apt install -y "./${JLINK_LINUX_INSTALLER}"
sudo apt install -y "./${NRF_COMMANDLINE_TOOLS_INSTALLER}"
source ~/.profile
nrfjprog --help
cd ..
rm -rf nrfjprog "${NRF_COMMANDLINE_TOOLS_FILE}"
sudo ~/ubuntu_install_nrfjprog.sh
rm -f ~/ubuntu_install_nrfjprog.sh

# Zephyr
pip3 install --user -U west
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.ci_arm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ RUN apt-get update --fix-missing

RUN apt-install-and-clear -y ca-certificates gnupg2

COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh
RUN bash /install/ubuntu_setup_tz.sh

COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
RUN bash /install/ubuntu_install_core.sh

Expand Down
7 changes: 7 additions & 0 deletions docker/Dockerfile.ci_cortexm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear

RUN apt-get update --fix-missing

COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh
RUN bash /install/ubuntu_setup_tz.sh

COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
RUN bash /install/ubuntu_install_core.sh

Expand Down Expand Up @@ -81,6 +84,10 @@ RUN bash /install/ubuntu_install_zephyr.sh
ENV ZEPHYR_BASE=/opt/zephyrproject/zephyr
ENV PATH /opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin:$PATH

# NRF
COPY install/ubuntu_install_nrfjprog.sh /install/ubuntu_install_nrfjprog.sh
RUN bash /install/ubuntu_install_nrfjprog.sh

# FreeRTOS deps
COPY install/ubuntu_install_freertos.sh /install/ubuntu_install_freertos.sh
RUN bash /install/ubuntu_install_freertos.sh
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.ci_cpu
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear

RUN apt-get update --fix-missing

COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh
RUN bash /install/ubuntu_setup_tz.sh

COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
RUN bash /install/ubuntu_install_core.sh

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.ci_gpu
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/
RUN rm -f /etc/apt/sources.list.d/nvidia-ml.list && apt-get clean
RUN apt-get update --fix-missing

COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh
RUN bash /install/ubuntu_setup_tz.sh

COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
RUN bash /install/ubuntu_install_core.sh

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.ci_hexagon
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ RUN apt-get update --fix-missing

RUN apt-install-and-clear -y ca-certificates gnupg2 libxml2-dev

COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh
RUN bash /install/ubuntu_setup_tz.sh

COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
RUN bash /install/ubuntu_install_core.sh

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.ci_i386
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ RUN apt-get update --fix-missing

RUN apt-install-and-clear -y ca-certificates

COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh
RUN bash /install/ubuntu_setup_tz.sh

COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
RUN bash /install/ubuntu_install_core.sh

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.ci_minimal
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear

RUN apt-get update --fix-missing

COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh
RUN bash /install/ubuntu_setup_tz.sh

COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
RUN bash /install/ubuntu_install_core.sh

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.ci_riscv
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear

RUN apt-get update --fix-missing

COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh
RUN bash /install/ubuntu_setup_tz.sh

COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
RUN bash /install/ubuntu_install_core.sh

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.ci_wasm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear

RUN apt-get update --fix-missing

COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh
RUN bash /install/ubuntu_setup_tz.sh

COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
RUN bash /install/ubuntu_install_core.sh

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.demo_android
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear

RUN apt-get update --fix-missing

COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh
RUN bash /install/ubuntu_setup_tz.sh

COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
RUN bash /install/ubuntu_install_core.sh

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.demo_rocm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ FROM ubuntu:18.04

COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear

COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh
RUN bash /install/ubuntu_setup_tz.sh

COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
RUN bash /install/ubuntu_install_core.sh

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.demo_vitis_ai
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear

RUN apt-get update --fix-missing

COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh
RUN bash /install/ubuntu_setup_tz.sh

COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
RUN bash /install/ubuntu_install_core.sh

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.docs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear

RUN apt-get update --fix-missing

COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh
RUN bash /install/ubuntu_setup_tz.sh

COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
RUN bash /install/ubuntu_install_core.sh

Expand Down
5 changes: 0 additions & 5 deletions docker/install/ubuntu_install_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ set -u
set -x
set -o pipefail

export DEBIAN_FRONTEND=noninteractive
export TZ=Etc/UTC
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
echo $TZ > /etc/timezone

# install libraries for building c++ core on ubuntu
apt-get update && apt-install-and-clear -y --no-install-recommends \
apt-transport-https \
Expand Down
39 changes: 39 additions & 0 deletions docker/install/ubuntu_install_nrfjprog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

set -e
set -u
set -o pipefail
set -x

NRF_COMMANDLINE_TOOLS_FILE=nRFCommandLineToolsLinuxamd64.tar.gz
NRF_COMMANDLINE_TOOLS_URL=https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF-command-line-tools/sw/Versions-10-x-x/10-12-1/nRFCommandLineTools10121Linuxamd64.tar.gz
NRF_COMMANDLINE_TOOLS_INSTALLER=nRF-Command-Line-Tools_10_12_1_Linux-amd64.deb
JLINK_LINUX_INSTALLER=JLink_Linux_V688a_x86_64.deb

cd ~
mkdir -p nrfjprog
wget --no-verbose -O $NRF_COMMANDLINE_TOOLS_FILE $NRF_COMMANDLINE_TOOLS_URL

cd nrfjprog
tar -xzvf "../${NRF_COMMANDLINE_TOOLS_FILE}"
apt-install-and-clear -y "./${JLINK_LINUX_INSTALLER}"
apt-install-and-clear -y "./${NRF_COMMANDLINE_TOOLS_INSTALLER}"

cd ..
rm -rf nrfjprog "${NRF_COMMANDLINE_TOOLS_FILE}"
25 changes: 25 additions & 0 deletions docker/install/ubuntu_setup_tz.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

set -e
set -u
set -o pipefail

export TZ=Etc/UTC
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
echo $TZ > /etc/timezone