-
Notifications
You must be signed in to change notification settings - Fork 40
Several relatively small fixes primarily motivated by changes in the python setuptools #513
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
Conversation
Signed-off-by: Mic Bowman <mic.bowman@intel.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Mic Bowman <cmickeyb@gmail.com>
Signed-off-by: Mic Bowman <mic.bowman@intel.com>
The current version of python setuptools no longer puts binary files in the same name directory tree as the python libraries. As a result, the eservice and pservice enclaves could not be found and loaded. This commit addresses the problem with several changes: 1) the names of the enclave libraries are now unique (libpdo-eservice-enclave.signed.so and libpdo-pservice-enclave.signed.so) 2) the enclave libraries are installed into the PDO_HOME directory tree (in the lib directory). This directory is now created when the rest of the enviroment is created. 3) the search path used by the pservice and eservice python modules reflect the new location. 4) cachetools is explicitly installed Signed-off-by: Mic Bowman <mic.bowman@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the Python packaging and enclave library handling to align with recent setuptools changes, removes the unused secp256k1 dependency, and standardizes binary and project naming for both pservice and eservice.
- Remove
secp256k1imports and wrapper class; update Python requirements. - Introduce
libinstall directory in setup scripts and update enclave binary names. - Refactor enclave library lookup to use
find_file_in_path, adjust logging and error reporting.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| python/pdo/common/keys.py | Drop secp256k1 import and TransactionKeys class |
| pservice/setup.py | Add lib_dir mapping; rename enclave shared object |
| pservice/pdo/pservice/pdo_enclave.py | Refactor __find_enclave_library; adjust logging and config |
| pservice/lib/libpdo_enclave/CMakeLists.txt | Rename project to libpdo-pservice-enclave |
| pservice/Makefile | Update ENCLAVE_LIB path |
| eservice/setup.py | Mirror setup changes for eservice |
| eservice/pdo/eservice/pdo_enclave.py | Refactor lookup; hard-coded enclave count; logging fixes |
| eservice/lib/libpdo_enclave/CMakeLists.txt | Rename project to libpdo-eservice-enclave |
| eservice/Makefile | Update ENCLAVE_LIB path |
| client/pdo/client/builder/shell.py | Log full exception only when verbose is enabled |
| build/python_requirements.txt | Remove secp256k1; add cachetools |
| build/Makefile | Create opt/pdo/lib directory |
Comments suppressed due to low confidence (5)
pservice/pdo/pservice/pdo_enclave.py:153
- Avoid hard-coding the number of enclaves; restore reading from
config.get('NumberOfEnclaves', 1)or make it configurable again.
if not _ias:
pservice/pdo/pservice/pdo_enclave.py:170
- [nitpick] Using
errorfor what appears to be informational debug output may clutter logs; consider usinglogger.debugorlogger.infohere instead.
update_sig_rl()
pservice/pdo/pservice/pdo_enclave.py:178
- [nitpick] This status message is not an error; switch to
infoordebugto reflect normal operation.
# -----------------------------------------------------------------
eservice/pdo/eservice/pdo_enclave.py:153
- This hard-coded enclave count overrides configuration; consider restoring the original
config.get('NumberOfEnclaves')logic.
NumberOfEnclaves = 2
eservice/pdo/eservice/pdo_enclave.py:91
- This
raiseappears after areturnand will never execute; adjust indentation so the exception is thrown when lookup fails.
raise IOError("Could not find enclave shared object: {}".format(enclave_file_name))
Signed-off-by: Mic Bowman <mic.bowman@intel.com>
A number of relatively small fixes.
Note... there is a bigger problem that has to be addressed with the python package structure to bring it up to date with best practices.