Skip to content
Snippets Groups Projects
Commit 7ce1a513 authored by auphelia's avatar auphelia
Browse files

[Transformation] Add functionality to copy deployment folder to PYNQ board

parent f783650c
No related branches found
No related tags found
No related merge requests found
import os
import subprocess
from distutils.dir_util import copy_tree
from shutil import copy
......@@ -47,4 +48,20 @@ class DeployToPYNQ(Transformation):
copy_tree(pynq_driver_dir, deployment_dir)
model.set_metadata_prop("pynq_deploy_dir", deployment_dir)
# create target directory on PYNQ board
cmd = 'sshpass -p {} ssh {}@{} "mkdir -p {}"'.format(
self.password, self.username, self.ip, self.target_dir
)
bash_command = ["/bin/bash", "-c", cmd]
process_compile = subprocess.Popen(bash_command, stdout=subprocess.PIPE)
process_compile.communicate()
# copy directory to PYNQ board using scp and sshpass
cmd = "sshpass -p {} scp -r {} {}@{}:{}".format(
self.password, deployment_dir, self.username, self.ip, self.target_dir
)
bash_command = ["/bin/bash", "-c", cmd]
process_compile = subprocess.Popen(bash_command, stdout=subprocess.PIPE)
process_compile.communicate()
return (model, False)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment