Skip to content

Commit

Permalink
ci: use a proper PID1 for the build containers
Browse files Browse the repository at this point in the history
Maybe the weird `dotnet build-server shutdown` hangs are due to the
entrypoint being made `tail -f /dev/null` by the GHA runner in the
"initialize container" step.

```
$ ls -alf /tmp
total 0
drwxrwxrwt 1 root root 538 Sep 21 04:31 ./
drwxr-xr-x 1 root root  42 Sep 21 04:22 ../
drwxrwxrwx 1 root root   6 Sep 21 04:28 .dotnet/
drwx------ 1 root root  54 Sep 21 04:31 19e80c20-032d-44d5-9fdb-d7f6c997a39d/
srwxr-xr-x 1 root root   0 Sep 21 04:31 IysC7CuZMEweYuTSXW+sBF5o_ulkrefjRwckP1n6_+E=
drwx------ 1 root root   0 Sep 21 04:30 MSBuildTemproot/
drwx------ 1 root root   8 Sep 21 04:28 NuGetScratchroot/
drwx------ 1 root root   0 Sep 21 04:31 a8ef3f16-dbf3-4bf8-a554-6d1c52b1dcbf/
drwxr-xr-x 1 root root   0 Sep 21 04:21 ccache/
prwx------ 1 root root   0 Sep 21 04:31 clr-debug-pipe-1029-15867104-in|
prwx------ 1 root root   0 Sep 21 04:31 clr-debug-pipe-1029-15867104-out|
srw------- 1 root root   0 Sep 21 04:31 dotnet-diagnostic-1029-15867104-socket=
drwxr-xr-x 1 root root   0 Sep 21 04:21 out/
drwxr-xr-x 1 root root 196 Sep 21 04:22 rootfs/

$ ls -alFR /tmp/.dotnet
/tmp/.dotnet:
total 0
drwxrwxrwx 1 root root   6 Sep 21 04:28 ./
drwxrwxrwt 1 root root 538 Sep 21 04:31 ../
drwxrwxrwx 1 root root  12 Sep 21 04:31 shm/
/tmp/.dotnet/shm:
total 0
drwxrwxrwx 1 root root  12 Sep 21 04:31 ./
drwxrwxrwx 1 root root   6 Sep 21 04:28 ../
drwxrwxrwx 1 root root 100 Sep 21 04:31 global/
/tmp/.dotnet/shm/global:
total 4
drwxrwxrwx 1 root root  100 Sep 21 04:31 ./
drwxrwxrwx 1 root root   12 Sep 21 04:31 ../
-rw-rw-rw- 1 root root 4096 Sep 21 04:31 IysC7CuZMEweYuTSXW+sBF5o_ulkrefjRwckP1n6_+E.server

$ ps -ef
UID          PID    PPID  C STIME TTY          TIME CMD
root           1       0  0 04:20 ?        00:00:00 tail -f /dev/null
root         233       0  0 04:21 ?        00:00:00 sh -e /__w/_temp/e7c93450-3b0d-4fea-b329-767d664d2422.sh
root         239     233  0 04:21 ?        00:00:00 /bin/bash ./build.sh
root        1029       1 19 04:31 ?        00:00:04 /vmr/.dotnet/dotnet exec /vmr/.dotnet/sdk/9.0.100-preview.7.24407.12/Roslyn/bincore/VBCSCompiler.dll -pipename:IysC7CuZMEweYuTSXW+sBF5o_ulkrefjRwckP1n6_+E
root        6624     239  0 04:31 ?        00:00:00 ps -ef
```

*Maybe* having a proper PID1 will help the build server correctly
terminate itself...

Signed-off-by: WANG Xuerui <[email protected]>
  • Loading branch information
xen0n committed Sep 21, 2024
1 parent 248b2f3 commit 4d83b63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
run_id: ${{ github.run_id }}
container:
image: ghcr.io/loongson-community/dotnet-unofficial-build-builder:20240918T124748Z
options: --init # to take care of msbuild & roslyn build server processes
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions build-locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ main() {
-e OUT_DIR=/tmp/out
-e ROOTFS_DIR=/tmp/rootfs

--init
-u b
-w /work
"$BUILDER_IMAGE_TAG"
Expand Down

0 comments on commit 4d83b63

Please sign in to comment.