From 6615acbb33b60e1977be1eee6a0cda035abcfc1e Mon Sep 17 00:00:00 2001 From: Damien Bataille Date: Tue, 4 Jun 2024 17:41:57 -0700 Subject: [PATCH] First commit with basic texture related nodes --- .flake8 | 95 +++++ LICENSE | 177 ++++++++++ README.md | 92 +---- __init__.py | 19 + images/remix_nodes.png | Bin 0 -> 40887 bytes install.bat | 16 + nodes/__init__.py | 53 +++ nodes/common.py | 76 ++++ nodes/constant.py | 19 + nodes/ingestion.py | 169 +++++++++ nodes/textures.py | 329 ++++++++++++++++++ nodes/utils.py | 40 +++ repo.bat | 10 + repo.sh | 8 + repo.toml | 26 ++ requirements.txt | 6 + tools/packman/bootstrap/configure.bat | 169 +++++++++ .../bootstrap/download_file_from_url.ps1 | 53 +++ .../fetch_file_from_packman_bootstrap.cmd | 35 ++ .../bootstrap/generate_temp_file_name.ps1 | 161 +++++++++ .../bootstrap/generate_temp_folder.ps1 | 167 +++++++++ tools/packman/bootstrap/install_package.py | 172 +++++++++ tools/packman/config.packman.xml | 9 + tools/packman/packman | 192 ++++++++++ tools/packman/packman.cmd | 89 +++++ tools/packman/packmanconf.py | 112 ++++++ tools/packman/python.bat | 32 ++ tools/packman/python.sh | 42 +++ tools/repo-deps.packman.xml | 11 + tools/repoman/repoman.py | 25 ++ 30 files changed, 2317 insertions(+), 87 deletions(-) create mode 100644 .flake8 create mode 100644 LICENSE create mode 100644 __init__.py create mode 100644 images/remix_nodes.png create mode 100644 install.bat create mode 100644 nodes/__init__.py create mode 100644 nodes/common.py create mode 100644 nodes/constant.py create mode 100644 nodes/ingestion.py create mode 100644 nodes/textures.py create mode 100644 nodes/utils.py create mode 100644 repo.bat create mode 100644 repo.sh create mode 100644 repo.toml create mode 100644 requirements.txt create mode 100644 tools/packman/bootstrap/configure.bat create mode 100644 tools/packman/bootstrap/download_file_from_url.ps1 create mode 100644 tools/packman/bootstrap/fetch_file_from_packman_bootstrap.cmd create mode 100644 tools/packman/bootstrap/generate_temp_file_name.ps1 create mode 100644 tools/packman/bootstrap/generate_temp_folder.ps1 create mode 100644 tools/packman/bootstrap/install_package.py create mode 100644 tools/packman/config.packman.xml create mode 100644 tools/packman/packman create mode 100644 tools/packman/packman.cmd create mode 100644 tools/packman/packmanconf.py create mode 100644 tools/packman/python.bat create mode 100644 tools/packman/python.sh create mode 100644 tools/repo-deps.packman.xml create mode 100644 tools/repoman/repoman.py diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..2481684 --- /dev/null +++ b/.flake8 @@ -0,0 +1,95 @@ +[flake8] +max-line-length = 120 +docstring-convention = google +select = + # pycodestyle + E,W, + # flake8-docstrings + D3, + # pyflakes + F, + # pep8-naming + N, + # pycodestyle + A, + # flake8-bugbear + B, + # flake8-comprehensions + C, + # flake8-return + R, + # flake8-pep3101 + S001, + # flake8-pylint + PL, + # flake8-simplify + SIM, + +ignore = + # line break before/after binary operator. Black formats it differently: https://stackoverflow.com/a/57074422 + W503, + W504, + # do not assign a lambda expression, use a def + E731, + # 'from module import *' used; unable to detect undefined names + F403, + # Name may be undefined, or defined from star imports: module (F405) + F405, + # Import outside toplevel (import-outside-toplevel). We want that to save on import times sometimes. + PLC0415, + # Formatting a regular string which could be a f-string (consider-using-f-string) + # (anov): I don't know, I feel "".format() is some times more applicable. Open to reconsider. + PLC0209, + # Constant name "_autoload_exts" doesn't conform to UPPER_CASE naming style (invalid-name) + PLC0103, + # Unnecessary variable assignment before return statement. Doesn't work correctly when `global` is used. + R504, + # ignore multiple with statements (for omni.ui) + SIM117, + # Missing function or method docstring (missing-function-docstring) + PLC0116, + # Method could be a function (no-self-use) + PLR0201, + # Line too long (107/100) (line-too-long) # we already have another plugin that check that + PLC0301, + # Unable to import + PLE0401, + # Use 'from omni import ui' instead (consider-using-from-import) + PLR0402, + # Missing module docstring (missing-module-docstring) + PLC0114, + # Unused argument 'item' (unused-argument) # we already have another plugin that check that + PLW0613, + # Too few public method, too many.... + PLR09, + # Using the global statement (global-statement) + PLW0603, + # Unnecessary pass statement (unnecessary-pass) + PLW0107, + # Missing class docstring (missing-class-docstring) + PLC0115, + # ignore todo + PLW0511, + # No name 'RiggedVehicleCore' in module 'core.core' (no-name-in-module) + PLE0611, + # Anomalous backslash in string: '\S'. + # PLW1401, + # Attribute 'bla' defined outside __init__ + PLW0201, + # Access to member 'bla' before its definition line + # PLE0203, + # Instance of 'SetupUI' has no '' member (no-member) + # PLE1101, + # Unused private member `ContentItem.__background_image` (unused-private-member) + # PLW0238, + # Method should have "self" as first argument (no-self-argument) # we already have N805 + PLE0213, + # Import "import omni.ui as ui" should be placed at the top of the module (wrong-import-position) (with use isort) + PLC0413, + # Unused import asyncio (unused-import), we use F401 + PLW0611, + # No value for argument 'is_item_expanded_fn' in constructor call (no-value-for-parameter) + # PLE1120 + +per-file-ignores = + */__init__.py: F401 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f433b1a --- /dev/null +++ b/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/README.md b/README.md index 8357135..fad8482 100644 --- a/README.md +++ b/README.md @@ -1,93 +1,11 @@ # ComfyUI-RTX_Remix - - -## Getting started - -To make it easy for you to get started with GitLab, here's a list of recommended next steps. - -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! - -## Add your files - -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: - -``` -cd existing_repo -git remote add origin https://gitlab-master.nvidia.com/lightspeedrtx/lss-ai-tools/comfyui-rtx_remix.git -git branch -M main -git push -uf origin main -``` - -## Integrate with your tools - -- [ ] [Set up project integrations](https://gitlab-master.nvidia.com/lightspeedrtx/lss-ai-tools/comfyui-rtx_remix/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README - -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - ## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. +- Navigate to your `/ComfyUI/custom_nodes/` folder +- Git clone this repo +- Navigate to your `comfyui-rtx_remix` folder and run `install.bat` -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. +You should see RTX Remix nodes: -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. +![RTX Remix](images/remix_nodes.png "RTX Remix") \ No newline at end of file diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..a838cf1 --- /dev/null +++ b/__init__.py @@ -0,0 +1,19 @@ +""" +* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +* SPDX-License-Identifier: Apache-2.0 +* +* Licensed 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 +* +* https://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. +""" +from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS + +__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS'] diff --git a/images/remix_nodes.png b/images/remix_nodes.png new file mode 100644 index 0000000000000000000000000000000000000000..5c531e06a1b81652dae6f1ffbb69f56f2edc6188 GIT binary patch literal 40887 zcmeFZWmuG3|2C|IbPu9*!+?O&Al)$J&;tl44FXb1w}fpUh1OT>$^wc7-a++$tZWUIX4>SWBx(-?~*9i+5>`3B1Q~Rx)(Gb&K%x&EMNy zPDK{Lhoo-u25#C;R&FoNT`X@Yx>#B|y4pCoJ<-JmF3ILrmXp?b^g8@-uvd889;R@Z+$rQXO_>+1b137v8Ls{EQB(F627A`1oUE3Ulj|%R-M#mvc$8n2BL*`LK36G} zi+S2F^(NN-^~Fav{aiTfn#BL`_3sP3UC3c}3ELn3diB3Q0fzDK?D-+%S(!)=St@pC z)Gs5ev&-z(-H)#iA zPb?Y!zjT<$ldP9~@g9?k{THVH@3#N{kqiAFIgEdyc@RDJ&7X_8pR;jieH=Fa z3lVJ7PN9vu2OkrW!<=IzW3q-Ln}!Td(Z-(plikT|fAiwGM)|_y=KnuB{11_HqUojk zAXgH_W1OmgM%+J{^H`Q~hwuM^v2~(x7>c^WFxV=J-2T9!?*Yx@Te*DyH%W#sfs->% zyUk8fw_m=*#gdK1%I-(`DD;{GxfH>c^**1Ye&~Gh&i{Pq|2ZJQ_F3t;L+^*Hsw*7_j8J>D&KU zBMdr}ms$wsyoO10fjQQltc!yhkFpYQxpV`z
l-y9o^G>ys9PML!gPdEbK4E>(r zBEe>Xob}+D`QKz3Yi4~tdN!NxVsC+Q+~Nkqi8$y<>pwlO}w}&h)#x1ccIe$Zxt(O29 z9*HS_WuV73tgg~O{>fDqVoQNZar<4F_@v(=(dMJG^EWN0Z#pMjhS&mINn<6>i)eI5 zd?)Dy-zSo0imZfL{xu-^#u+oTyP08D1+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*oJczBnpC-R8=R(o?h@<~{pZP!OYtz;rVtt+Xib1Vdr+1TY S?$#ObM?pqKx dict[str, dict[str, tuple[str, dict]]]: + return {"required": {"address": ("STRING", {"forceInput": True}), "port": ("INT", {"forceInput": True})}} + + +class RestAPIDetails: + + @classmethod + def INPUT_TYPES(cls): # noqa N802 + return { + "required": { + "address": ("STRING", {"multiline": False, "default": "127.0.0.1"}), + "port": ( + "INT", + { + "default": 8011, + "min": 0, # Minimum value + "max": 65353, # Maximum value + "step": 1, # Slider's step + "display": "number", # Cosmetic only: display as "number" or "slider" + }, + ), + }, + } + + RETURN_TYPES = ("STRING", "INT") + RETURN_NAMES = ("address", "port") + + FUNCTION = "get_address" + + # OUTPUT_NODE = False + + CATEGORY = f"{PREFIX_MENU}/{_file_name}" + + def get_address(self, address, port): + return address, port + + +class StringConstant: + @classmethod + def INPUT_TYPES(cls): # noqa N802 + return { + "required": { + "string": ("STRING", {"default": "", "multiline": False}), + } + } + + RETURN_TYPES = ("STRING",) + FUNCTION = "get_string" + CATEGORY = f"{PREFIX_MENU}/{_file_name}" + + def get_string(self, string): + return (string,) diff --git a/nodes/constant.py b/nodes/constant.py new file mode 100644 index 0000000..de09936 --- /dev/null +++ b/nodes/constant.py @@ -0,0 +1,19 @@ +""" +* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +* SPDX-License-Identifier: Apache-2.0 +* +* Licensed 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 +* +* https://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. +""" + +PREFIX_MENU = "RTXRemix" +HEADER_LSS_REMIX_VERSION_1_0 = {"Accept": "application/lightspeed.remix.service+json; version=1.0"} diff --git a/nodes/ingestion.py b/nodes/ingestion.py new file mode 100644 index 0000000..ebf1cb4 --- /dev/null +++ b/nodes/ingestion.py @@ -0,0 +1,169 @@ +""" +* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +* SPDX-License-Identifier: Apache-2.0 +* +* Licensed 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 +* +* https://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. +""" + +import json +import os +import pathlib + +import folder_paths +import numpy as np +import requests +import torch +from PIL import Image + +from .common import get_rest_api_inputs +from .constant import HEADER_LSS_REMIX_VERSION_1_0, PREFIX_MENU +from .utils import merge_dict + +_file_name = pathlib.Path(__file__).stem + + +class IngestTexture: + + @classmethod + def INPUT_TYPES(cls): # noqa N802 + inputs = { + "required": { + "texture": ("IMAGE", {}), + "texture_type": ( + "STRING", + { + # node + "default": "", + "forceInput": True, + }, + ), + "texture_name": ( + "STRING", + { + # node + "default": "", + "forceInput": True, + }, + ), + }, + "optional": { + "enable_override_output_folder": ( + "BOOLEAN", + { + "default": False, + "label_on": "enabled", + "label_off": "disabled", + }, + ), + "override_output_folder": ( + "STRING", + { + # node + "default": "", + }, + ), + }, + } + return merge_dict(get_rest_api_inputs(), inputs) + + FUNCTION = "ingest_texture" + + RETURN_TYPES = ("STRING",) + + RETURN_NAMES = ("texture_path",) + + OUTPUT_NODE = True + + CATEGORY = f"{PREFIX_MENU}/{_file_name}" + + def ingest_texture( + self, + texture: torch.Tensor, + texture_type: str, + texture_name: str, + enable_override_output_folder: bool, + override_output_folder: str, + address: str, + port: str, + ): + if enable_override_output_folder: + if not pathlib.Path(override_output_folder).exists(): + raise FileNotFoundError("Can't overwrite output folder, folder doesn't exist.") + output_folder = override_output_folder + else: + # call RestAPI to get the default output folder + r = requests.get( + f"http://{address}:{port}/stagecraft/assets/default-directory", + headers=HEADER_LSS_REMIX_VERSION_1_0, + ) + if r.status_code != 200: + response_dict = json.loads(r.text) + raise ValueError(response_dict.get("detail", "Wrong request value")) + output_folder = json.loads(r.text).get("asset_path", {}) + + if not os.path.exists(output_folder): + raise ValueError(f"Output folder doesn't exist: {output_folder}") + + full_output_folder, filename, _counter, _subfolder, _filename_prefix = folder_paths.get_save_image_path( + texture_name, folder_paths.get_output_directory(), texture[0].shape[1], texture[0].shape[0] + ) + + tmp_image_path = pathlib.Path(full_output_folder).joinpath(f"{filename}.png") + i = 255.0 * texture.cpu().numpy().squeeze() + img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8)) + img.save(tmp_image_path) + img.close() + + payload = { + "context_plugin": { + "data": { + "input_files": [(str(tmp_image_path), texture_type)], + "output_directory": output_folder, + }, + }, + } + + data = json.dumps(payload) + r = requests.post( + f"http://{address}:{port}/ingestcraft/mass-validator/queue/material", + data=data, + headers=HEADER_LSS_REMIX_VERSION_1_0, + ) + os.remove(str(tmp_image_path)) + if r.status_code != 200: + response_dict = json.loads(r.text) + raise ValueError(response_dict.get("detail", "Wrong request value")) + + completed_schemas = json.loads(r.text).get("completed_schemas", {}) + results = None + for completed_schema in completed_schemas: + for check_plugin in completed_schema.get("check_plugins", []): + if check_plugin.get("name") != "ConvertToDDS": + continue + for data_flow in check_plugin.get("data", {}).get("data_flows", []): + if data_flow.get("channel") != "ingestion_output": + continue + results = data_flow["output_data"] + break + break + if results: + break + + if not results: + raise ValueError(f"Can't get the ingested texture with name {texture_name} from the folder {output_folder}") + + result_path = pathlib.Path(results[0]) + if not result_path.exists(): + raise FileNotFoundError(f"Can't find the texture {result_path}") + + return (str(result_path),) diff --git a/nodes/textures.py b/nodes/textures.py new file mode 100644 index 0000000..f3298ec --- /dev/null +++ b/nodes/textures.py @@ -0,0 +1,329 @@ +""" +* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +* SPDX-License-Identifier: Apache-2.0 +* +* Licensed 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 +* +* https://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. +""" + +import json +import pathlib + +import numpy as np +import requests +import torch +from PIL import Image, ImageOps + +from .common import get_rest_api_inputs +from .constant import HEADER_LSS_REMIX_VERSION_1_0, PREFIX_MENU +from .utils import merge_dict + +_texture_types = [ + "DIFFUSE", + "ROUGHNESS", + "ANISOTROPY", + "METALLIC", + "EMISSIVE", + "NORMAL_OGL", + "NORMAL_DX", + "NORMAL_OTH", + "HEIGHT", + "TRANSMITTANCE", + "MEASUREMENT_DISTANCE", + "SINGLE_SCATTERING", + "OTHER", +] # RestAPI should not be called here. Or if there is a crash, the whole graph would not load + + +_file_name = pathlib.Path(__file__).stem + + +def validate_texture_types(texture_types: list[str], address: str, port: str): + r = requests.get(f"http://{address}:{port}/stagecraft/textures/types", headers=HEADER_LSS_REMIX_VERSION_1_0) + if r.status_code != 200: + response_dict = json.loads(r.text) + raise ValueError(response_dict.get("detail", "Wrong request value")) + + valid_texture_types = set(json.loads(r.text).get("texture_types", [])) + + for texture_type in texture_types: + if texture_type not in valid_texture_types: + supported_str = ','.join(valid_texture_types) + raise ValueError(f"Wrong texture type value {texture_type}. Only those values are supported: {supported_str}") + + +class GetTextures: + + @classmethod + def INPUT_TYPES(cls): # noqa N802 + inputs = { + "required": { + "return_selection": ( + "BOOLEAN", + { + "default": False, + "label_on": "enabled", + "label_off": "disabled", + }, + ), + "filter_session_prims": ( + "BOOLEAN", + { + "default": False, + "label_on": "enabled", + "label_off": "disabled", + }, + ), + }, + "optional": { + "asset_hashes": ( + "STRING", + { + "multiline": True, # True if you want the field to look like the one on the ClipTextEncode + # node + "default": "", + "placeholder": "A set of asset hashes to keep when filtering material asset paths", + }, + ), + "texture_types": ( + "STRING", + { + # node + "default": "", + "forceInput": True, + }, + ), + }, + } + return merge_dict(get_rest_api_inputs(), inputs) + + RETURN_TYPES = ( + "STRING", + "STRING", + "IMAGE", + ) + OUTPUT_IS_LIST = ( + True, + True, + True, + ) + RETURN_NAMES = ( + "usd_attributes", + "texture_names", + "textures", + ) + + FUNCTION = "get_texture_prims_assets" + + # OUTPUT_NODE = False + + CATEGORY = f"{PREFIX_MENU}/{_file_name}" + + def get_texture_prims_assets( + self, + return_selection: bool, + filter_session_prims: bool, + address: str, + port: str, + asset_hashes: str | None = None, + texture_types: str | None = None, + ) -> tuple[list[str], list[torch.Tensor]]: + + payload = {"selection": return_selection, "filter_session_prims": filter_session_prims} + if asset_hashes is not None: + payload["asset_hashes"] = [item.strip() for item in asset_hashes.split(",")] + if texture_types is not None: + payload["texture_types"] = [item.strip() for item in texture_types.split(",")] + + r = requests.get( + f"http://{address}:{port}/stagecraft/textures", params=payload, headers=HEADER_LSS_REMIX_VERSION_1_0 + ) + if r.status_code != 200: + response_dict = json.loads(r.text) + raise ValueError(response_dict.get("detail", "Wrong request value")) + + result_attrs = [] + texture_names = [] + result_images = [] + for usd_attr, texture_path in json.loads(r.text).get("textures", []): + if not pathlib.Path(texture_path).exists(): + continue + with Image.open(texture_path) as img_0: + with ImageOps.exif_transpose(img_0) as img_1: + image = img_1.convert("RGB") + image = np.array(image).astype(np.float32) / 255.0 + image = torch.from_numpy(image)[None,] # noqa E231 + result_images.append(image) + texture_names.append(pathlib.Path(texture_path).stem) + result_attrs.append(usd_attr) + + if not result_images: + raise ValueError("No texture found. Please check the parameters of your node") + + return result_attrs, texture_names, result_images + + @classmethod + def IS_CHANGED(cls, **kwargs): # noqa N802 + """ + Always process the node in case the selection in the RTX Remix app changed + """ + return float("nan") + + +class TexturesTypes: + + @classmethod + def INPUT_TYPES(cls): # noqa N802 + + inputs = { + "required": { + "texture_types": ( + "STRING", + { + "multiline": True, # True if you want the field to look like the one on the ClipTextEncode + # node + "default": ",".join(_texture_types), + }, + ), + } + } + return merge_dict(get_rest_api_inputs(), inputs) + + RETURN_TYPES = ("STRING",) + RETURN_NAMES = ("texture_types",) + + FUNCTION = "get_texture_types" + + # OUTPUT_NODE = False + + CATEGORY = f"{PREFIX_MENU}/{_file_name}" + + def get_texture_types(self, texture_types: str, address: str, port: str) -> tuple[str]: + texture_types_list = [tx.strip() for tx in texture_types.split(",")] + validate_texture_types(texture_types_list, address, port) + + return (texture_types,) + + +class TexturesType: + + @classmethod + def INPUT_TYPES(cls): # noqa N802 + + inputs = { + "required": { + "texture_type": (_texture_types,), + } + } + return merge_dict(get_rest_api_inputs(), inputs) + + RETURN_TYPES = ("STRING",) + RETURN_NAMES = ("texture_type",) + + FUNCTION = "get_texture_type" + + # OUTPUT_NODE = False + + CATEGORY = f"{PREFIX_MENU}/{_file_name}" + + def get_texture_type(self, texture_type: str, address: str, port: str) -> tuple[str]: + validate_texture_types([texture_type], address, port) + return (texture_type,) + + +class SetTexture: + + @classmethod + def INPUT_TYPES(cls): # noqa N802 + inputs = { + "required": { + "usd_attribute": ("STRING", {"default": "", "forceInput": True}), + "texture_path": ("STRING", {"default": "", "forceInput": True}), + }, + "optional": { + "force": ( # Whether to force replace the texture or validate it was ingested correctly + "BOOLEAN", + {"default": False, "label_on": "enabled", "label_off": "disabled"}, + ), + }, + } + return merge_dict(get_rest_api_inputs(), inputs) + + FUNCTION = "set_texture" + + RETURN_TYPES = () + + OUTPUT_NODE = True + + CATEGORY = f"{PREFIX_MENU}/{_file_name}" + + def set_texture(self, usd_attribute: str, texture_path: str, address: str, port: str, force: bool = False): + + payload = {"force": force, "textures": [[usd_attribute, texture_path]]} + + data = json.dumps(payload) + + r = requests.put( + f"http://{address}:{port}/stagecraft/textures", data=data, headers=HEADER_LSS_REMIX_VERSION_1_0 + ) + if r.status_code != 200: + response_dict = json.loads(r.text) + raise ValueError(response_dict.get("detail", "Wrong request value")) + + return {} # need to return something + + +class TextureTypeToUSDAttribute: + + @classmethod + def INPUT_TYPES(cls): # noqa N802 + inputs = { + "required": { + "usd_attribute": ("STRING", {"default": "", "forceInput": True}), + "texture_type": ( + "STRING", + { + # node + "default": "", + "forceInput": True, + }, + ), + }, + } + return merge_dict(get_rest_api_inputs(), inputs) + + FUNCTION = "get_attr_from_texture_type" + + RETURN_TYPES = ("STRING",) + + RETURN_NAMES = ("usd_attribute",) + + CATEGORY = f"{PREFIX_MENU}/{_file_name}" + + def get_attr_from_texture_type(self, usd_attribute: str, texture_type: str, address: str, port: str): + + r = requests.get( + f"http://{address}:{port}/stagecraft/textures/{usd_attribute}/material/inputs", + params={"texture_type": texture_type}, + headers=HEADER_LSS_REMIX_VERSION_1_0 + ) + if r.status_code != 200: + response_dict = json.loads(r.text) + raise ValueError(response_dict.get("detail", "Wrong request value")) + result_texture_types = json.loads(r.text).get("asset_paths", []) + + if not result_texture_types: + raise ValueError( + f"Can't get texture type using the USD attribute {usd_attribute} and texture type {texture_type}" + ) + + return (result_texture_types[0],) diff --git a/nodes/utils.py b/nodes/utils.py new file mode 100644 index 0000000..fafa9cb --- /dev/null +++ b/nodes/utils.py @@ -0,0 +1,40 @@ +""" +* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +* SPDX-License-Identifier: Apache-2.0 +* +* Licensed 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 +* +* https://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. +""" + + +def merge_dict(source: dict, destination: dict) -> dict: + """ + Took from https://stackoverflow.com/questions/20656135/python-deep-merge-dictionary-data + run me with nosetests --with-doctest file.py + + Examples: + >>> a = { 'first' : { 'all_rows' : { 'pass' : 'dog', 'number' : '1' } } } + >>> b = { 'first' : { 'all_rows' : { 'fail' : 'cat', 'number' : '5' } } } + >>> merge_dict(b, a) == { 'first' : { 'all_rows' : { 'pass' : 'dog', 'fail' : 'cat', 'number' : '5' } } } + + Returns: + True + """ + for key, value in source.items(): + if isinstance(value, dict): + # get node or create one + node = destination.setdefault(key, {}) + merge_dict(value, node) + else: + destination[key] = value + + return destination diff --git a/repo.bat b/repo.bat new file mode 100644 index 0000000..6e713c6 --- /dev/null +++ b/repo.bat @@ -0,0 +1,10 @@ +@echo off + +call "%~dp0tools\packman\python.bat" "%~dp0tools\repoman\repoman.py" %* +if %errorlevel% neq 0 ( goto Error ) + +:Success +exit /b 0 + +:Error +exit /b %errorlevel% diff --git a/repo.sh b/repo.sh new file mode 100644 index 0000000..a5649e4 --- /dev/null +++ b/repo.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +SCRIPT_DIR=$(dirname ${BASH_SOURCE}) +cd "$SCRIPT_DIR" + +exec "tools/packman/python.sh" tools/repoman/repoman.py "$@" diff --git a/repo.toml b/repo.toml new file mode 100644 index 0000000..ccb3b18 --- /dev/null +++ b/repo.toml @@ -0,0 +1,26 @@ +######################################################################################################################## +# Repo tool base settings +######################################################################################################################## + +[repo] +logging = "warn" + +# Reposiory Name. It is used for solution name and final package name +name = "ComfyUI-RTX_Remix" + + +# python is formatted with black+isort: +[repo_format.python] +files.include = ["nodes/*.py"] +files.exclude = [] +python_version = "py311" +job_count = 1 + + +######################################################################################################################## +# Python lint tool +######################################################################################################################## + +[repo_lint.flake8] +files.include = ["nodes/*.py"] +files.exclude = [] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d1d86fa --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +numpy +pillow>=10.0.1 +requests +torch +torchvision +torchaudio \ No newline at end of file diff --git a/tools/packman/bootstrap/configure.bat b/tools/packman/bootstrap/configure.bat new file mode 100644 index 0000000..c8ea829 --- /dev/null +++ b/tools/packman/bootstrap/configure.bat @@ -0,0 +1,169 @@ +:: Copyright 2019-2023 NVIDIA CORPORATION +:: +:: Licensed 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 PM_PACKMAN_VERSION=7.21.2 + +:: Specify where packman command is rooted +set PM_INSTALL_PATH=%~dp0.. + +:: The external root may already be configured and we should do minimal work in that case +if defined PM_PACKAGES_ROOT goto ENSURE_DIR + +:: If the folder isn't set we assume that the best place for it is on the drive that we are currently +:: running from +set PM_DRIVE=%CD:~0,2% + +set PM_PACKAGES_ROOT=%PM_DRIVE%\packman-repo + +:: We use *setx* here so that the variable is persisted in the user environment +echo Setting user environment variable PM_PACKAGES_ROOT to %PM_PACKAGES_ROOT% +setx PM_PACKAGES_ROOT %PM_PACKAGES_ROOT% +if %errorlevel% neq 0 ( goto ERROR ) + +:: The above doesn't work properly from a build step in VisualStudio because a separate process is +:: spawned for it so it will be lost for subsequent compilation steps - VisualStudio must +:: be launched from a new process. We catch this odd-ball case here: +if defined PM_DISABLE_VS_WARNING goto ENSURE_DIR +if not defined VSLANG goto ENSURE_DIR +echo The above is a once-per-computer operation. Unfortunately VisualStudio cannot pick up environment change +echo unless *VisualStudio is RELAUNCHED*. +echo If you are launching VisualStudio from command line or command line utility make sure +echo you have a fresh launch environment (relaunch the command line or utility). +echo If you are using 'linkPath' and referring to packages via local folder links you can safely ignore this warning. +echo You can disable this warning by setting the environment variable PM_DISABLE_VS_WARNING. +echo. + +:: Check for the directory that we need. Note that mkdir will create any directories +:: that may be needed in the path +:ENSURE_DIR +if not exist "%PM_PACKAGES_ROOT%" ( + echo Creating packman packages cache at %PM_PACKAGES_ROOT% + mkdir "%PM_PACKAGES_ROOT%" +) +if %errorlevel% neq 0 ( goto ERROR_MKDIR_PACKAGES_ROOT ) + +:: The Python interpreter may already be externally configured +if defined PM_PYTHON_EXT ( + set PM_PYTHON=%PM_PYTHON_EXT% + goto PACKMAN +) + +set PM_PYTHON_VERSION=3.10.5-1-windows-x86_64 +set PM_PYTHON_BASE_DIR=%PM_PACKAGES_ROOT%\python +set PM_PYTHON_DIR=%PM_PYTHON_BASE_DIR%\%PM_PYTHON_VERSION% +set PM_PYTHON=%PM_PYTHON_DIR%\python.exe + +if exist "%PM_PYTHON%" goto PACKMAN +if not exist "%PM_PYTHON_BASE_DIR%" call :CREATE_PYTHON_BASE_DIR + +set PM_PYTHON_PACKAGE=python@%PM_PYTHON_VERSION%.cab +for /f "delims=" %%a in ('powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0\generate_temp_file_name.ps1"') do set TEMP_FILE_NAME=%%a +set TARGET=%TEMP_FILE_NAME%.zip +call "%~dp0fetch_file_from_packman_bootstrap.cmd" %PM_PYTHON_PACKAGE% "%TARGET%" +if %errorlevel% neq 0 ( + echo !!! Error fetching python from CDN !!! + goto ERROR +) + +for /f "delims=" %%a in ('powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0\generate_temp_folder.ps1" -parentPath "%PM_PYTHON_BASE_DIR%"') do set TEMP_FOLDER_NAME=%%a +echo Unpacking Python interpreter ... +"%SystemRoot%\system32\expand.exe" -F:* "%TARGET%" "%TEMP_FOLDER_NAME%" 1> nul +del "%TARGET%" +:: Failure during extraction to temp folder name, need to clean up and abort +if %errorlevel% neq 0 ( + echo !!! Error unpacking python !!! + call :CLEAN_UP_TEMP_FOLDER + goto ERROR +) + +:: If python has now been installed by a concurrent process we need to clean up and then continue +if exist "%PM_PYTHON%" ( + call :CLEAN_UP_TEMP_FOLDER + goto PACKMAN +) else ( + if exist "%PM_PYTHON_DIR%" ( rd /s /q "%PM_PYTHON_DIR%" > nul ) +) + +:: Perform atomic move (allowing overwrite, /y) +move /y "%TEMP_FOLDER_NAME%" "%PM_PYTHON_DIR%" 1> nul +:: Verify that python.exe is now where we expect +if exist "%PM_PYTHON%" goto PACKMAN + +:: Wait a second and try again (can help with access denied weirdness) +timeout /t 1 /nobreak 1> nul +move /y "%TEMP_FOLDER_NAME%" "%PM_PYTHON_DIR%" 1> nul +if %errorlevel% neq 0 ( + echo !!! Error moving python %TEMP_FOLDER_NAME% -> %PM_PYTHON_DIR% !!! + call :CLEAN_UP_TEMP_FOLDER + goto ERROR +) + +:PACKMAN +:: The packman module may already be externally configured +if defined PM_MODULE_DIR_EXT ( + set PM_MODULE_DIR=%PM_MODULE_DIR_EXT% +) else ( + set PM_MODULE_DIR=%PM_PACKAGES_ROOT%\packman-common\%PM_PACKMAN_VERSION% +) + +set PM_MODULE=%PM_MODULE_DIR%\run.py + +if exist "%PM_MODULE%" goto END + +:: Clean out broken PM_MODULE_DIR if it exists +if exist "%PM_MODULE_DIR%" ( rd /s /q "%PM_MODULE_DIR%" > nul ) + +set PM_MODULE_PACKAGE=packman-common@%PM_PACKMAN_VERSION%.zip +for /f "delims=" %%a in ('powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0\generate_temp_file_name.ps1"') do set TEMP_FILE_NAME=%%a +set TARGET=%TEMP_FILE_NAME% +call "%~dp0fetch_file_from_packman_bootstrap.cmd" %PM_MODULE_PACKAGE% "%TARGET%" +if %errorlevel% neq 0 ( + echo !!! Error fetching packman from CDN !!! + goto ERROR +) + +echo Unpacking ... +"%PM_PYTHON%" -S -s -u -E "%~dp0\install_package.py" "%TARGET%" "%PM_MODULE_DIR%" +if %errorlevel% neq 0 ( + echo !!! Error unpacking packman !!! + goto ERROR +) + +del "%TARGET%" + +goto END + +:ERROR_MKDIR_PACKAGES_ROOT +echo Failed to automatically create packman packages repo at %PM_PACKAGES_ROOT%. +echo Please set a location explicitly that packman has permission to write to, by issuing: +echo. +echo setx PM_PACKAGES_ROOT {path-you-choose-for-storing-packman-packages-locally} +echo. +echo Then launch a new command console for the changes to take effect and run packman command again. +exit /B %errorlevel% + +:ERROR +echo !!! Failure while configuring local machine :( !!! +exit /B %errorlevel% + +:CLEAN_UP_TEMP_FOLDER +rd /S /Q "%TEMP_FOLDER_NAME%" +exit /B + +:CREATE_PYTHON_BASE_DIR +:: We ignore errors and clean error state - if two processes create the directory one will fail which is fine +md "%PM_PYTHON_BASE_DIR%" > nul 2>&1 +exit /B 0 + +:END diff --git a/tools/packman/bootstrap/download_file_from_url.ps1 b/tools/packman/bootstrap/download_file_from_url.ps1 new file mode 100644 index 0000000..df55745 --- /dev/null +++ b/tools/packman/bootstrap/download_file_from_url.ps1 @@ -0,0 +1,53 @@ +<# +Copyright 2019 NVIDIA CORPORATION + +Licensed 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. +#> + +param( +[Parameter(Mandatory=$true)][string]$source=$null, +[string]$output="out.exe" +) +$filename = $output + +$triesLeft = 4 +$delay = 2 +do +{ + $triesLeft -= 1 + + try + { + Write-Host "Downloading from bootstrap.packman.nvidia.com ..." + $wc = New-Object net.webclient + $wc.Downloadfile($source, $fileName) + exit 0 + } + catch + { + Write-Host "Error downloading $source!" + Write-Host $_.Exception|format-list -force + if ($triesLeft) + { + Write-Host "Retrying in $delay seconds ..." + Start-Sleep -seconds $delay + } + $delay = $delay * $delay + } +} while ($triesLeft -gt 0) +# We only get here if the retries have been exhausted, remove any left-overs: +if (Test-Path $fileName) +{ + Remove-Item $fileName +} +exit 1 \ No newline at end of file diff --git a/tools/packman/bootstrap/fetch_file_from_packman_bootstrap.cmd b/tools/packman/bootstrap/fetch_file_from_packman_bootstrap.cmd new file mode 100644 index 0000000..bf3a88d --- /dev/null +++ b/tools/packman/bootstrap/fetch_file_from_packman_bootstrap.cmd @@ -0,0 +1,35 @@ +:: Copyright 2019 NVIDIA CORPORATION +:: +:: Licensed 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. + +:: You need to specify as input to this command +@setlocal +@set PACKAGE_NAME=%1 +@set TARGET_PATH=%2 + +@echo Fetching %PACKAGE_NAME% ... + +@powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0download_file_from_url.ps1" ^ + -source "http://bootstrap.packman.nvidia.com/%PACKAGE_NAME%" -output %TARGET_PATH% +:: A bug in powershell prevents the errorlevel code from being set when using the -File execution option +:: We must therefore do our own failure analysis, basically make sure the file exists: +@if not exist %TARGET_PATH% goto ERROR_DOWNLOAD_FAILED + +@endlocal +@exit /b 0 + +:ERROR_DOWNLOAD_FAILED +@echo Failed to download file from S3 +@echo Most likely because endpoint cannot be reached or file %PACKAGE_NAME% doesn't exist +@endlocal +@exit /b 1 \ No newline at end of file diff --git a/tools/packman/bootstrap/generate_temp_file_name.ps1 b/tools/packman/bootstrap/generate_temp_file_name.ps1 new file mode 100644 index 0000000..aa3f004 --- /dev/null +++ b/tools/packman/bootstrap/generate_temp_file_name.ps1 @@ -0,0 +1,161 @@ +<# +Copyright 2019 NVIDIA CORPORATION + +Licensed 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. +#> + +$out = [System.IO.Path]::GetTempFileName() +Write-Host $out +# SIG # Begin signature block +# MIIaVwYJKoZIhvcNAQcCoIIaSDCCGkQCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAK+Ewup1N0/mdf +# 1l4R58rxyumHgZvTmEhrYTb2Zf0zd6CCCiIwggTTMIIDu6ADAgECAhBi50XpIWUh +# PJcfXEkK6hKlMA0GCSqGSIb3DQEBCwUAMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UE +# ChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0 +# IE5ldHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUg +# U2lnbmluZyBDQSAtIEcyMB4XDTE4MDcwOTAwMDAwMFoXDTIxMDcwOTIzNTk1OVow +# gYMxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRQwEgYDVQQHDAtT +# YW50YSBDbGFyYTEbMBkGA1UECgwSTlZJRElBIENvcnBvcmF0aW9uMQ8wDQYDVQQL +# DAZJVC1NSVMxGzAZBgNVBAMMEk5WSURJQSBDb3Jwb3JhdGlvbjCCASIwDQYJKoZI +# hvcNAQEBBQADggEPADCCAQoCggEBALEZN63dA47T4i90jZ84CJ/aWUwVtLff8AyP +# YspFfIZGdZYiMgdb8A5tBh7653y0G/LZL6CVUkgejcpvBU/Dl/52a+gSWy2qJ2bH +# jMFMKCyQDhdpCAKMOUKSC9rfzm4cFeA9ct91LQCAait4LhLlZt/HF7aG+r0FgCZa +# HJjJvE7KNY9G4AZXxjSt8CXS8/8NQMANqjLX1r+F+Hl8PzQ1fVx0mMsbdtaIV4Pj +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l22dHv1VjMiLyI2 +# skuiSpXY9aaOUjGCAk0wggJJAgEBMIGGMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK +# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNV +# BAMTKERpZ2lDZXJ0IFNIQTIgQXNzdXJlZCBJRCBUaW1lc3RhbXBpbmcgQ0ECEA1C +# SuC+Ooj/YEAhzhQA8N0wDQYJYIZIAWUDBAIBBQCggZgwGgYJKoZIhvcNAQkDMQ0G +# CyqGSIb3DQEJEAEEMBwGCSqGSIb3DQEJBTEPFw0yMTA0MDgwOTExMDlaMCsGCyqG +# SIb3DQEJEAIMMRwwGjAYMBYEFOHXgqjhkb7va8oWkbWqtJSmJJvzMC8GCSqGSIb3 +# DQEJBDEiBCCHEAmNNj2zWjWYRfEi4FgzZvrI16kv/U2b9b3oHw6UVDANBgkqhkiG +# 9w0BAQEFAASCAQCdefEKh6Qmwx7xGCkrYi/A+/Cla6LdnYJp38eMs3fqTTvjhyDw +# HffXrwdqWy5/fgW3o3qJXqa5o7hLxYIoWSULOCpJRGdt+w7XKPAbZqHrN9elAhWJ +# vpBTCEaj7dVxr1Ka4NsoPSYe0eidDBmmvGvp02J4Z1j8+ImQPKN6Hv/L8Ixaxe7V +# mH4VtXIiBK8xXdi4wzO+A+qLtHEJXz3Gw8Bp3BNtlDGIUkIhVTM3Q1xcSEqhOLqo +# PGdwCw9acxdXNWWPjOJkNH656Bvmkml+0p6MTGIeG4JCeRh1Wpqm1ZGSoEcXNaof +# wOgj48YzI+dNqBD9i7RSWCqJr2ygYKRTxnuU +# SIG # End signature block diff --git a/tools/packman/bootstrap/generate_temp_folder.ps1 b/tools/packman/bootstrap/generate_temp_folder.ps1 new file mode 100644 index 0000000..d34fc9c --- /dev/null +++ b/tools/packman/bootstrap/generate_temp_folder.ps1 @@ -0,0 +1,167 @@ +<# +Copyright 2019 NVIDIA CORPORATION + +Licensed 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. +#> + +param( +[Parameter(Mandatory=$true)][string]$parentPath=$null +) +[string] $name = [System.Guid]::NewGuid() +$out = Join-Path $parentPath $name +New-Item -ItemType Directory -Path ($out) | Out-Null +Write-Host $out + +# SIG # Begin signature block +# MIIaVwYJKoZIhvcNAQcCoIIaSDCCGkQCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCB29nsqMEu+VmSF +# 7ckeVTPrEZ6hsXjOgPFlJm9ilgHUB6CCCiIwggTTMIIDu6ADAgECAhBi50XpIWUh +# PJcfXEkK6hKlMA0GCSqGSIb3DQEBCwUAMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UE +# ChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0 +# IE5ldHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUg +# U2lnbmluZyBDQSAtIEcyMB4XDTE4MDcwOTAwMDAwMFoXDTIxMDcwOTIzNTk1OVow +# gYMxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRQwEgYDVQQHDAtT +# YW50YSBDbGFyYTEbMBkGA1UECgwSTlZJRElBIENvcnBvcmF0aW9uMQ8wDQYDVQQL +# DAZJVC1NSVMxGzAZBgNVBAMMEk5WSURJQSBDb3Jwb3JhdGlvbjCCASIwDQYJKoZI +# hvcNAQEBBQADggEPADCCAQoCggEBALEZN63dA47T4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3oVA38afiM +# SIG # End signature block diff --git a/tools/packman/bootstrap/install_package.py b/tools/packman/bootstrap/install_package.py new file mode 100644 index 0000000..240dd02 --- /dev/null +++ b/tools/packman/bootstrap/install_package.py @@ -0,0 +1,172 @@ +# Copyright 2019 NVIDIA CORPORATION + +# Licensed 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. + +import logging +import zipfile +import tempfile +import sys +import os +import stat +import time +import hashlib +from typing import Any, Callable, Union + + +RENAME_RETRY_COUNT = 100 +RENAME_RETRY_DELAY = 0.1 + +logging.basicConfig(level=logging.WARNING, format="%(message)s") +logger = logging.getLogger("install_package") + + +def remove_directory_item(path): + if os.path.islink(path) or os.path.isfile(path): + try: + os.remove(path) + except PermissionError: + # make sure we have access and try again: + os.chmod(path, stat.S_IRWXU) + os.remove(path) + else: + # try first to delete the dir because this will work for folder junctions, otherwise we would follow the junctions and cause destruction! + clean_out_folder = False + try: + # make sure we have access preemptively - this is necessary because recursing into a directory without permissions + # will only lead to heart ache + os.chmod(path, stat.S_IRWXU) + os.rmdir(path) + except OSError: + clean_out_folder = True + + if clean_out_folder: + # we should make sure the directory is empty + names = os.listdir(path) + for name in names: + fullname = os.path.join(path, name) + remove_directory_item(fullname) + # now try to again get rid of the folder - and not catch if it raises: + os.rmdir(path) + + +class StagingDirectory: + def __init__(self, staging_path): + self.staging_path = staging_path + self.temp_folder_path = None + os.makedirs(staging_path, exist_ok=True) + + def __enter__(self): + self.temp_folder_path = tempfile.mkdtemp(prefix="ver-", dir=self.staging_path) + return self + + def get_temp_folder_path(self): + return self.temp_folder_path + + # this function renames the temp staging folder to folder_name, it is required that the parent path exists! + def promote_and_rename(self, folder_name): + abs_dst_folder_name = os.path.join(self.staging_path, folder_name) + os.rename(self.temp_folder_path, abs_dst_folder_name) + + def __exit__(self, type, value, traceback): + # Remove temp staging folder if it's still there (something went wrong): + path = self.temp_folder_path + if os.path.isdir(path): + remove_directory_item(path) + + +def rename_folder(staging_dir: StagingDirectory, folder_name: str): + try: + staging_dir.promote_and_rename(folder_name) + except OSError as exc: + # if we failed to rename because the folder now exists we can assume that another packman process + # has managed to update the package before us - in all other cases we re-raise the exception + abs_dst_folder_name = os.path.join(staging_dir.staging_path, folder_name) + if os.path.exists(abs_dst_folder_name): + logger.warning( + f"Directory {abs_dst_folder_name} already present, package installation already completed" + ) + else: + raise + + +def call_with_retry( + op_name: str, func: Callable, retry_count: int = 3, retry_delay: float = 20 +) -> Any: + retries_left = retry_count + while True: + try: + return func() + except (OSError, IOError) as exc: + logger.warning(f"Failure while executing {op_name} [{str(exc)}]") + if retries_left: + retry_str = "retry" if retries_left == 1 else "retries" + logger.warning( + f"Retrying after {retry_delay} seconds" + f" ({retries_left} {retry_str} left) ..." + ) + time.sleep(retry_delay) + else: + logger.error("Maximum retries exceeded, giving up") + raise + retries_left -= 1 + + +def rename_folder_with_retry(staging_dir: StagingDirectory, folder_name): + dst_path = os.path.join(staging_dir.staging_path, folder_name) + call_with_retry( + f"rename {staging_dir.get_temp_folder_path()} -> {dst_path}", + lambda: rename_folder(staging_dir, folder_name), + RENAME_RETRY_COUNT, + RENAME_RETRY_DELAY, + ) + + +def generate_sha256_for_file(file_path: Union[str, os.PathLike]) -> str: + """Returns the SHA-256 hex digest for the file at `file_path`""" + hash = hashlib.sha256() + # Read the file in binary mode and update the hash object with data + with open(file_path, "rb") as file: + for chunk in iter(lambda: file.read(4096), b""): + hash.update(chunk) + return hash.hexdigest() + + +def install_common_module(package_path, install_path): + COMMON_SHA256 = "e5c8c49148bbaf049cfd27203936486942d5ded0b101d40984659c274b048a38" + package_sha256 = generate_sha256_for_file(package_path) + if package_sha256 != COMMON_SHA256: + raise RuntimeError( + f"Package at '{package_path}' must have a sha256 of '{COMMON_SHA256}' " + f"but was found to have '{package_sha256}'" + ) + staging_path, version = os.path.split(install_path) + with StagingDirectory(staging_path) as staging_dir: + output_folder = staging_dir.get_temp_folder_path() + with zipfile.ZipFile(package_path, allowZip64=True) as zip_file: + zip_file.extractall(output_folder) + + # attempt the rename operation + rename_folder_with_retry(staging_dir, version) + + print(f"Package successfully installed to {install_path}") + + +if __name__ == "__main__": + executable_paths = os.getenv("PATH") + paths_list = executable_paths.split(os.path.pathsep) if executable_paths else [] + target_path_np = os.path.normpath(sys.argv[2]) + target_path_np_nc = os.path.normcase(target_path_np) + for exec_path in paths_list: + if os.path.normcase(os.path.normpath(exec_path)) == target_path_np_nc: + raise RuntimeError(f"packman will not install to executable path '{exec_path}'") + install_common_module(sys.argv[1], target_path_np) diff --git a/tools/packman/config.packman.xml b/tools/packman/config.packman.xml new file mode 100644 index 0000000..c4aff4d --- /dev/null +++ b/tools/packman/config.packman.xml @@ -0,0 +1,9 @@ + + + + + + + + diff --git a/tools/packman/packman b/tools/packman/packman new file mode 100644 index 0000000..d2c2af7 --- /dev/null +++ b/tools/packman/packman @@ -0,0 +1,192 @@ +#!/bin/bash + +# Copyright 2019-2023 NVIDIA CORPORATION + +# Licensed 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. +SAVED_SETTINGS="$-" +set -eu + +if echo ${PM_VERBOSITY-} | grep -i "debug" > /dev/null ; then + set -x + PM_CURL_SILENT="" + PM_WGET_QUIET="" +else + PM_CURL_SILENT="-s -S" + PM_WGET_QUIET="--quiet" +fi +export PM_PACKMAN_VERSION=7.21.2 + +# This is necessary for newer macOS +if [ `uname` == 'Darwin' ]; then + export LC_ALL=en_US.UTF-8 + export LANG=en_US.UTF-8 +fi + +# We cannot rely on realpath, it isn't installed on macOS and some Linux distros +get_abs_filename() { + echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" +} + +# Specify where packman command exists +export PM_INSTALL_PATH="$(get_abs_filename "$(dirname "${BASH_SOURCE}")")" + +# The packages root may already be configured by the user +if [ -z "${PM_PACKAGES_ROOT:-}" ]; then + # Set variable temporarily in this process so that the following execution will work + if [ `uname` == 'Darwin' ]; then + export PM_PACKAGES_ROOT="${HOME}/Library/Application Support/packman-cache" + else + if [ -z "${XDG_CACHE_HOME:-}" ]; then + export PM_PACKAGES_ROOT="${HOME}/.cache/packman" + else + export PM_PACKAGES_ROOT="${XDG_CACHE_HOME}/packman" + fi + fi +fi + +# Ensure the packages root path exists: +if [ ! -d "$PM_PACKAGES_ROOT" ]; then + echo "Creating packman packages cache at $PM_PACKAGES_ROOT" + mkdir -p -m a+rwx "$PM_PACKAGES_ROOT" +fi + +fetch_file_from_s3() +{ + SOURCE=$1 + SOURCE_URL=http://bootstrap.packman.nvidia.com/$SOURCE + TARGET=$2 + echo "Fetching $SOURCE from bootstrap.packman.nvidia.com ..." + if command -v wget >/dev/null 2>&1; then + wget $PM_WGET_QUIET -O$TARGET $SOURCE_URL + else + curl -o $TARGET $SOURCE_URL $PM_CURL_SILENT + fi +} + +generate_temp_file_name() +{ + if [ `uname` == "Darwin" ]; then + local tmpfile=`mktemp -t packman` + else + local tmpfile=`mktemp -t packman.XXXXXXXX` + fi + echo "$tmpfile" +} + +install_python() +{ + PLATFORM=`uname` + PROCESSOR=`uname -m` + PYTHON_VERSION=3.10.5-1 + + if [ $PLATFORM == 'Darwin' ]; then + PYTHON_PACKAGE=$PYTHON_VERSION-macos-x86_64 + elif [ $PLATFORM == 'Linux' ] && [ $PROCESSOR == 'x86_64' ]; then + PYTHON_PACKAGE=$PYTHON_VERSION-linux-x86_64 + elif [ $PLATFORM == 'Linux' ] && [ $PROCESSOR == 'aarch64' ]; then + PYTHON_PACKAGE=$PYTHON_VERSION-linux-aarch64 + else + echo "Operating system not supported" + exit 1 + fi + + PYTHON_INSTALL_FOLDER="$PM_PACKAGES_ROOT/python/$PYTHON_PACKAGE" + if [ ! -d "$PYTHON_INSTALL_FOLDER" ]; then + mkdir -p "$PYTHON_INSTALL_FOLDER" + fi + + export PM_PYTHON="$PYTHON_INSTALL_FOLDER/python" + + if [ ! -f "$PM_PYTHON" ]; then + PYTHON_PACKAGE_TMP=$(generate_temp_file_name) + fetch_file_from_s3 "python@$PYTHON_PACKAGE.tar.gz" "$PYTHON_PACKAGE_TMP" + if [ "$?" -eq "0" ]; then + echo "Unpacking python" + tar -xf "$PYTHON_PACKAGE_TMP" -C "$PYTHON_INSTALL_FOLDER" + rm "$PYTHON_PACKAGE_TMP" + else + echo "Failed downloading the Python interpreter" + exit $? + fi + fi +} + +# Ensure python is available: +if [ -z "${PM_PYTHON_EXT:-}" ]; then + install_python +else + PM_PYTHON="$PM_PYTHON_EXT" +fi + +# The packman module may be externally configured +if [ -z "${PM_MODULE_DIR_EXT:-}" ]; then + PM_MODULE_DIR="$PM_PACKAGES_ROOT/packman-common/$PM_PACKMAN_VERSION" +else + PM_MODULE_DIR="$PM_MODULE_DIR_EXT" +fi +export PM_MODULE="$PM_MODULE_DIR/run.py" + +# Ensure the packman package exists: +if [ ! -f "$PM_MODULE" ]; then + # Remove a previously corrupt packman-common if it's there + if [ -d "$PM_MODULE_DIR" ]; then + rm -rf "$PM_MODULE_DIR" + fi + PM_MODULE_PACKAGE="packman-common@$PM_PACKMAN_VERSION.zip" + TARGET=$(generate_temp_file_name) + # We always fetch packman from S3: + fetch_file_from_s3 "$PM_MODULE_PACKAGE" "$TARGET" + if [ "$?" -eq "0" ]; then + echo "Unpacking ..." + "$PM_PYTHON" -S -s -u -E "$PM_INSTALL_PATH/bootstrap/install_package.py" "$TARGET" "$PM_MODULE_DIR" + rm "$TARGET" + else + echo "Failure while fetching packman module from S3!" + exit 1 + fi +fi + +# Generate temporary file name for environment variables: +PM_VAR_PATH=`mktemp -u -t tmp.$$.pmvars.XXXXXX` + +if [ $# -ne 0 ] + then + PM_VAR_PATH_ARG=--var-path="$PM_VAR_PATH" +fi + +"$PM_PYTHON" -S -s -u -E "$PM_MODULE" "$@" ${PM_VAR_PATH_ARG:-} +exit_code=$? +# Export the variables if the file was used and remove the file: +if [ -f "$PM_VAR_PATH" ]; then + while read -r line + do + if [ ${#line} -gt 0 ]; then + export "$line" + fi + done < "$PM_VAR_PATH" + rm -f "$PM_VAR_PATH" +fi + +# avoid leaking -e and -u into the host script if they weren't originally set +if [[ ! ( "$SAVED_SETTINGS" =~ e ) ]]; then + set +e +fi + +if [[ ! ( "$SAVED_SETTINGS" =~ u ) ]]; then + set +u +fi + +# Return the exit code from python +if [ "$exit_code" != 0 ]; then + exit "$exit_code" +fi diff --git a/tools/packman/packman.cmd b/tools/packman/packman.cmd new file mode 100644 index 0000000..e55b2f0 --- /dev/null +++ b/tools/packman/packman.cmd @@ -0,0 +1,89 @@ +:: RUN_PM_MODULE must always be at the same spot for packman update to work (batch reloads file during update!) +:: [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx] +:: Reset errorlevel status (don't inherit from caller) +@call :ECHO_AND_RESET_ERROR + +:: You can remove this section if you do your own manual configuration of the dev machines +call :CONFIGURE +if %errorlevel% neq 0 ( exit /b %errorlevel% ) + +:: Everything below is mandatory +if not defined PM_PYTHON goto :PYTHON_ENV_ERROR +if not defined PM_MODULE goto :MODULE_ENV_ERROR + +set PM_VAR_PATH_ARG= + +if "%1"=="pull" goto :SET_VAR_PATH +if "%1"=="install" goto :SET_VAR_PATH + +:RUN_PM_MODULE +"%PM_PYTHON%" -S -s -u -E "%PM_MODULE%" %* %PM_VAR_PATH_ARG% +if %errorlevel% neq 0 ( exit /b %errorlevel% ) + +:: Marshall environment variables into the current environment if they have been generated and remove temporary file +if exist "%PM_VAR_PATH%" ( + for /F "usebackq tokens=*" %%A in ("%PM_VAR_PATH%") do set "%%A" +) +if %errorlevel% neq 0 ( goto :VAR_ERROR ) + +if exist "%PM_VAR_PATH%" ( + del /F "%PM_VAR_PATH%" +) +if %errorlevel% neq 0 ( goto :VAR_ERROR ) + +set PM_VAR_PATH= +goto :eof + +:: Subroutines below +:PYTHON_ENV_ERROR +@echo User environment variable PM_PYTHON is not set! Please configure machine for packman or call configure.bat. +exit /b 1 + +:MODULE_ENV_ERROR +@echo User environment variable PM_MODULE is not set! Please configure machine for packman or call configure.bat. +exit /b 1 + +:VAR_ERROR +@echo Error while processing and setting environment variables! +exit /b 1 + +:: pad [xxxx] +:ECHO_AND_RESET_ERROR +@echo off +if /I "%PM_VERBOSITY%"=="debug" ( + @echo on +) +exit /b 0 + +:SET_VAR_PATH +:: Generate temporary path for variable file +for /f "delims=" %%a in ('%PM_PYTHON% -S -s -u -E -c "import tempfile;file = tempfile.NamedTemporaryFile(mode='w+t', delete=False);print(file.name)"') do (set PM_VAR_PATH=%%a) +set PM_VAR_PATH_ARG=--var-path="%PM_VAR_PATH%" +goto :RUN_PM_MODULE + +:CONFIGURE +:: Must capture and set code page to work around issue #279, powershell invocation mutates console font +:: This issue only happens in Windows CMD shell when using 65001 code page. Some Git Bash implementations +:: don't support chcp so this workaround is a bit convoluted. +:: Test for chcp: +chcp > nul 2>&1 +if %errorlevel% equ 0 ( + for /f "tokens=2 delims=:" %%a in ('chcp') do (set PM_OLD_CODE_PAGE=%%a) +) else ( + call :ECHO_AND_RESET_ERROR +) +:: trim leading space (this is safe even when PM_OLD_CODE_PAGE has not been set) +set PM_OLD_CODE_PAGE=%PM_OLD_CODE_PAGE:~1% +if "%PM_OLD_CODE_PAGE%" equ "65001" ( + chcp 437 > nul + set PM_RESTORE_CODE_PAGE=1 +) +call "%~dp0\bootstrap\configure.bat" +set PM_CONFIG_ERRORLEVEL=%errorlevel% +if defined PM_RESTORE_CODE_PAGE ( + :: Restore code page + chcp %PM_OLD_CODE_PAGE% > nul +) +set PM_OLD_CODE_PAGE= +set PM_RESTORE_CODE_PAGE= +exit /b %PM_CONFIG_ERRORLEVEL% diff --git a/tools/packman/packmanconf.py b/tools/packman/packmanconf.py new file mode 100644 index 0000000..6afae51 --- /dev/null +++ b/tools/packman/packmanconf.py @@ -0,0 +1,112 @@ +# Use this file to bootstrap packman into your Python environment (3.7.x). Simply +# add the path by doing sys.insert to where packmanconf.py is located and then execute: +# +# >>> import packmanconf +# >>> packmanconf.init() +# +# It will use the configured remote(s) and the version of packman in the same folder, +# giving you full access to the packman API via the following module +# +# >> import packmanapi +# >> dir(packmanapi) + +import os +import platform +import sys + + +def init(): + """Call this function to initialize the packman configuration. + + Calls to the packman API will work after successfully calling this function. + + Note: + This function only needs to be called once during the execution of your + program. Calling it repeatedly is harmless but wasteful. + Compatibility with your Python interpreter is checked and upon failure + the function will report what is required. + + Example: + >>> import packmanconf + >>> packmanconf.init() + >>> import packmanapi + >>> packmanapi.set_verbosity_level(packmanapi.VERBOSITY_HIGH) + """ + major = sys.version_info.major + minor = sys.version_info.minor + patch = sys.version_info.micro + if major == 3 and (minor == 10 or (minor == 11 and patch <= 2)): + # we are good + pass + else: + raise RuntimeError( + f"This version of packman requires Python 3.10.0 up to 3.11.2, " + f"but {major}.{minor}.{patch} was provided" + ) + conf_dir = os.path.dirname(os.path.abspath(__file__)) + os.environ["PM_INSTALL_PATH"] = conf_dir + packages_root = get_packages_root(conf_dir) + version = get_version(conf_dir) + module_dir = get_module_dir(conf_dir, packages_root, version) + sys.path.insert(1, module_dir) + + +def get_packages_root(conf_dir: str) -> str: + root = os.getenv("PM_PACKAGES_ROOT") + if not root: + platform_name = platform.system() + if platform_name == "Windows": + drive, _ = os.path.splitdrive(conf_dir) + root = os.path.join(drive, "packman-repo") + elif platform_name == "Darwin": + # macOS + root = os.path.join( + os.path.expanduser("~"), "Library/Application Support/packman-cache" + ) + elif platform_name == "Linux": + try: + cache_root = os.environ["XDG_HOME_CACHE"] + except KeyError: + cache_root = os.path.join(os.path.expanduser("~"), ".cache") + return os.path.join(cache_root, "packman") + else: + raise RuntimeError(f"Unsupported platform '{platform_name}'") + # make sure the path exists: + os.makedirs(root, exist_ok=True) + return root + + +def get_module_dir(conf_dir, packages_root: str, version: str) -> str: + module_dir = os.path.join(packages_root, "packman-common", version) + if not os.path.exists(module_dir): + import tempfile + + tf = tempfile.NamedTemporaryFile(delete=False) + target_name = tf.name + tf.close() + url = f"http://bootstrap.packman.nvidia.com/packman-common@{version}.zip" + print(f"Downloading '{url}' ...") + import urllib.request + + urllib.request.urlretrieve(url, target_name) + from importlib.machinery import SourceFileLoader + + # import module from path provided + script_path = os.path.join(conf_dir, "bootstrap", "install_package.py") + ip = SourceFileLoader("install_package", script_path).load_module() + print("Unpacking ...") + ip.install_common_module(target_name, module_dir) + os.unlink(tf.name) + return module_dir + + +def get_version(conf_dir: str): + path = os.path.join(conf_dir, "packman") + if not os.path.exists(path): # in dev repo fallback + path += ".sh" + with open(path, "rt", encoding="utf8") as launch_file: + for line in launch_file.readlines(): + if "PM_PACKMAN_VERSION" in line: + _, value = line.split("=") + return value.strip() + raise RuntimeError(f"Unable to find 'PM_PACKMAN_VERSION' in '{path}'") diff --git a/tools/packman/python.bat b/tools/packman/python.bat new file mode 100644 index 0000000..08df74f --- /dev/null +++ b/tools/packman/python.bat @@ -0,0 +1,32 @@ +:: Copyright 2019-2020 NVIDIA CORPORATION +:: +:: Licensed 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. + +@echo off +setlocal enableextensions + +call "%~dp0\packman" init +set "PYTHONPATH=%PM_MODULE_DIR%;%PYTHONPATH%" + +if not defined PYTHONNOUSERSITE ( + set PYTHONNOUSERSITE=1 +) + +REM For performance, default to unbuffered; however, allow overriding via +REM PYTHONUNBUFFERED=0 since PYTHONUNBUFFERED on windows can truncate output +REM when printing long strings +if not defined PYTHONUNBUFFERED ( + set PYTHONUNBUFFERED=1 +) + +"%PM_PYTHON%" %* \ No newline at end of file diff --git a/tools/packman/python.sh b/tools/packman/python.sh new file mode 100644 index 0000000..74328bf --- /dev/null +++ b/tools/packman/python.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# Copyright 2019-2020 NVIDIA CORPORATION + +# Licensed 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 + +PACKMAN_CMD="$(dirname "${BASH_SOURCE}")/packman" +if [ ! -f "$PACKMAN_CMD" ]; then + PACKMAN_CMD="${PACKMAN_CMD}.sh" +fi +source "$PACKMAN_CMD" init +export PYTHONPATH="${PM_MODULE_DIR}:${PYTHONPATH}" + +if [ -z "${PYTHONNOUSERSITE:-}" ]; then + export PYTHONNOUSERSITE=1 +fi + +# For performance, default to unbuffered; however, allow overriding via +# PYTHONUNBUFFERED=0 since PYTHONUNBUFFERED on windows can truncate output +# when printing long strings +if [ -z "${PYTHONUNBUFFERED:-}" ]; then + export PYTHONUNBUFFERED=1 +fi + +# workaround for our python not shipping with certs +if [[ -z ${SSL_CERT_DIR:-} ]]; then + export SSL_CERT_DIR=/etc/ssl/certs/ +fi + +"${PM_PYTHON}" "$@" diff --git a/tools/repo-deps.packman.xml b/tools/repo-deps.packman.xml new file mode 100644 index 0000000..6be511d --- /dev/null +++ b/tools/repo-deps.packman.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/tools/repoman/repoman.py b/tools/repoman/repoman.py new file mode 100644 index 0000000..aeab2cc --- /dev/null +++ b/tools/repoman/repoman.py @@ -0,0 +1,25 @@ +import os +import sys +import packmanapi + +REPO_ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../..") +REPO_DEPS_FILE = os.path.join(REPO_ROOT, "tools/repo-deps.packman.xml") + + +def bootstrap(): + """ + Bootstrap all omni.repo modules. + + Pull with packman from repo.packman.xml and add them all to python sys.path to enable importing. + """ + deps = packmanapi.pull(REPO_DEPS_FILE) + for dep_path in deps.values(): + if dep_path not in sys.path: + sys.path.append(dep_path) + + +if __name__ == "__main__": + bootstrap() + import omni.repo.man + + omni.repo.man.main(REPO_ROOT)