aws-iot-builder-tools/aws-greengrass-provisioner

How to prevent sub-directory in function not to be disappeared?

Closed this issue · 6 comments

As I checked in AWS console, I found that sub-directory in function is disappeared after uploading it from my local pc using GGP. And all files in the sub-directory are placed on top-level directory of lambda.

Is this intended behavior? or Bug?
How do I avoid this issue?

Is this a sub directory that contains data or some configuration? Could you include a tree that shows what the file system looks like before it is built and what shows up in Lambda?

This is files which are in my local pc and uploaded by GGP.

.
├── HelloWorldPython3.py
├── README.md
├── function.conf
├── libs
│   ├── __init__.py
│   └── test.py
├── requirements.txt
└── setup.cfg

After these uploaded into AWS Lambda using GGP, libs directory is appeared and its files(e.g. test.py) are placed in top level directory like this regardless of using files in the libs.
This occurs runtime error that libs directory is not found.

.
├── HelloWorldPython3.py
├── README.md
├── __init__.py
├── cbor2
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── compat.py
│   ├── compat.pyc
│   ├── decoder.py
│   ├── decoder.pyc
│   ├── encoder.py
│   ├── encoder.pyc
│   ├── types.py
│   └── types.pyc
├── cbor2-4.1.2.dist-info
│   ├── INSTALLER
│   ├── LICENSE.txt
│   ├── METADATA
│   ├── RECORD
│   ├── WHEEL
│   └── top_level.txt
├── function.conf
├── greengrasssdk
│   ├── IoTDataPlane.py
│   ├── IoTDataPlane.pyc
│   ├── Lambda.py
│   ├── Lambda.pyc
│   ├── SecretsManager.py
│   ├── SecretsManager.pyc
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── client.py
│   ├── client.pyc
│   ├── stream_manager
│   └── utils
├── greengrasssdk-1.5.0.dist-info
│   ├── INSTALLER
│   ├── LICENSE
│   ├── METADATA
│   ├── RECORD
│   ├── WHEEL
│   └── top_level.txt
├── requirements.txt
├── setup.cfg
└── test.py

This behavior doesn't make sense to me.

I’ll take a look at this on Monday and document what’s happening here. Thanks for the info!

@timmattison Thanks your investigation for this issue. I have create a PR for this issue. Could you review the PR, and then merge it?

Investigating this, and your fix, now. Thank you!

I recreated it and the fix you provided works great, merging now.