Skip to content

Commit 686b7b4

Browse files
authored
Merge pull request #1945 from odincodeshen/main
Add migrate-ease LP
2 parents 8b75f40 + e4cb6ba commit 686b7b4

File tree

9 files changed

+460
-1
lines changed

9 files changed

+460
-1
lines changed

assets/contributors.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,4 @@ Yiyang Fan,Arm,,,,
8585
Julien Jayat,Arm,,,,
8686
Geremy Cohen,Arm,geremyCohen,geremyinanutshell,,
8787
Barbara Corriero,Arm,,,,
88-
88+
Jun He,Arm,JunHe77,jun-he-91969822,,
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
# User change
3+
title: "Why Code Scanning Matters for Arm Migration"
4+
5+
weight: 2
6+
7+
layout: "learningpathall"
8+
9+
---
10+
11+
### Overview of the Common Arm Migration Challenge
12+
13+
Migrating applications to Arm-based architectures is increasingly common across cloud, data center, and edge environments. Arm-powered servers and instances, such as AWS Graviton processors or Ampere Altra-based systems available on platforms like Google Cloud Platform, Microsoft Azure, Alibaba Cloud and Oracle Cloud Infrastructure (OCI), deliver significant performance-per-watt advantages and compelling cost-efficiency.
14+
15+
However, porting workloads to new CPU architecture often involves more than just recompiling. While many applications transition smoothly, others contain architecture-specific code or dependencies – developed originally for x86 – that can lead to build failures, runtime errors, or performance degradation on Arm systems.
16+
17+
Common challenges include detecting:
18+
* Hardcoded x86 SIMD intrinsics
19+
* Inline assembly
20+
* Platform-specific system calls
21+
* Unsupported compiler flags
22+
* Non-portable build scripts or logic
23+
24+
In large or legacy codebases, these issues are often buried in third-party libraries or auto-generated components, making manual inspection slow and unreliable.
25+
26+
### Automated Analysis for Portability
27+
To address these challenges proactively, automated static analysis tools play a critical role. Tools specifically designed for portability analysis enable developers to scan local codebases or remote repositories (e.g., GitHub) —and pinpoint architecture-specific constructs before attempting compilation or deployment on Arm. By surfacing portability concerns early in the development cycle, code scanning reduces time-to-first-build and helps prevent complex failures later.
28+
29+
In this learning path, we will introduce `migrate-ease`, a tool which allows developers to move beyond trial-and-error debugging. It provides clear, actionable insights into potential portability issues, detecting problematic patterns across many mainstream programming languages. These insights, combined with targeted refactoring, accelerate the process of making code portable, maintainable, and production-ready on Arm.
30+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
# User change
3+
title: "Supported Programming Languages and Common Issues Identified"
4+
5+
weight: 3
6+
7+
layout: "learningpathall"
8+
9+
---
10+
11+
### migrate-ease
12+
13+
This is a fork of [Porting advisor](https://github.com/arm-hpc/porting-advisor), an open source project by the Arm engineering team. Migrate-ease is maintained by the [OpenAnolis](https://github.com/openanolis) Arm Working Group.
14+
15+
16+
It is an innovative project designed to analyze codebases specifically for x86_64 architectures and offers tailored suggestions aimed at facilitating the migration process to aarch64.
17+
This tool streamlines the transition, ensuring a smooth and efficient evolution of your software to leverage the benefits of aarch64 architecture.
18+
At present, this tool only supports codebase migration to Linux. It can be run on Arm or non-Arm based machines. The tool does not modify any code, it does not provide API level recommendations, and it does not send any data back to OpenAnolis.
19+
20+
{{% notice Note %}}
21+
Even though the [migrate-ease](https://github.com/migrate-ease/) project team does the best to identify known incompatibilities, that's still recommend performing appropriate tests on your application before going to Production.
22+
{{% /notice %}}
23+
24+
### List of Supported Programming Languages
25+
26+
This tool scans all files in a source tree, regardless of whether they are included by the build system or not. Currently, the tool supports the following languages/dependencies:
27+
28+
#### C, C++
29+
- Inline assembly with no corresponding aarch64 inline assembly
30+
- Assembly code with no corresponding aarch64 assembly code
31+
- Use of architecture specific intrinsic
32+
- Use of architecture specific compilation options
33+
- Preprocessor errors that trigger when compiling on aarch64
34+
- Compiler specific code guarded by compiler specific pre-defined macros
35+
- Missing aarch64 architecture detection in Makefile, Config.guess scripts
36+
- Linking against libraries that are not available on the aarch64 architecture
37+
38+
#### Go
39+
- Inline assembly with no corresponding aarch64 inline assembly
40+
- Assembly code with no corresponding aarch64 assembly code
41+
- Use of architecture specific intrinsic
42+
- Linking against libraries that are not available on the aarch64 architecture
43+
44+
#### Python
45+
- Inline assembly with no corresponding aarch64 inline assembly
46+
- Use of architecture specific intrinsic
47+
- Linking against libraries that are not available on the aarch64 architecture
48+
- Use of architecture specific packages
49+
50+
#### Rust
51+
- Inline assembly with no corresponding aarch64 inline assembly
52+
- Use of architecture specific intrinsic
53+
- Linking against libraries that are not available on the aarch64 architecture
54+
55+
#### Java
56+
- JAR scanning
57+
- Dependency versions in pom.xml file
58+
- A feature to detect native calls in Java source code
59+
- Compatible version recommendation
60+
61+
#### Dockerfile
62+
- Use of architecture specific plugin
63+
- The base image that dockfile is based on does not support aarch64
64+
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
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+
![example image alt-text#center](web_ui_index.jpg "Figure 1. Web UI to scan a git repo")
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+
![example image alt-text#center](web_ui_result.jpg "Figure 2. Web UI of scan result")
100+
101+
You can download the result by clicking the "download" icon or view the result by clicking the "eye" icon.

0 commit comments

Comments
 (0)