cicy-desktop 2.1.109 → 2.1.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/build-wsl-package.yml +94 -0
- package/package.json +1 -1
- package/src/backends/homepage-react/assets/{index-DKTmSMvA.js → index-CgqXmbpX.js} +2 -2
- package/src/backends/homepage-react/index.html +1 -1
- package/src/sidecar/docker.js +53 -7
- package/src/sidecar/wsl-docker.js +163 -50
- package/workers/render/src/App.jsx +9 -4
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
name: Build WSL Package
|
|
2
|
+
|
|
3
|
+
# Bakes a single WSL2 rootfs that already contains Ubuntu 22.04 + Docker Engine
|
|
4
|
+
# + the cicy-code image (pre-loaded into /var/lib/docker), so a Windows install
|
|
5
|
+
# is just: wsl --import <this> → dockerd auto-starts → docker run. No apt, no
|
|
6
|
+
# image pull/load on the customer machine. Uploaded to Aliyun OSS (CN-fast).
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
inputs:
|
|
11
|
+
image:
|
|
12
|
+
description: cicy-code image to embed
|
|
13
|
+
default: cicybot/cicy-code:latest
|
|
14
|
+
oss_key:
|
|
15
|
+
description: OSS object key
|
|
16
|
+
default: rootfs/cicy-wsl-latest.tar.gz
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
build:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- name: Build base rootfs image (Ubuntu + Docker + autostart)
|
|
23
|
+
run: |
|
|
24
|
+
mkdir -p ctx
|
|
25
|
+
# dockerd auto-start on WSL boot: legacy iptables (WSL2 needs it) + detached dockerd.
|
|
26
|
+
cat > ctx/start-dockerd.sh <<'EOS'
|
|
27
|
+
#!/bin/sh
|
|
28
|
+
update-alternatives --set iptables /usr/sbin/iptables-legacy 2>/dev/null || true
|
|
29
|
+
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy 2>/dev/null || true
|
|
30
|
+
pgrep dockerd >/dev/null 2>&1 || nohup dockerd >/var/log/dockerd.log 2>&1 &
|
|
31
|
+
EOS
|
|
32
|
+
cat > ctx/wsl.conf <<'EOS'
|
|
33
|
+
[boot]
|
|
34
|
+
command = /usr/local/sbin/start-dockerd.sh
|
|
35
|
+
[user]
|
|
36
|
+
default = root
|
|
37
|
+
[automount]
|
|
38
|
+
enabled = true
|
|
39
|
+
EOS
|
|
40
|
+
cat > ctx/Dockerfile <<'EOF'
|
|
41
|
+
FROM ubuntu:22.04
|
|
42
|
+
ENV DEBIAN_FRONTEND=noninteractive
|
|
43
|
+
# The GHA runner is overseas — use the default Ubuntu archive (fast here).
|
|
44
|
+
# The end-user's WSL apt mirror is a separate concern (handled at runtime).
|
|
45
|
+
RUN apt-get update \
|
|
46
|
+
&& apt-get install -y --no-install-recommends docker.io ca-certificates iptables iproute2 \
|
|
47
|
+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
48
|
+
RUN update-alternatives --set iptables /usr/sbin/iptables-legacy || true; \
|
|
49
|
+
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy || true
|
|
50
|
+
COPY start-dockerd.sh /usr/local/sbin/start-dockerd.sh
|
|
51
|
+
COPY wsl.conf /etc/wsl.conf
|
|
52
|
+
RUN chmod +x /usr/local/sbin/start-dockerd.sh
|
|
53
|
+
EOF
|
|
54
|
+
docker build -t cicy-wsl-base ctx
|
|
55
|
+
|
|
56
|
+
- name: Pre-load cicy-code image into the rootfs
|
|
57
|
+
run: |
|
|
58
|
+
docker pull "${{ inputs.image }}"
|
|
59
|
+
docker save "${{ inputs.image }}" -o /tmp/cicy-image.tar
|
|
60
|
+
# Run the base privileged, start an inner dockerd, load the image into
|
|
61
|
+
# its /var/lib/docker (kept in the container fs, NOT a volume), then stop.
|
|
62
|
+
cid=$(docker run -d --privileged -v /tmp/cicy-image.tar:/img.tar:ro cicy-wsl-base \
|
|
63
|
+
bash -c '
|
|
64
|
+
nohup dockerd >/var/log/dind.log 2>&1 &
|
|
65
|
+
for i in $(seq 1 60); do docker info >/dev/null 2>&1 && break; sleep 1; done
|
|
66
|
+
docker load -i /img.tar
|
|
67
|
+
docker images
|
|
68
|
+
pkill dockerd || true
|
|
69
|
+
sleep 4
|
|
70
|
+
# Drop stale daemon runtime files so the FIRST dockerd in WSL2 does
|
|
71
|
+
# not refuse with "pid file found" (引擎没起来 root cause).
|
|
72
|
+
rm -f /var/run/docker.pid /run/docker.pid /var/run/docker.sock /run/docker.sock
|
|
73
|
+
')
|
|
74
|
+
docker logs -f "$cid" || true
|
|
75
|
+
rc=$(docker wait "$cid"); echo "inner exit=$rc"
|
|
76
|
+
# Export the whole container filesystem (incl. /var/lib/docker) = the WSL rootfs.
|
|
77
|
+
docker export "$cid" | gzip > cicy-wsl.tar.gz
|
|
78
|
+
ls -lh cicy-wsl.tar.gz
|
|
79
|
+
|
|
80
|
+
- name: Upload to Aliyun OSS (public-read)
|
|
81
|
+
run: |
|
|
82
|
+
curl -sL https://gosspublic.alicdn.com/ossutil/1.7.18/ossutil64 -o ossutil && chmod +x ossutil
|
|
83
|
+
test -s ossutil && head -c4 ossutil | grep -q ELF || { echo "ossutil download bad"; exit 1; }
|
|
84
|
+
./ossutil config -e oss-cn-shanghai.aliyuncs.com \
|
|
85
|
+
-i "${{ secrets.OSS_ACCESS_KEY_ID }}" -k "${{ secrets.OSS_ACCESS_KEY_SECRET }}"
|
|
86
|
+
./ossutil cp cicy-wsl.tar.gz "oss://cicy-1372193042-cn/${{ inputs.oss_key }}" -f --acl public-read
|
|
87
|
+
echo "Uploaded: https://cicy-1372193042-cn.oss-cn-shanghai.aliyuncs.com/${{ inputs.oss_key }}"
|
|
88
|
+
|
|
89
|
+
- name: Upload artifact (backup)
|
|
90
|
+
uses: actions/upload-artifact@v4
|
|
91
|
+
with:
|
|
92
|
+
name: cicy-wsl-package
|
|
93
|
+
path: cicy-wsl.tar.gz
|
|
94
|
+
retention-days: 7
|