|
| 1 | +--- |
| 2 | +# User change |
| 3 | +title: "Installing and Running Code Analysis Tools" |
| 4 | + |
| 5 | +weight: 4 |
| 6 | + |
| 7 | +layout: "learningpathall" |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +# migrate-ease |
| 12 | + |
| 13 | +[migrate-ease](https://github.com/migrate-ease/migrate-ease) is an open-source project designed to analyze codebases specifically for x86_64 architectures and offers tailored suggestions aimed at facilitating the migration process to AArch64. This tool streamlines the transition, ensuring a smooth and efficient evolution of your software to leverage the benefits of aarch64 architecture. |
| 14 | + |
| 15 | +## Pre-requisites |
| 16 | +Before you use migrate-ease, certain pre-requesites need to be installed. |
| 17 | +{{< tabpane code=true >}} |
| 18 | + {{< tab header="Ubuntu 22.04">}} |
| 19 | +sudo apt-get install -y python3 python3-pip python3-venv unzip libmagic1 git |
| 20 | + {{< /tab >}} |
| 21 | + {{< tab header="Debian trixie">}} |
| 22 | +sudo apt-get install -y python3 python3-pip python3-venv unzip libmagic1 git |
| 23 | + {{< /tab >}} |
| 24 | + {{< tab header="Fedora 42">}} |
| 25 | +sudo dnf install -y python3 python3-pip unzip git |
| 26 | + {{< /tab >}} |
| 27 | +{{< /tabpane >}} |
| 28 | + |
| 29 | +## Install and setup |
| 30 | +```bash |
| 31 | + |
| 32 | +# Check out the project |
| 33 | +git clone https://github.com/migrate-ease/migrate-ease |
| 34 | + |
| 35 | +# Check the project folder |
| 36 | +cd migrate-ease |
| 37 | + |
| 38 | +# Make sure you're at the root directory of migrate-ease |
| 39 | +# Enable Python Environment |
| 40 | +python3 -m venv .venv |
| 41 | +source .venv/bin/activate |
| 42 | + |
| 43 | +# install python packages dependencies |
| 44 | +pip3 install -r requirements.txt |
| 45 | +# Setup environment |
| 46 | +export PYTHONPATH=`pwd` |
| 47 | +``` |
| 48 | + |
| 49 | +## Usage |
| 50 | +### As Python script |
| 51 | + |
| 52 | +User can scan a project with a scanner type and the result is sent to console by default. |
| 53 | +```bash |
| 54 | +python3 -m {scanner_name} --arch {arch} {scan_path} |
| 55 | +``` |
| 56 | +Scan result can be exported as one of txt, csv, json or html. |
| 57 | + |
| 58 | +To generate a JSON report: |
| 59 | +```bash |
| 60 | +python3 -m {scanner_name} --output {result_file_name}.json --arch {arch} {scan_path} |
| 61 | +``` |
| 62 | + |
| 63 | +**Parameters** |
| 64 | + |
| 65 | +`{scanner_name}`: The name of the scanner, which can be one of cpp, docker, go, java, python, rust. |
| 66 | + |
| 67 | +`{result_file_name}`: The name of the export result file (without the extension). |
| 68 | + |
| 69 | +`{arch}`: The architecture type, `aarch64` is the default. |
| 70 | + |
| 71 | +`{scan_path}`: The path to the code that needs to be scanned. |
| 72 | + |
| 73 | +User can scan a git repository as well by given the URL. |
| 74 | +```bash |
| 75 | +python3 -m {scanner_name} --output {result_file_name}.json --arch {arch} --git-repo {repo} {clone_path} |
| 76 | +``` |
| 77 | +In the case of git repository scan, `{clone_path}` is a directory to hold the cloned code. This directory should be empty or to be created. |
| 78 | + |
| 79 | +There are more parameters for user to control the scan behaviors. To get these information user can get the built-in help |
| 80 | +```bash |
| 81 | +python3 -m {scanner_name} -h |
| 82 | +``` |
| 83 | + |
| 84 | +### As Web UI |
| 85 | +Migrate-ease also provides a Web UI that supports scanning a git repo with cpp, docker, go, java, python and rust scanners in one time. |
| 86 | +To start the web server, simply run: |
| 87 | +``` |
| 88 | +python3 web/server.py |
| 89 | +``` |
| 90 | + |
| 91 | +Once that is successfully done, you can access a web server hosted at http://localhost:8080 |
| 92 | + |
| 93 | +The web UI looks as following: |
| 94 | + |
| 95 | + |
| 96 | +A git repo URL is required, and you can specify certain branch name to scan. Once the necessary information is filled, user can click "START SCAN" button to proceed project scanning. |
| 97 | + |
| 98 | +Scanning progress will be shown in the console pane. Once all jobs are done, user will see a web page as following: |
| 99 | + |
| 100 | + |
| 101 | +You can download the result by clicking the "download" icon or view the result by clicking the "eye" icon. |
0 commit comments