guberti commented on code in PR #11741: URL: https://github.com/apache/tvm/pull/11741#discussion_r898611903
########## apps/microtvm/reference-vm/base_box_setup_common.sh: ########## @@ -0,0 +1,66 @@ +#!/bin/bash -e +# 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 -x + +# Fix network DNS issue +sudo sed -i 's/DNSSEC=yes/DNSSEC=no/' /etc/systemd/resolved.conf +sudo systemctl restart systemd-resolved + +sudo apt update +sudo apt install -y build-essential +sudo apt-get --purge remove modemmanager # required to access serial ports. + +# Core +sudo ~/ubuntu_install_core.sh +rm -f ~/ubuntu_install_core.sh + +sudo apt install -y --no-install-recommends git \ + gperf ccache dfu-util device-tree-compiler xz-utils file \ + gcc gcc-multilib g++-multilib libsdl2-dev + +# Cmake +wget --no-verbose https://apt.kitware.com/keys/kitware-archive-latest.asc +sudo apt-key add kitware-archive-latest.asc +sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' +sudo apt update +sudo apt install -y --no-install-recommends \ + cmake=3.22.2-0kitware1ubuntu18.04.1 cmake-data=3.22.2-0kitware1ubuntu18.04.1 \ + +# Python +sudo ~/ubuntu_install_python.sh +rm -f ~/ubuntu_install_python.sh Review Comment: Are these scripts write protected? Do we need the `-f` flag either? ########## apps/microtvm/reference-vm/arduino/base-box/base_box_setup.sh: ########## @@ -26,42 +26,19 @@ if [ -e "$HOME/skip_zeroing_disk" ]; then skip_zeroing_disk=1 fi -sudo apt update -sudo apt install -y build-essential -sudo apt-get --purge remove modemmanager # required to access serial ports. +# Install common configs +~/base_box_setup_common.sh +rm -rf ~/base_box_setup_common.sh -sudo apt install -y --no-install-recommends git \ - cmake cmake-data \ - ninja-build gperf ccache dfu-util device-tree-compiler wget \ - python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \ - make gcc gcc-multilib g++-multilib libsdl2-dev - -OLD_HOSTNAME=$(hostname) -sudo hostnamectl set-hostname microtvm -sudo sed -i.bak "s/${OLD_HOSTNAME}/microtvm.localdomain/g" /etc/hosts - -# Poetry deps -sudo apt install -y python3-venv - -# TVM deps -sudo apt install -y llvm - -# ONNX deps -sudo apt install -y protobuf-compiler libprotoc-dev +# Poetry +sed -i "/^# If not running interactively,/ i source \$HOME/.poetry/env" ~/.bashrc Review Comment: Can we just add the line to the top of the file then, instead of relying on the exact wording of the comment? Say, ```bash sed -i "1i source \$HOME/.poetry/env" ~/.bashrc ``` May be out of scope for this PR, though. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
