Skip to content

Commit 1078ad1

Browse files
committed
Remove the multi-stage GH actions build
Now that GH actions supports jobs up to 6 hours long we don't need to do multi-stage builds anymore.
1 parent ec02efb commit 1078ad1

File tree

3 files changed

+9
-119
lines changed

3 files changed

+9
-119
lines changed

.github/workflows/bwrap.yml

Lines changed: 6 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ on:
1212
- master
1313

1414
jobs:
15-
pass1:
16-
name: Run up to Linux build under bubblewrap
15+
build:
16+
name: Run under bubblewrap
1717
runs-on: ubuntu-24.04
1818
steps:
1919
- name: Install bubblewrap
20-
run: sudo apt install bubblewrap
20+
run: sudo apt-get install bubblewrap
21+
- name: Work around Ubuntu 24.04 bubblewrap bug
22+
run: sudo cp .github/workflows/bwrap.apparmor /etc/apparmor.d/bwrap && sudo systemctl reload apparmor
2123
- name: Checkout repo
2224
uses: actions/checkout@v4
2325
with:
2426
submodules: recursive
2527
# There is a strange bug(?) in nongnu, when you clone a git repository
2628
# against a commit != HEAD with depth=1, it errors out.
2729
fetch-depth: 0
28-
- name: Work around Ubuntu 24.04 bubblewrap bug
29-
run: sudo cp .github/workflows/bwrap.apparmor /etc/apparmor.d/bwrap && sudo systemctl reload apparmor
3030
- name: Query cache for sources
3131
id: cache
3232
uses: actions/cache/restore@v4
@@ -49,105 +49,7 @@ jobs:
4949
mirror-state
5050
key: cache-${{ hashFiles('steps/*/sources') }}
5151
- name: Run bootstrap
52-
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass1 --mirror file://${PWD}/mirror
53-
- name: Archive created packages
54-
if: failure() # archive failed builds progress
55-
uses: actions/upload-artifact@v4
56-
with:
57-
name: packages
58-
path: target/external/repo/**
59-
- name: Tar pass1 image
60-
run: tar -cf pass1_image.tar target
61-
- name: Archive pass1_image
62-
uses: actions/upload-artifact@v4
63-
with:
64-
name: internal_pass1_image
65-
path: pass1_image.tar
66-
67-
pass2:
68-
name: Run up to Python bootstrap under bubblewrap
69-
needs: pass1
70-
runs-on: ubuntu-24.04
71-
steps:
72-
- name: Install bubblewrap
73-
run: sudo apt install bubblewrap
74-
- name: Checkout repo
75-
uses: actions/checkout@v4
76-
with:
77-
submodules: recursive
78-
# There is a strange bug(?) in nongnu, when you clone a git repository
79-
# against a commit != HEAD with depth=1, it errors out.
80-
fetch-depth: 0
81-
- name: Work around Ubuntu 24.04 bubblewrap bug
82-
run: sudo cp .github/workflows/bwrap.apparmor /etc/apparmor.d/bwrap && sudo systemctl reload apparmor
83-
- name: Get pass1_image
84-
uses: actions/download-artifact@v4
85-
with:
86-
name: internal_pass1_image
87-
- name: Extract pass1_image
88-
run: tar -xf pass1_image.tar
89-
- name: Query cache for sources
90-
id: cache
91-
uses: actions/cache/restore@v4
92-
with:
93-
path: |
94-
mirror
95-
mirror-state
96-
key: cache-${{ hashFiles('steps/*/sources') }}
97-
fail-on-cache-miss: true
98-
- name: Copy distfiles
99-
run: ./download-distfiles.sh file:///${PWD}/mirror
100-
- name: Run bootstrap
101-
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass2 --mirror file://${PWD}/mirror
102-
- name: Archive created packages
103-
if: failure() # archive failed builds progress
104-
uses: actions/upload-artifact@v4
105-
with:
106-
name: internal_packages_pass2
107-
path: target/external/repo/**
108-
- name: Tar pass2 image
109-
run: tar -cf pass2_image.tar target
110-
- name: Archive pass2_image
111-
uses: actions/upload-artifact@v4
112-
with:
113-
name: internal_pass2_image
114-
path: pass2_image.tar
115-
116-
pass3:
117-
name: Run remaining builds under bubblewrap
118-
needs: pass2
119-
runs-on: ubuntu-24.04
120-
steps:
121-
- name: Install bubblewrap
122-
run: sudo apt install bubblewrap
123-
- name: Checkout repo
124-
uses: actions/checkout@v4
125-
with:
126-
submodules: recursive
127-
# There is a strange bug(?) in nongnu, when you clone a git repository
128-
# against a commit != HEAD with depth=1, it errors out.
129-
fetch-depth: 0
130-
- name: Work around Ubuntu 24.04 bubblewrap bug
131-
run: sudo cp .github/workflows/bwrap.apparmor /etc/apparmor.d/bwrap && sudo systemctl reload apparmor
132-
- name: Get pass2_image
133-
uses: actions/download-artifact@v4
134-
with:
135-
name: internal_pass2_image
136-
- name: Extract pass2_image
137-
run: tar -xf pass2_image.tar
138-
- name: Query cache for sources
139-
id: cache
140-
uses: actions/cache/restore@v4
141-
with:
142-
path: |
143-
mirror
144-
mirror-state
145-
key: cache-${{ hashFiles('steps/*/sources') }}
146-
fail-on-cache-miss: true
147-
- name: Copy distfiles
148-
run: ./download-distfiles.sh file:///${PWD}/mirror
149-
- name: Run bootstrap
150-
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass3 --mirror file://${PWD}/mirror
52+
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --mirror file://${PWD}/mirror
15153
- name: Archive created packages
15254
if: always() # archive both failed and successful builds
15355
uses: actions/upload-artifact@v4

lib/generator.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ def __init__(self, arch, external_sources, early_preseed, repo_path, mirrors):
3838
self.target_dir = None
3939
self.external_dir = None
4040

41-
def reuse(self, target):
42-
"""
43-
Reuse a previously prepared bwrap environment for further stages.
44-
"""
45-
self.target_dir = target.path
46-
self.external_dir = os.path.join(self.target_dir, 'external')
47-
self.distfiles()
48-
4941
def prepare(self, target, using_kernel=False, kernel_bootstrap=False, target_size=0):
5042
"""
5143
Prepare basic media of live-bootstrap.

rootfs.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def create_configuration_file(args):
3939
config.write(f"JOBS={args.cores}\n")
4040
config.write(f"SWAP_SIZE={args.swap}\n")
4141
config.write(f"FINAL_JOBS={args.cores}\n")
42-
config.write(f"INTERNAL_CI={args.internal_ci or False}\n")
4342
config.write(f"INTERACTIVE={args.interactive}\n")
4443
config.write(f"QEMU={args.qemu}\n")
4544
config.write(f"BARE_METAL={args.bare_metal or (args.qemu and args.interactive)}\n")
@@ -252,13 +251,10 @@ def bootstrap(args, generator, target, size, cleanup):
252251

253252
elif args.bwrap:
254253
init = '/init'
255-
if not args.internal_ci or args.internal_ci == "pass1":
256-
generator.prepare(target, using_kernel=False)
254+
generator.prepare(target, using_kernel=False)
257255

258-
arch = stage0_arch_map.get(args.arch, args.arch)
259-
init = os.path.join(os.sep, 'bootstrap-seeds', 'POSIX', arch, 'kaem-optional-seed')
260-
else:
261-
generator.reuse(target)
256+
arch = stage0_arch_map.get(args.arch, args.arch)
257+
init = os.path.join(os.sep, 'bootstrap-seeds', 'POSIX', arch, 'kaem-optional-seed')
262258

263259
run('env', '-i', 'bwrap', '--unshare-user',
264260
'--uid', '0',

0 commit comments

Comments
 (0)