areusch commented on a change in pull request #8190:
URL: https://github.com/apache/tvm/pull/8190#discussion_r649501166
##########
File path: docker/install/ubuntu_init_zephyr_project.sh
##########
@@ -16,10 +16,35 @@
# specific language governing permissions and limitations
# under the License.
+#
+# Initialize Zephyr Project.
+#
+# Usage: ubuntu_init_zephyr_project.sh path branch [--commit hash]
+# path is the installation path for the repository.
+# branch is the zephyr branch.
+# --commit is the commit hash number of zephyrproject repository. If not
specified, it uses the latest commit.
+#
+
+set -x
+
DOWNLOAD_DIR=$1
-ZEPHYR_BRANCH=$2
+shift
+ZEPHYR_BRANCH=$1
+shift
+
+commit_hash="0"
Review comment:
slightly better test could be:
```
commit_hash=
# ...
if [ -n "${commit_hash}" ]; then
# ...
```
this avoids the problem that a user could supply `--commit 0` and not
receive an error
##########
File path: apps/microtvm/reference-vm/base-box-tool.py
##########
@@ -293,19 +318,34 @@ def do_run_release_test(release_test_dir, provider_name,
test_config, test_devic
os.path.join(release_test_dir, ".vagrant", "machines", "default",
provider_name, "id")
) as f:
machine_uuid = f.read()
- ATTACH_USB_DEVICE[provider_name](
- machine_uuid,
- vid_hex=test_config["vid_hex"],
- pid_hex=test_config["pid_hex"],
- serial=test_device_serial,
- )
+
+ # Check if target is not QEMU
+ if test_config["vid_hex"] and test_config["pid_hex"]:
+ ATTACH_USB_DEVICE[provider_name](
+ machine_uuid,
+ vid_hex=test_config["vid_hex"],
+ pid_hex=test_config["pid_hex"],
+ serial=test_device_serial,
+ )
tvm_home = os.path.realpath(os.path.join(THIS_DIR, "..", "..", ".."))
def _quote_cmd(cmd):
return " ".join(shlex.quote(a) for a in cmd)
- test_cmd = _quote_cmd(["cd", tvm_home]) + " && " +
_quote_cmd(test_config["test_cmd"])
- subprocess.check_call(["vagrant", "ssh", "-c", f"bash -ec '{test_cmd}'"],
cwd=release_test_dir)
+ test_cmd_zephyr = (
+ _quote_cmd(["cd", tvm_home]) + " && " +
_quote_cmd(test_config["test_cmd_zephyr"])
+ )
+ test_cmd_zephyr_aot = (
+ _quote_cmd(["cd", tvm_home]) + " && " +
_quote_cmd(test_config["test_cmd_zephyr_aot"])
+ )
+ if test_cmd_zephyr:
Review comment:
rather than complicate this logic with one-invocation-per-test-command,
i was thinking we may add a shell script here and just invoke that as
`test_cmd`. wdyt?
##########
File path: apps/microtvm/reference-vm/zephyr/base-box/base_box_provision.sh
##########
@@ -0,0 +1,32 @@
+#!/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
+
+source ~/.profile
+
+# Init Zephyr
+cd ~
+~/ubuntu_init_zephyr_project.sh ~/zephyrproject v2.5-branch --commit
dabf23758417fd041fec2a2a821d8f526afac29d
Review comment:
i was thinking we were not going to move to ~/zephyrproject after all,
since it's not backwards compatible
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]