You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/08/13 23:52:11 UTC

[GitHub] [tvm] guberti opened a new pull request #8748: Add Arduino RVM

guberti opened a new pull request #8748:
URL: https://github.com/apache/tvm/pull/8748


   Builds on top of #8708. Currently a lot of the code in Arduino and Zephyr RVMs is redundant - we should decide if that can be improved. Not yet ready for review.
   
   @mehrdadh 


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] guberti commented on pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
guberti commented on pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#issuecomment-904150262


   @mehrdadh PR has been rebased, and is now ready for review.


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] mehrdadh commented on pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#issuecomment-906251103


   cc @leandron for review. 


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] mehrdadh commented on a change in pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on a change in pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#discussion_r695677385



##########
File path: apps/microtvm/reference-vm/base-box-tool.py
##########
@@ -439,26 +473,27 @@ def parse_args():
         "--provider",
         choices=ALL_PROVIDERS,
         action="append",
-        help="Name of the provider or providers to act on; if not specified, act on all.",
+        required=True,
+        help="Name of the provider or providers to act on",
     )
 
-    parser.add_argument(
-        "platform",
-        help="Name of the platform VM to act on. Must be a sub-directory of this directory.",
-    )
+    # "test" has special options for different platforms, and "build", "release" might
+    # in the future, so we'll add the platform argument to each one individually.
+    platform_help_str = "Electronics platform to use (e.g. Arduino, Zephyr)"

Review comment:
       I think just `platform` makes more sense for Arduino/Zephyr. We can change `microtvm-platform` to `microtvm-target`. wdyt?




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] guberti commented on a change in pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
guberti commented on a change in pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#discussion_r696870064



##########
File path: apps/microtvm/reference-vm/base-box-tool.py
##########
@@ -494,7 +534,10 @@ def parse_args():
     parser_release.add_argument(
         "--platform-version",
         required=True,
-        help="Platform version to release, in the form 'x.y'.",
+        help=(
+            "For Zephyr, the platform version to release, in the form 'x.y'. "

Review comment:
       We need the space at the end, because Python will concatenate the two strings into one at compile time. Otherwise, the help message would be `"...in the form 'x.y'.For Arduino..."`.




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] guberti commented on a change in pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
guberti commented on a change in pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#discussion_r695902185



##########
File path: apps/microtvm/reference-vm/base-box-tool.py
##########
@@ -439,26 +473,27 @@ def parse_args():
         "--provider",
         choices=ALL_PROVIDERS,
         action="append",
-        help="Name of the provider or providers to act on; if not specified, act on all.",
+        required=True,
+        help="Name of the provider or providers to act on",
     )
 
-    parser.add_argument(
-        "platform",
-        help="Name of the platform VM to act on. Must be a sub-directory of this directory.",
-    )
+    # "test" has special options for different platforms, and "build", "release" might
+    # in the future, so we'll add the platform argument to each one individually.
+    platform_help_str = "Electronics platform to use (e.g. Arduino, Zephyr)"

Review comment:
       I like the idea of renaming `microtvm-platform` to `microtvm-device`. This will be a decently large refactor, though, so I think it's out of the scope of this PR.




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] leandron commented on a change in pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
leandron commented on a change in pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#discussion_r696709817



##########
File path: apps/microtvm/reference-vm/arduino/README.md
##########
@@ -0,0 +1,27 @@
+<!--- 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. -->
+
+# microTVM Arduino Reference Virtual Machine
+
+This directory contains setup files for Arduino virtual machine used for testing microTVM platforms
+that are supported by [Arduino](https://www.arduino.cc/).
+
+## VM Information for Developers
+Arduino VM is published under [tlcpack](https://app.vagrantup.com/tlcpack).
+Here is a list of different release versions and their tools.
+

Review comment:
       Can you add more information here about the supported/tested boards that are covered by this RVM? In the sources it seems there is a list of boards being covered.
   
   I think it is important for an user, to understand what to expect when using this.




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] mehrdadh commented on pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#issuecomment-907496294


   okay @guberti has confirmed that the RVM passes tests with https://github.com/apache/tvm/pull/8869.
   We can merge this after CI passes.
   


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] areusch commented on pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
areusch commented on pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#issuecomment-910306399


   thanks @guberti, the PR is now merged!


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] mehrdadh commented on pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#issuecomment-903485972


   @guberti could you please rebase this with main since the Arduino project API landed now.


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] mehrdadh commented on pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#issuecomment-907059409


   I built the image and tested it against Arduino Due. It fails on two tests, currently waiting for fixing those tests before merging.


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] mehrdadh edited a comment on pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
mehrdadh edited a comment on pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#issuecomment-905432350


   @guberti thanks for the fixes. Can you explain what does `platform-version` mean in the case of arduino? I think we need to document that in the README file for people who wants to build the image. Can you for both arduino and zephyr?


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] guberti commented on pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
guberti commented on pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#issuecomment-905798037


   Thanks for the second round of comments Mehrdad! They should be addressed by 32882c4.


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] guberti commented on pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
guberti commented on pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#issuecomment-905017629


   @mehrdadh thanks for the comments! They should be fixed by a725574.


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] guberti commented on a change in pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
guberti commented on a change in pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#discussion_r695257314



##########
File path: apps/microtvm/reference-vm/base-box-tool.py
##########
@@ -439,26 +473,27 @@ def parse_args():
         "--provider",
         choices=ALL_PROVIDERS,
         action="append",
-        help="Name of the provider or providers to act on; if not specified, act on all.",
+        required=True,
+        help="Name of the provider or providers to act on",
     )
 
-    parser.add_argument(
-        "platform",
-        help="Name of the platform VM to act on. Must be a sub-directory of this directory.",
-    )
+    # "test" has special options for different platforms, and "build", "release" might
+    # in the future, so we'll add the platform argument to each one individually.
+    platform_help_str = "Electronics platform to use (e.g. Arduino, Zephyr)"

Review comment:
       I don't think "RTOS platforms to use..." is appropriate, because Arduino is not an RTOS (nor are other potential platforms like CircuitPython). Arduino calls itself a "electronic prototyping platform", but that doesn't describe Zephyr well. 
   
   I also don't like "platform to use", since "platform" could be confused with the other "microtvm-platform" parameter. Thoughts on other phrasings we could use?




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] mehrdadh commented on a change in pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on a change in pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#discussion_r694583014



##########
File path: apps/microtvm/reference-vm/arduino/base-box/base_box_test.sh
##########
@@ -0,0 +1,39 @@
+#!/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.
+#
+# Usage: base_box_test.sh <MICROTVM_PLATFORM>
+#     Execute microTVM Arduino tests.
+#
+
+set -e
+set -x
+
+if [ "$#" -lt 1 ]; then
+    echo "Usage: base_box_test.sh <MICROTVM_PLATFORM>"
+    exit -1
+fi
+
+microtvm_platform=$1
+
+pytest tests/micro/arduino/test_arduino_workflow.py --microtvm-platforms=${microtvm_platform}
+
+if [ $microtvm_platform == "nano33ble" ]; then
+    echo "NOTE: skipped test_arduino_rpc_server.py on $microtvm_platform -- known failure"

Review comment:
       Can you open an issue and comment the issue number here for reference?

##########
File path: apps/microtvm/reference-vm/base-box-tool.py
##########
@@ -363,6 +392,7 @@ def test_command(args):
         microtvm_test_platform["microtvm_platform"] = args.microtvm_platform
 
     providers = args.provider
+    print(providers)

Review comment:
       remove?

##########
File path: apps/microtvm/reference-vm/base-box-tool.py
##########
@@ -41,14 +41,46 @@
     "vmware_desktop",
 )
 
-# List of microTVM platforms for testing.
-ALL_MICROTVM_PLATFORMS = (
-    "stm32f746xx_nucleo",
-    "stm32f746xx_disco",
-    "nrf5340dk",
-    "mps2_an521",
+# List of supported electronics platforms. Each must correspond
+# to a sub-directory of this directory.
+ALL_PLATFORMS = (
+    "arduino",
+    "zephyr",
 )
 
+# List of identifying strings for microTVM platforms for testing.
+# Must match PLATFORMS as defined in tvm/tests/micro/[platform]/conftest.py
+# TODO add a way to declare supported platforms to ProjectAPI
+ALL_MICROTVM_PLATFORMS = {
+    "arduino": (
+        "due",
+        "feathers2",
+        "metrom4",
+        "nano33ble",
+        "pybadge",
+        "spresense",
+        "teensy40",
+        "teensy41",
+        "wioterminal",
+    ),
+    "zephyr": (
+        "stm32f746xx_nucleo",
+        "stm32f746xx_disco",
+        "nrf5340dk",
+        "mps2_an521",
+    ),
+}
+
+# Extra scripts required to execute on provisioning
+# in [platform]/base-box/base_box_provision.sh
+EXTRA_SCRIPTS = {
+    "arduino": (),
+    "zephyr": (
+        "docker/install/ubuntu_init_zephyr_project.sh",
+        "docker/install/ubuntu_install_qemu.sh",

Review comment:
       Bad merge. Remove this line: `"docker/install/ubuntu_install_qemu.sh"`

##########
File path: apps/microtvm/reference-vm/base-box-tool.py
##########
@@ -439,26 +473,27 @@ def parse_args():
         "--provider",
         choices=ALL_PROVIDERS,
         action="append",
-        help="Name of the provider or providers to act on; if not specified, act on all.",
+        required=True,
+        help="Name of the provider or providers to act on",
     )
 
-    parser.add_argument(
-        "platform",
-        help="Name of the platform VM to act on. Must be a sub-directory of this directory.",
-    )
+    # "test" has special options for different platforms, and "build", "release" might
+    # in the future, so we'll add the platform argument to each one individually.
+    platform_help_str = "Electronics platform to use (e.g. Arduino, Zephyr)"

Review comment:
       maybe change to "RTOS platforms to use..."?

##########
File path: apps/microtvm/reference-vm/arduino/Vagrantfile
##########
@@ -0,0 +1,89 @@
+# 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.
+
+Vagrant.configure("2") do |config|
+  config.vm.box = "tlcpack/microtvm-arduino-0.18.3"
+
+  if ENV.has_key?("TVM_RVM_NUM_CORES")
+    num_cores = ENV["TVM_RVM_NUM_CORES"]
+  else
+    num_cores = 2
+  end
+
+  if ENV.has_key?("TVM_RVM_RAM_BYTES")
+    ram_bytes = ENV["TVM_RVM_RAM_BYTES"]
+  else
+    ram_bytes = 2048
+  end
+
+  tvm_home = "../../../.."
+  dirs_to_mount = [Pathname.new(Pathname.new(tvm_home).expand_path())]
+  if ENV.has_key?("TVM_PROJECT_DIR") then
+    dirs_to_mount.append(ENV["TVM_PROJECT_DIR"])
+    puts "NOTE: also configuring project dir: %s" % [dirs_to_mount[-1]]
+  end
+
+  git_file = Pathname.new(tvm_home + "/.git")
+  if git_file.ftype() == "file" then
+    gitdir_match = Regexp.new('^gitdir: (?<gitdir>.*/.git).*\n$', Regexp::MULTILINE).match(git_file.read())
+    if !gitdir_match.nil? then
+      dirs_to_mount.append(Pathname.new(tvm_home).realpath.join(gitdir_match.named_captures["gitdir"]))
+      puts "NOTE: also configuring git-worktree gitdir: %s" % [dirs_to_mount[-1]]
+    end
+  end
+
+  config.vm.provision "shell", path: "provision_setup.sh", env: {"TVM_HOME": dirs_to_mount[0]}, privileged: false
+
+  # Enable USB Controller on VirtualBox
+  vm_name = "microtvm-#{Time.now.tv_sec}"
+  config.vm.provider "virtualbox" do |vb, overrides|
+    vb.name = vm_name
+    vb.cpus = num_cores
+    vb.memory = ram_bytes
+    vb.customize ["modifyvm", :id, "--usb", "on"]
+    vb.customize ["modifyvm", :id, "--usbehci", "on"]
+    vb.customize ["modifyvm", :id, "--usbxhci", "on"]
+    vb.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 10000]
+    dirs_to_mount.each do |d|
+      overrides.vm.synced_folder d.to_s, d.to_s
+    end
+  end
+
+  config.vm.provider "parallels" do |prl, overrides|

Review comment:
       Are you going to build the image for parallels and vmware? If not, I suggest to remove these two since without testing them it will confuse people.




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] mehrdadh edited a comment on pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
mehrdadh edited a comment on pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#issuecomment-905432350


   @guberti thanks for the fixes. Can you explain what does `platform-version` mean in the case of arduino? I think we need to document that in the help message. can you add for both arduino and zephyr?


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] guberti commented on a change in pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
guberti commented on a change in pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#discussion_r695252945



##########
File path: apps/microtvm/reference-vm/arduino/Vagrantfile
##########
@@ -0,0 +1,89 @@
+# 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.
+
+Vagrant.configure("2") do |config|
+  config.vm.box = "tlcpack/microtvm-arduino-0.18.3"
+
+  if ENV.has_key?("TVM_RVM_NUM_CORES")
+    num_cores = ENV["TVM_RVM_NUM_CORES"]
+  else
+    num_cores = 2
+  end
+
+  if ENV.has_key?("TVM_RVM_RAM_BYTES")
+    ram_bytes = ENV["TVM_RVM_RAM_BYTES"]
+  else
+    ram_bytes = 2048
+  end
+
+  tvm_home = "../../../.."
+  dirs_to_mount = [Pathname.new(Pathname.new(tvm_home).expand_path())]
+  if ENV.has_key?("TVM_PROJECT_DIR") then
+    dirs_to_mount.append(ENV["TVM_PROJECT_DIR"])
+    puts "NOTE: also configuring project dir: %s" % [dirs_to_mount[-1]]
+  end
+
+  git_file = Pathname.new(tvm_home + "/.git")
+  if git_file.ftype() == "file" then
+    gitdir_match = Regexp.new('^gitdir: (?<gitdir>.*/.git).*\n$', Regexp::MULTILINE).match(git_file.read())
+    if !gitdir_match.nil? then
+      dirs_to_mount.append(Pathname.new(tvm_home).realpath.join(gitdir_match.named_captures["gitdir"]))
+      puts "NOTE: also configuring git-worktree gitdir: %s" % [dirs_to_mount[-1]]
+    end
+  end
+
+  config.vm.provision "shell", path: "provision_setup.sh", env: {"TVM_HOME": dirs_to_mount[0]}, privileged: false
+
+  # Enable USB Controller on VirtualBox
+  vm_name = "microtvm-#{Time.now.tv_sec}"
+  config.vm.provider "virtualbox" do |vb, overrides|
+    vb.name = vm_name
+    vb.cpus = num_cores
+    vb.memory = ram_bytes
+    vb.customize ["modifyvm", :id, "--usb", "on"]
+    vb.customize ["modifyvm", :id, "--usbehci", "on"]
+    vb.customize ["modifyvm", :id, "--usbxhci", "on"]
+    vb.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 10000]
+    dirs_to_mount.each do |d|
+      overrides.vm.synced_folder d.to_s, d.to_s
+    end
+  end
+
+  config.vm.provider "parallels" do |prl, overrides|

Review comment:
       I wasn't planning on it, so I've removed those lines as suggested.




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] guberti commented on pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
guberti commented on pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#issuecomment-907419125


   > I built the image and tested it against Arduino Due. It fails on two tests, currently waiting for fixing those tests before merging.
   
   Those failures are due to a regression in `main`. PR #8869 will fix those. The CI tests should still pass.


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] mehrdadh commented on a change in pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on a change in pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#discussion_r696462769



##########
File path: apps/microtvm/reference-vm/base-box-tool.py
##########
@@ -494,7 +534,10 @@ def parse_args():
     parser_release.add_argument(
         "--platform-version",
         required=True,
-        help="Platform version to release, in the form 'x.y'.",
+        help=(
+            "For Zephyr, the platform version to release, in the form 'x.y'. "
+            "For Arduino, the version of arduino-cli that's being used."

Review comment:
       Change it to this:
   `For Arduino, the version of arduino-cli that's being used, in the form 'x.y.z'.`

##########
File path: apps/microtvm/reference-vm/base-box-tool.py
##########
@@ -494,7 +534,10 @@ def parse_args():
     parser_release.add_argument(
         "--platform-version",
         required=True,
-        help="Platform version to release, in the form 'x.y'.",
+        help=(
+            "For Zephyr, the platform version to release, in the form 'x.y'. "

Review comment:
       remove space at the end.




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] mehrdadh commented on a change in pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on a change in pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#discussion_r695680883



##########
File path: apps/microtvm/reference-vm/arduino/Vagrantfile
##########
@@ -0,0 +1,66 @@
+# 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.
+
+Vagrant.configure("2") do |config|
+  config.vm.box = "tlcpack/microtvm-arduino-0.18.3"
+
+  if ENV.has_key?("TVM_RVM_NUM_CORES")
+    num_cores = ENV["TVM_RVM_NUM_CORES"]
+  else
+    num_cores = 2
+  end
+
+  if ENV.has_key?("TVM_RVM_RAM_BYTES")
+    ram_bytes = ENV["TVM_RVM_RAM_BYTES"]
+  else
+    ram_bytes = 2048
+  end
+
+  tvm_home = "../../../.."
+  dirs_to_mount = [Pathname.new(Pathname.new(tvm_home).expand_path())]
+  if ENV.has_key?("TVM_PROJECT_DIR") then
+    dirs_to_mount.append(ENV["TVM_PROJECT_DIR"])
+    puts "NOTE: also configuring project dir: %s" % [dirs_to_mount[-1]]
+  end
+
+  git_file = Pathname.new(tvm_home + "/.git")
+  if git_file.ftype() == "file" then
+    gitdir_match = Regexp.new('^gitdir: (?<gitdir>.*/.git).*\n$', Regexp::MULTILINE).match(git_file.read())
+    if !gitdir_match.nil? then
+      dirs_to_mount.append(Pathname.new(tvm_home).realpath.join(gitdir_match.named_captures["gitdir"]))
+      puts "NOTE: also configuring git-worktree gitdir: %s" % [dirs_to_mount[-1]]
+    end
+  end
+
+  config.vm.provision "shell", path: "provision_setup.sh", env: {"TVM_HOME": dirs_to_mount[0]}, privileged: false
+
+  # Enable USB Controller on VirtualBox
+  vm_name = "microtvm-#{Time.now.tv_sec}"

Review comment:
       Later we need to be able to distinguish RVM for zephyr vs arduino to manage VM boxes on hardware fleet testing. I suggest to change this to `microtvm-arduino-#{Time.now.tv_sec}`.




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] mehrdadh commented on pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#issuecomment-905432350


   @guberti thanks for the fixes. Can you explain what does `platform-version` mean in the case of arduino?


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] guberti commented on a change in pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
guberti commented on a change in pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#discussion_r695902185



##########
File path: apps/microtvm/reference-vm/base-box-tool.py
##########
@@ -439,26 +473,27 @@ def parse_args():
         "--provider",
         choices=ALL_PROVIDERS,
         action="append",
-        help="Name of the provider or providers to act on; if not specified, act on all.",
+        required=True,
+        help="Name of the provider or providers to act on",
     )
 
-    parser.add_argument(
-        "platform",
-        help="Name of the platform VM to act on. Must be a sub-directory of this directory.",
-    )
+    # "test" has special options for different platforms, and "build", "release" might
+    # in the future, so we'll add the platform argument to each one individually.
+    platform_help_str = "Electronics platform to use (e.g. Arduino, Zephyr)"

Review comment:
       I like the idea of renaming `microtvm-platform` to `microtvm-device`. This will be a decently large refactor, though, so I think it's out of the scope of this PR. I've changed `platform_help_str` to just `Platform to use`.




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] guberti commented on a change in pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
guberti commented on a change in pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#discussion_r696882830



##########
File path: apps/microtvm/reference-vm/arduino/README.md
##########
@@ -0,0 +1,27 @@
+<!--- 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. -->
+
+# microTVM Arduino Reference Virtual Machine
+
+This directory contains setup files for Arduino virtual machine used for testing microTVM platforms
+that are supported by [Arduino](https://www.arduino.cc/).
+
+## VM Information for Developers
+Arduino VM is published under [tlcpack](https://app.vagrantup.com/tlcpack).
+Here is a list of different release versions and their tools.
+

Review comment:
       Done!




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] areusch merged pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
areusch merged pull request #8748:
URL: https://github.com/apache/tvm/pull/8748


   


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] guberti commented on a change in pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
guberti commented on a change in pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#discussion_r695902185



##########
File path: apps/microtvm/reference-vm/base-box-tool.py
##########
@@ -439,26 +473,27 @@ def parse_args():
         "--provider",
         choices=ALL_PROVIDERS,
         action="append",
-        help="Name of the provider or providers to act on; if not specified, act on all.",
+        required=True,
+        help="Name of the provider or providers to act on",
     )
 
-    parser.add_argument(
-        "platform",
-        help="Name of the platform VM to act on. Must be a sub-directory of this directory.",
-    )
+    # "test" has special options for different platforms, and "build", "release" might
+    # in the future, so we'll add the platform argument to each one individually.
+    platform_help_str = "Electronics platform to use (e.g. Arduino, Zephyr)"

Review comment:
       We decided to rename `microtvm-platform` to `microtvm-device``




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] guberti commented on a change in pull request #8748: [microTVM][RVM] Add Arduino RVM

Posted by GitBox <gi...@apache.org>.
guberti commented on a change in pull request #8748:
URL: https://github.com/apache/tvm/pull/8748#discussion_r696031380



##########
File path: apps/microtvm/reference-vm/arduino/Vagrantfile
##########
@@ -0,0 +1,66 @@
+# 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.
+
+Vagrant.configure("2") do |config|
+  config.vm.box = "tlcpack/microtvm-arduino-0.18.3"
+
+  if ENV.has_key?("TVM_RVM_NUM_CORES")
+    num_cores = ENV["TVM_RVM_NUM_CORES"]
+  else
+    num_cores = 2
+  end
+
+  if ENV.has_key?("TVM_RVM_RAM_BYTES")
+    ram_bytes = ENV["TVM_RVM_RAM_BYTES"]
+  else
+    ram_bytes = 2048
+  end
+
+  tvm_home = "../../../.."
+  dirs_to_mount = [Pathname.new(Pathname.new(tvm_home).expand_path())]
+  if ENV.has_key?("TVM_PROJECT_DIR") then
+    dirs_to_mount.append(ENV["TVM_PROJECT_DIR"])
+    puts "NOTE: also configuring project dir: %s" % [dirs_to_mount[-1]]
+  end
+
+  git_file = Pathname.new(tvm_home + "/.git")
+  if git_file.ftype() == "file" then
+    gitdir_match = Regexp.new('^gitdir: (?<gitdir>.*/.git).*\n$', Regexp::MULTILINE).match(git_file.read())
+    if !gitdir_match.nil? then
+      dirs_to_mount.append(Pathname.new(tvm_home).realpath.join(gitdir_match.named_captures["gitdir"]))
+      puts "NOTE: also configuring git-worktree gitdir: %s" % [dirs_to_mount[-1]]
+    end
+  end
+
+  config.vm.provision "shell", path: "provision_setup.sh", env: {"TVM_HOME": dirs_to_mount[0]}, privileged: false
+
+  # Enable USB Controller on VirtualBox
+  vm_name = "microtvm-#{Time.now.tv_sec}"

Review comment:
       Done. We might also want to rename the Zephyr one to match, but I think that change might break things and it's OOS for this PR anyway.




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org