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

[microtvm][RVM] Refactor Arduino/Zephyr into one RVM #12023

Merged
merged 5 commits into from
Jul 11, 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
3 changes: 2 additions & 1 deletion apps/microtvm/reference-vm/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/release-test
/release-test
/.vagrant
27 changes: 15 additions & 12 deletions apps/microtvm/reference-vm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,24 @@ For more information on how to use them, see the
## microTVM Developer Information

Each RTOS or platform (like Zephyr, Ardunio, etc) that integrates with microTVM
can check-in a Reference VM in this directory to help the community collaborate.
You should use the tools provided here to ensure a uniform release process
across all platforms. Typically, releases need to be created by TVM committers.
can check-in installation scripts in the Reference VM in this directory to help
the community collaborate. You should use the tools provided here to ensure a
uniform release process across all platforms. Typically, releases need to be
created by TVM committers.

Generally speaking, it's expected that any integrated platform with a regression
test checked-in to the tvm repository should also define a reference VM. If you
want to integrate a new platform, please raise a discussion on
[the forum](https://discuss.tvm.ai).


## Reference VMs Organization
## Reference VM Organization

Reference VMs are organized in this directory as follows:
The Reference VM is organized in this directory as follows:

```
.
+-- base-box-tool.py - Reference VM build, test, and release tool.
+-- PLATFORM/ - One or more dirs related to the supported platform(s),
like zephyr/ and arduino/. The dir names are the same to
be passed as arguments to base-box-tool.py as PLATFORM.
+-- Vagrantfile - Vagrantfile that end-users will invoke. Should be based
| off a base box which contains dependencies other than the
| TVM python dependencies.
Expand All @@ -64,12 +62,12 @@ Reference VMs are organized in this directory as follows:

1. **Build** the base box for a given platform:
```bash
$ ./base-box-tool.py [--provider=PROVIDER] build PLATFORM
$ ./base-box-tool.py [--provider=PROVIDER] build
```

For example:
```bash
$ ./base-box-tool.py --provider virtualbox build zephyr
$ ./base-box-tool.py --provider virtualbox build
```

2. **Run** release tests for each platform:
Expand All @@ -90,7 +88,7 @@ $ ./base-box-tool.py --provider virtualbox build zephyr

This command does the following for the specified provider:

* Copies all files inside `PLATFORM/` dir except `.vagrant` and `base-box` to
* Copies all files inside this dir except `.vagrant` and `base-box` to
`release-test/`. This is done to avoid reusing any VM the developer may have
started;

Expand All @@ -108,7 +106,12 @@ $ ./base-box-tool.py --provider virtualbox build zephyr

4. If release tests pass, **release** the box:
```bash
$ ./base-box-tool.py [--provider=PROVIDER] release --release-version=RELEASE_VER --platform-version=PLATFORM_VER PLATFORM
$ ./base-box-tool.py [--provider=PROVIDER] release --release-version=RELEASE_VER
```
For that step be sure you've logged in to Vagrant Cloud using the `vagrant`
tool.

## Versioning
We use semantic versioning as it is recommended by [Vagrant](https://www.vagrantup.com/docs/boxes/versioning). We use `X.Y.Z` version where we maintain the same major version `X` it has minor changes and newer version is still compatible with older versions and we increase minor version `Y`. However, We increase the major version `X` when new RVM is not compatible with older onces. Updates to the Zephyr SDK or Arduino board SDKs are considered major changes and require incrementing major version `X`. In this versioning, `Z` is barely used but we kept it since Vagrant requires this format.

**Note**: We will release all microTVM RVM boxes under [microtvm](https://app.vagrantup.com/tlcpack/boxes/microtvm) and use box versioning in Vagrant file. Previous versions like `microtvm-zephyr`, `microtvm-arduino`, `microtvm-zephyr-2.5`, etc. are deprecated and will be removed in the future.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# under the License.

Vagrant.configure("2") do |config|
config.vm.box = "tlcpack/microtvm-arduino"
config.vm.box_version = "2.0.0"
config.vm.box = "tlcpack/microtvm"
config.vm.box_version = "1.0.0"

if ENV.has_key?("TVM_RVM_NUM_CORES")
num_cores = ENV["TVM_RVM_NUM_CORES"]
Expand All @@ -31,7 +31,7 @@ Vagrant.configure("2") do |config|
ram_bytes = 2048
end

tvm_home = "../../../.."
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"])
Expand All @@ -47,10 +47,15 @@ Vagrant.configure("2") do |config|
end
end

config.vm.provision "shell", path: "provision_setup.sh", env: {"TVM_HOME": dirs_to_mount[0]}, privileged: false
config.vm.provision "shell",
path: "provision_setup.sh",
env: {"TVM_HOME": dirs_to_mount[0],
"TVM_CI_NUM_CORES": num_cores
},
privileged: false

# Enable USB Controller on VirtualBox
vm_name = "microtvm-arduino-#{Time.now.tv_sec}"
vm_name = "microtvm-#{Time.now.tv_sec}"
config.vm.provider "virtualbox" do |vb, overrides|
vb.name = vm_name
vb.cpus = num_cores
Expand Down
1 change: 0 additions & 1 deletion apps/microtvm/reference-vm/arduino/.gitignore

This file was deleted.

46 changes: 0 additions & 46 deletions apps/microtvm/reference-vm/arduino/README.md

This file was deleted.

55 changes: 0 additions & 55 deletions apps/microtvm/reference-vm/arduino/base-box/base_box_setup.sh

This file was deleted.

42 changes: 0 additions & 42 deletions apps/microtvm/reference-vm/arduino/provision_setup.sh

This file was deleted.

Loading