Enforce Hermeticity in Vortex Build Process

Đang mở
#395 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Lĩnh vực
build-system, tooling

Hướng nghiên cứu

Start by reading the Bazel hermeticity documentation linked in the issue and inspect the existing CI scripts, container setup, build scripts, and Makefiles mentioned in the proposal. The first iteration should cover local build and development, with CI held to the same requirements; FPGA deployment is explicitly out of scope. Done means Bazel provides a single entry point for build and test and enforces declared, reproducible dependencies.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Proposal

Vortex project depends on a complex toolchain and gets deployed in a variety of environments (local development, server development, FPGA deployment, CI pipeline, workshop tutorial, containerized, non-conatinerized, etc).

Furthermore, incorporating vortex into other simulation environments can introduce unknown requirements down the road.

AI tools are good enough to resolve these issues in a local context, but have no support for global correctness. Its better to be more explicit about the build requirements, beyond just readme, build scripts, make files.

The Bazel build system introduces the concept of hermeticity in build systems: https://bazel.build/basics/hermeticity

Emphasis on this section of the documentation:

The two important aspects of hermeticity are:
Isolation: Hermetic build systems treat tools as source code. They download copies of tools and manage their storage and use inside managed file trees. This creates isolation between the host machine and local user, including installed versions of languages.
Source identity: Hermetic build systems try to ensure the sameness of inputs. Code repositories, such as Git, identify sets of code mutations with a unique hash code. Hermetic build systems use this hash to identify changes to the build’s input.

Scope and Discussion

This is a relatively large undertaking, but I expect it to scale well into the future with much less "emergency failures" occurring. Prior vortex infra work such as ci, containerization, docs, build scripts, fpga deploy which I have worked on should all be encapsulated by this project. Another benefit of this approach is that the rules are explicitly writen in configuration files so future authors can add, modify, debug, etc without deep rearchitecting. It may increase local repo size since all deps will be kept locally. There might be a method to do a shared cloud env (ie for fpga licenses, NFS, etc). I'm sure this can be tackled in future commits. As such, this first iteration will focus on local build and development. I expect CI to have the same requirements. More specifically, FPGA is not included in the first iteration.

Motivation

Currently vortex has a container, which helps you distribute a standard environment. However, there no automatic method to check when a new dependency is required, but not added to the container. This is because some users may elect not to use the container in the first place!! In other words, the container is only useful if it cannot be side stepped. One goal of this work is to enforce one entry point to build, test, run, etc vortex. This will be a large undertaking, but Bazel is capable of handling all of the hard work, as long as its configured correctly and tested thoroughly. Another goal of this work is to detect when deps are out of date or changed, this is as simple checking their hash before proceeding with compilation or hitting cache. Finally, Bazel encourages good repo structure, teaches good habits, and introduces a topical and highly requested skill for systems developers should be familiar with. Bazel can also automatically parallelize and cache builds to improve performance without compromising fragmented binaries (consider: if you rerun a executable without recompiling latest changes). Finally, you can easily generate shareable binaries. This is particularly relevant to the vortex project for a number of reasons: 1) Distribute executables across multiple nodes to run large scale sims. 2) Compile vortex on a performance node, then just send executable to FPGA node for faster iteration cycles. 3) Data collection on multiple configs or some auto tuning framework

Implementation

I plan to try migrating to Bazel since it exposes all the tools that I need, as well as a familiar command line interface: bazel build ..., bazel test ... to wrap existing ci scripts. Using Bazel strictly enforces the rules of hermetic builds mentioned above. Furthermore it prevents side-stepping these rules with quick convenience scripts (.sh). You can still pass envs and flags to match the expected vortex configs format.

Ngôn ngữ chính
Verilog
Star
2.4k
Fork
563
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
33

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của vortexgpgpu/vortex

Tất cả issue của vortexgpgpu/vortex

Issue tương tự

Thêm issue về Build System

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.