Deploy.sh fails when app downloads python dependencies

I’ve created a python app that uses pip_install from bazel experimental python rules. The app builds and runs fine on my desktop, however when I use deploy.sh to deploy to the jetson. I get the following error:

================================================================================
Deploying //apps/msdrl/isaac_odrive:isaac_odrive-pkg () to robuser@192.168.1.104 under name 'ryan'
================================================================================
cp: cannot stat 'external/odrive_deps/pypi__python_dateutil/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz': No such file or directory
cp: cannot create regular file '/tmp/isaac_odrive-pkg.tar': Permission denied
tar: /tmp/dateutil-zoneinfo.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now

After looking into it I discovered that the bazel aquery command in deploy.sh finds 2 packages, one being (the first of the 2) dateutil-zoneinfo.tar.gz that is downloaded as part of the pip_install. I’ve changed that code to:

TARPATH=$(bazel aquery --config $DEVICE $PREFIX:$TARGET --output=jsonproto | jq -r --arg TARGET "$TARGET" '
            .artifacts |
            .[] |
            select( .execPath | endswith(".tar") or endswith(".tar.gz")) | select( .execPath | contains($TARGET)) |
            .execPath') 

This works fine, but I wanted to let you know and also check if this will cause any problems down the track.

Here’s my workspace file for the pip_install for reference:

http_archive(
    name = "rules_python",
    url = "https://github.com/bazelbuild/rules_python/releases/download/0.2.0/rules_python-0.2.0.tar.gz",
    sha256 = "778197e26c5fbeb07ac2a2c5ae405b30f6cb7ad1f5510ea6fdac03bded96cc6f",
)

load("@rules_python//python:pip.bzl", "pip_install")
pip_install(
    name = "odrive_deps",
        requirements = "//apps/msdrl/isaac_odrive:requirements.txt",
)

requirements.txt is just:
odrive==0.5.2.post0