Skip to content

ci(x86_64): add Asterinas zone1 Jenkins test - #376

Merged
Solicey merged 1 commit into
syswonder:devfrom
yydawx:asterinas-jenkit
Aug 21, 2026
Merged

ci(x86_64): add Asterinas zone1 Jenkins test#376
Solicey merged 1 commit into
syswonder:devfrom
yydawx:asterinas-jenkit

Conversation

@yydawx

@yydawx yydawx commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Motivation

Add Asterinas zone1 coverage to the existing x86_64 QEMU Jenkins CI while keeping x86_64/qemu as the Linux zone1 test flow.

Approach

Use a dedicated x86_64/qemu_asterinas BID for Asterinas instead of mixing Linux and Asterinas in the same BID. The existing x86_64/qemu BID remains unchanged and only tests Linux zone1.

platform_board: qemu decouples the Jenkins BID from the make/platform board:

  • BID x86_64/qemu_asterinas is only a test identity and server artifact directory.
  • make still uses the real platform BOARD=qemu because platform/x86_64/qemu_asterinas does not exist in the source tree.
  • artifact_dir: qemu_asterinas selects the Asterinas artifact directory.

Artifact layout

qemu_asterinas provides:

  • image/kernel/aster-kernel-osdk-bin
  • image/virtdisk/initramfs.cpio.gz

The shared x86_64/qemu artifacts still provide zone0 files:

  • image/kernel/setup.bin
  • image/kernel/vmlinux.bin
  • image/virtdisk/rootfs1.img

Changes

  • Jenkinsfile: add platform_board parsing and the x86_64/qemu_asterinas matrix cell.
  • jenkins/ci.yaml: add the dedicated BID and keep Linux zone1 in x86_64/qemu.
  • jenkins/ci_config.py: expose optional platform_board.
  • jenkins/ci_runner.py: map BID to the real platform board, clear BID for hvisor make, and add asterinas_zone1_regression.
  • jenkins/prepare.sh: deploy Asterinas kernel/initramfs, Multiboot2 bootloader, and create zone1_disk.img with mkfs.ext2 -b 4096.
  • jenkins/terminal.py: add send_one_by_one() for sensitive guest consoles.
  • platform/x86_64/qemu/scripts/boot_zone1_asterinas.sh: start Asterinas zone1 with the Asterinas virtio config.

QEMU lifecycle

Each BID starts one QEMU instance and runs its own test cases. There is no Linux/Asterinas state sharing and no restart between two guest types inside one BID.

Verification

  • x86_64/qemu passes Linux zone1 startup.
  • x86_64/qemu_asterinas starts Asterinas zone1 and runs /test/run_regression_test.sh.
  • CI polls Asterinas regression output until it sees both All regression tests passed and exit code 0; a non-zero regression exit fails immediately.
  • After regression, CI sends Ctrl-A d to detach from the Asterinas screen and verifies the zone0 root@zone0 prompt.
  • Jenkins build 8 is fully green, including x86_64/qemu_asterinas.

@github-actions github-actions Bot added x86_64 and removed x86_64 labels Aug 9, 2026
@Solicey

Solicey commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

I think it is OK to add a new BID for x86_64/qemu_asterinas

@github-actions github-actions Bot added x86_64 and removed x86_64 labels Aug 11, 2026
@github-actions github-actions Bot added x86_64 and removed x86_64 labels Aug 11, 2026
@yydawx

yydawx commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

@Solicey, could you please review the updated PR?

We decouple the Jenkins BID from the make/platform board via platform_board: qemu: the BID x86_64/qemu_asterinas is only a test identity and artifact directory, while make still uses the real platform BOARD=qemu.

If we kept the old rule that the BID board must equal the platform board, and still wanted a dedicated Asterinas BID, we would have to introduce a platform/x86_64/qemu_asterinas directory or force make BOARD=qemu_asterinas. That would turn a test scenario into a new platform, break the platform abstraction, and add maintenance cost.

@Solicey
Solicey requested a review from dallasxy August 11, 2026 13:10
@Solicey

Solicey commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

It would be better to add more test instructions to show that zone1 works fine. For example, screen /dev/pts/0 to enter zone1, ls, Ctrl A+D to return to zone0. You can refer to qemu/x86_64 for this.

@github-actions github-actions Bot added x86_64 and removed x86_64 labels Aug 11, 2026
@github-actions github-actions Bot added x86_64 and removed x86_64 labels Aug 11, 2026
@yydawx

yydawx commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

@Solicey, thanks for the review. We updated the CI flow: after entering the Asterinas zone1 console, it now runs /test/run_regression_test.sh, waits for All regression tests passed and exit code 0, then sends Ctrl-A d to detach back to zone0 and verifies the root@zone0 prompt. Jenkins build 8 is green, including x86_64/qemu_asterinas.

@yydawx

yydawx commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

@dallasxy, could you please review this PR?

The PR adds a dedicated x86_64/qemu_asterinas Jenkins BID while keeping x86_64/qemu as the Linux zone1 flow. It decouples the Jenkins BID from the make/platform board via platform_board: qemu, and x86_64/qemu_asterinas now runs Asterinas zone1 regression tests.

Jenkins build 8 is fully green, including x86_64/qemu_asterinas.

@github-actions github-actions Bot added x86_64 and removed x86_64 labels Aug 12, 2026
Comment thread jenkins/terminal.py Outdated
Comment on lines +174 to +180
def send_one_by_one(self, command: str, char_delay: float = 0.05) -> None:
"""Send a command one character at a time for sensitive guest consoles."""
self._ensure_open()
payload = command + "\n"
for char in payload:
self.backend.write(char.encode(self.encoding, errors="replace"))
time.sleep(char_delay)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the reason for adding a send_one_by_one function?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the question. We found that the current Asterinas virtio-console receives one byte per IRQ, which conflicts with sending the whole command at once via send(). I also observed this in normal use: the Asterinas terminal cannot paste, and screen/tmux also require byte-by-byte input. That is why I added send_one_by_one. After removing it and using the old send(), Jenkins build 10 hung because send() could not deliver the complete command:
http://183.242.33.186:8100/job/hvisor_pr_ci_2/job/PR-376/10/

One alternative is to use the existing send path in a char-by-char loop to build the full command. I currently prefer a single helper because it keeps the terminal abstraction clean.

Which approach should we take: keep send_one_by_one, or use send() in a loop to send one character at a time?

@github-actions github-actions Bot added x86_64 and removed x86_64 labels Aug 12, 2026
@yydawx
yydawx requested a review from Solicey August 18, 2026 10:31
@github-actions github-actions Bot added x86_64 and removed x86_64 labels Aug 21, 2026
@Solicey

Solicey commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

It seems that there are some conflicts with the dev branch, you can resolve these conflicts manually.

@github-actions github-actions Bot added x86_64 and removed x86_64 labels Aug 21, 2026
@github-actions github-actions Bot added x86_64 and removed x86_64 labels Aug 21, 2026
@Solicey
Solicey merged commit 44bf93a into syswonder:dev Aug 21, 2026
26 checks passed
agicy pushed a commit that referenced this pull request Aug 24, 2026
ci(x86_64): add Asterinas zone1 Jenkins test
agicy pushed a commit that referenced this pull request Aug 24, 2026
ci(x86_64): add Asterinas zone1 Jenkins test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants