-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
199 additions
and
0 deletions.
There are no files selected for viewing
83 changes: 83 additions & 0 deletions
83
.github/dockerfiles/ov_build/ubuntu_22_04_riscv_xuantie/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
ARG REGISTRY="docker.io" | ||
FROM ${REGISTRY}/library/ubuntu:22.04 | ||
|
||
USER root | ||
|
||
# APT configuration | ||
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \ | ||
echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \ | ||
echo 'APT::Get::Fix-Broken "true";' >> /etc/apt/apt.conf && \ | ||
echo 'APT::Get::no-install-recommends "true";' >> /etc/apt/apt.conf | ||
|
||
ENV DEBIAN_FRONTEND="noninteractive" \ | ||
TZ="Europe/London" | ||
|
||
RUN apt-get update && \ | ||
apt-get install software-properties-common && \ | ||
add-apt-repository --yes --no-update ppa:git-core/ppa && \ | ||
add-apt-repository --yes --no-update ppa:deadsnakes/ppa && \ | ||
apt-get update && \ | ||
# install compilers to build OpenVINO for RISC-V 64 | ||
apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu && \ | ||
apt-get install \ | ||
curl \ | ||
git \ | ||
cmake \ | ||
ccache \ | ||
ninja-build \ | ||
fdupes \ | ||
patchelf \ | ||
ca-certificates \ | ||
gpg-agent \ | ||
tzdata \ | ||
# parallel gzip | ||
pigz \ | ||
# Python \ | ||
python3-dev \ | ||
python3-pip \ | ||
python3-venv \ | ||
python3-distutils \ | ||
# Compilers | ||
gcc \ | ||
g++ \ | ||
&& \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install RISC-V native debian packages | ||
RUN echo deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted > riscv64-sources.list && \ | ||
echo deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted >> riscv64-sources.list && \ | ||
echo deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy universe >> riscv64-sources.list && \ | ||
echo deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates universe >> riscv64-sources.list && \ | ||
echo deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy multiverse >> riscv64-sources.list && \ | ||
echo deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse >> riscv64-sources.list && \ | ||
echo deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse >> riscv64-sources.list && \ | ||
echo deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy-security main restricted >> riscv64-sources.list && \ | ||
echo deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy-security universe >> riscv64-sources.list && \ | ||
echo deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy-security multiverse >> riscv64-sources.list && \ | ||
echo deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ jammy main >> riscv64-sources.list && \ | ||
echo deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ jammy universe >> riscv64-sources.list && \ | ||
echo deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main >> riscv64-sources.list && \ | ||
echo deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ jammy-security main >> riscv64-sources.list && \ | ||
mv riscv64-sources.list /etc/apt/sources.list.d/ | ||
|
||
RUN dpkg --add-architecture riscv64 && \ | ||
apt-get update -o Dir::Etc::sourcelist=/etc/apt/sources.list.d/riscv64-sources.list && \ | ||
apt-get install -y --no-install-recommends libpython3-dev:riscv64 | ||
|
||
# build xuintie toolchain | ||
ARG XUINTIE_VERSION="V2.8.1" | ||
ENV XUANTIE_REPO="https://github.com/XUANTIE-RV/xuantie-gnu-toolchain" \ | ||
XUINTIE_PATH="/opt/riscv" \ | ||
XUINTIE_TMP_PATH="/tmp/xuantie" \ | ||
XUINTIE_SRC="/tmp/xuantie/src" | ||
|
||
RUN mkdir ${XUINTIE_TMP_PATH} && cd ${XUINTIE_TMP_PATH} && \ | ||
git clone --branch ${XUINTIE_VERSION} --depth 1 ${XUANTIE_REPO} ${XUINTIE_SRC} && \ | ||
cd ${XUINTIE_SRC} && configure --prefix=${XUINTIE_PATH} && make -j$(nproc) && make install && \ | ||
rm -f ${XUINTIE_TMP_PATH} | ||
|
||
# Setup pip | ||
ENV PIP_VERSION="24.0" | ||
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ | ||
python3 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \ | ||
rm -f get-pip.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: Linux RISC-V with Xuantie (Ubuntu 22.04, Python 3.10) | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
merge_group: | ||
push: | ||
branches: | ||
- master | ||
- 'releases/**' | ||
|
||
concurrency: | ||
# github.ref is not unique in post-commit | ||
group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-linux-riscv | ||
cancel-in-progress: true | ||
|
||
permissions: read-all | ||
|
||
env: | ||
TARGET_BRANCH: ${{ github.base_ref || github.event.merge_group.base_ref || github.ref }} | ||
|
||
jobs: | ||
Smart_CI: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
affected_components: "${{ steps.smart_ci.outputs.affected_components }}" | ||
changed_components: "${{ steps.smart_ci.outputs.changed_components }}" | ||
skip_workflow: "${{ steps.smart_ci.outputs.skip_workflow }}" | ||
target_branch: ${{ steps.set_target_branch.outputs.target_branch }} | ||
steps: | ||
- name: checkout action | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
timeout-minutes: 15 | ||
with: | ||
sparse-checkout: .github/actions/smart-ci | ||
|
||
- name: Get affected components | ||
id: smart_ci | ||
uses: ./.github/actions/smart-ci | ||
with: | ||
repository: ${{ github.repository }} | ||
pr: ${{ github.event.number }} | ||
commit_sha: ${{ github.sha }} | ||
ref_name: ${{ github.ref_name }} | ||
component_pattern: "category: (.*)" | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
skip_when_only_listed_labels_set: 'docs' | ||
skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg,*/layer_tests_summary/*,*/conformance/*' | ||
|
||
- name: Get target branch | ||
id: set_target_branch | ||
run: | | ||
echo "target_branch=${TARGET_BRANCH#refs/heads/}" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
Docker: | ||
needs: Smart_CI | ||
runs-on: aks-linux-4-cores-16gb-docker-build | ||
if: "!needs.smart_ci.outputs.skip_workflow" | ||
container: | ||
image: openvinogithubactions.azurecr.io/docker_build:0.2 | ||
volumes: | ||
- /mount:/mount | ||
outputs: | ||
images: "${{ steps.handle_docker.outputs.images }}" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
timeout-minutes: 15 | ||
|
||
- uses: ./.github/actions/handle_docker | ||
id: handle_docker | ||
with: | ||
images: | | ||
ov_build/ubuntu_22_04_riscv_xuantie | ||
registry: 'openvinogithubactions.azurecr.io' | ||
dockerfiles_root_dir: '.github/dockerfiles' | ||
changed_components: ${{ needs.smart_ci.outputs.changed_components }} | ||
|
||
Build: | ||
needs: [Docker, Smart_CI] | ||
uses: ./.github/workflows/job_build_linux.yml | ||
with: | ||
runner: 'aks-linux-16-cores-32gb' | ||
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_22_04_riscv_xuantie }}", "volumes": ["/mount:/mount"]}' | ||
affected-components: ${{ needs.smart_ci.outputs.affected_components }} | ||
event-name: ${{ github.event_name }} | ||
os: 'ubuntu_22_04' | ||
build-contrib: false | ||
build-debian-packages: false | ||
build-js: false | ||
build-rpm-packages: false | ||
cmake-options: > | ||
-G "Ninja Multi-Config" | ||
-DENABLE_CPPLINT=OFF | ||
-DENABLE_NCC_STYLE=OFF | ||
-DENABLE_TESTS=ON | ||
-DENABLE_STRICT_DEPENDENCIES=OFF | ||
-DCMAKE_VERBOSE_MAKEFILE=ON | ||
-DENABLE_WHEEL=OFF | ||
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON | ||
-DCMAKE_TOOLCHAIN_FILE=${OPENVINO_REPO}/cmake/toolchains/riscv64-071-xuantie-gnu.toolchain.cmake | ||
-DRISCV_TOOLCHAIN_ROOT=/opt/riscv | ||
Overall_Status: | ||
name: ci/gha_overall_status_linux_riscv | ||
needs: [Smart_CI, Build] | ||
if: ${{ always() }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check status of all jobs | ||
if: >- | ||
${{ | ||
contains(needs.*.result, 'failure') || | ||
contains(needs.*.result, 'cancelled') | ||
}} | ||
run: exit 1 |