## Details After migrating to engine python environment, there is no extra step required to launch resource mapping tool in editor. 1. This change is to migrate the editor tool launching process to engine python environment. 2. Add messagebox to show errors while using the tool 3. Note - as Qt binaries are not well organized in build directory, so separate out *AWSCore.ResourceMappintTool* target to group Qt binaries into independent build sub folder to solve the issue (temporarily, fix can be tracked by https://jira.agscollab.com/browse/LYN-2669, once fix is done, we can just remove this individual target) ## Testing Runs AWSCore.Editor.Tests ``` [----------] Global test environment tear-down [==========] 8 tests from 4 test cases ran. (161 ms total) [ PASSED ] 8 tests. ``` |
5 years ago | |
|---|---|---|
| .. | ||
| controller | 5 years ago | |
| manager | 5 years ago | |
| model | 5 years ago | |
| multithread | 5 years ago | |
| style | 5 years ago | |
| tests | 5 years ago | |
| utils | 5 years ago | |
| view | 5 years ago | |
| README.md | 5 years ago | |
| requirements.txt | 5 years ago | |
| resource_mapping_tool.py | 5 years ago | |
README.md
Welcome to the AWS Core Resource Mapping Tool project!
Setup aws config and credential
Resource mapping tool is using boto3 to interact with aws services:
- Read boto3 Configuration to setup default aws region.
- Read boto3 Credentials to setup default profile or credential keys.
Or follow AWS CLI configuration which can be reused by boto3 lib:
Python Environment Setup Options
1. Engine python environment (Including Editor)
-
In order to use engine python environment, it requires to link Qt binaries for this tool. Follow cmake instructions to configure your project, for example:
$ cmake -B <BUILD_FOLDER> -S . -G "Visual Studio 16 2019" -DLY_3RDPARTY_PATH=<PATH_TO_3RDPARTY> -DLY_PROJECTS=<PROJECT_NAME> -
At this point, double check engine python environment gets setup under <ENGINE_ROOT_PATH>/python/runtime directory
-
Build project with AWSCore.Editor (or AWSCore.ResourceMappintTool, or Editor) target to generate required Qt binaries.
$ cmake --build <BUILD_FOLDER> --target AWSCore.Editor --config <CONFIG> -j <NUM_JOBS> -
At this point, double check Qt binaries gets generated under <BUILD_FOLDER>/bin/<CONFIG_FOLDER>/AWSCoreEditorQtBin directory
-
Launch resource mapping tool under engine root folder:
- Windows
- release mode
$ python\python.cmd Gems\AWSCore\Code\Tools\ResourceMappingTool\resource_mapping_tool.py --binaries_path <PATH_TO_BUILD_FOLDER>\bin\profile\AWSCoreEditorQtBin- debug mode
$ python\python.cmd debug Gems\AWSCore\Code\Tools\ResourceMappingTool\resource_mapping_tool.py --binaries_path <PATH_TO_BUILD_FOLDER>\bin\debug\AWSCoreEditorQtBin
- Windows
- Note - Editor is integrated with the same engine python environment to launch Resource Mapping Tool. If it is failed to launch the tool in Editor, please follow above steps to make sure expected scripts/binaries are present.
2. Python virtual environment
This project is set up like a standard Python project. The initialization
process also creates a virtualenv within this project, stored under the .env
directory. To create the virtualenv it assumes that there is a python3
(or python for Windows) executable in your path with access to the venv
package. If for any reason the automatic creation of the virtualenv fails,
you can create the virtualenv manually.
-
To manually create a virtualenv:
- Windows
$ python -m venv .env- Mac or Linux
$ python3 -m venv .env -
Once the virtualenv is created, you can use the following step to activate your virtualenv:
- Windows
% .env\Scripts\activate.bat- Mac or Linux
$ source .env/bin/activate -
Once the virtualenv is activated, you can install the required dependencies:
- Windows
$ pip install -r requirements.txt- Mac or Linux
$ pip3 install -r requirements.txt -
At this point you can launch tool like other standard python project.
- Windows
$ python resource_mapping_tool.py- Mac or Linux
$ python3 resource_mapping_tool.py