mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-17 16:55:25 +01:00
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.
This commit is contained in:
parent
ec02efba46
commit
fdc3a0b1f1
3 changed files with 7 additions and 117 deletions
106
.github/workflows/bwrap.yml
vendored
106
.github/workflows/bwrap.yml
vendored
|
|
@ -12,12 +12,12 @@ on:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pass1:
|
build:
|
||||||
name: Run up to Linux build under bubblewrap
|
name: Run under bubblewrap
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Install bubblewrap
|
- name: Install bubblewrap
|
||||||
run: sudo apt install bubblewrap
|
run: sudo apt-get install bubblewrap
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
|
@ -49,105 +49,7 @@ jobs:
|
||||||
mirror-state
|
mirror-state
|
||||||
key: cache-${{ hashFiles('steps/*/sources') }}
|
key: cache-${{ hashFiles('steps/*/sources') }}
|
||||||
- name: Run bootstrap
|
- name: Run bootstrap
|
||||||
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass1 --mirror file://${PWD}/mirror
|
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --mirror file://${PWD}/mirror
|
||||||
- name: Archive created packages
|
|
||||||
if: failure() # archive failed builds progress
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: packages
|
|
||||||
path: target/external/repo/**
|
|
||||||
- name: Tar pass1 image
|
|
||||||
run: tar -cf pass1_image.tar target
|
|
||||||
- name: Archive pass1_image
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: internal_pass1_image
|
|
||||||
path: pass1_image.tar
|
|
||||||
|
|
||||||
pass2:
|
|
||||||
name: Run up to Python bootstrap under bubblewrap
|
|
||||||
needs: pass1
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- name: Install bubblewrap
|
|
||||||
run: sudo apt install bubblewrap
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
# There is a strange bug(?) in nongnu, when you clone a git repository
|
|
||||||
# against a commit != HEAD with depth=1, it errors out.
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Work around Ubuntu 24.04 bubblewrap bug
|
|
||||||
run: sudo cp .github/workflows/bwrap.apparmor /etc/apparmor.d/bwrap && sudo systemctl reload apparmor
|
|
||||||
- name: Get pass1_image
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: internal_pass1_image
|
|
||||||
- name: Extract pass1_image
|
|
||||||
run: tar -xf pass1_image.tar
|
|
||||||
- name: Query cache for sources
|
|
||||||
id: cache
|
|
||||||
uses: actions/cache/restore@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
mirror
|
|
||||||
mirror-state
|
|
||||||
key: cache-${{ hashFiles('steps/*/sources') }}
|
|
||||||
fail-on-cache-miss: true
|
|
||||||
- name: Copy distfiles
|
|
||||||
run: ./download-distfiles.sh file:///${PWD}/mirror
|
|
||||||
- name: Run bootstrap
|
|
||||||
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass2 --mirror file://${PWD}/mirror
|
|
||||||
- name: Archive created packages
|
|
||||||
if: failure() # archive failed builds progress
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: internal_packages_pass2
|
|
||||||
path: target/external/repo/**
|
|
||||||
- name: Tar pass2 image
|
|
||||||
run: tar -cf pass2_image.tar target
|
|
||||||
- name: Archive pass2_image
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: internal_pass2_image
|
|
||||||
path: pass2_image.tar
|
|
||||||
|
|
||||||
pass3:
|
|
||||||
name: Run remaining builds under bubblewrap
|
|
||||||
needs: pass2
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- name: Install bubblewrap
|
|
||||||
run: sudo apt install bubblewrap
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
# There is a strange bug(?) in nongnu, when you clone a git repository
|
|
||||||
# against a commit != HEAD with depth=1, it errors out.
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Work around Ubuntu 24.04 bubblewrap bug
|
|
||||||
run: sudo cp .github/workflows/bwrap.apparmor /etc/apparmor.d/bwrap && sudo systemctl reload apparmor
|
|
||||||
- name: Get pass2_image
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: internal_pass2_image
|
|
||||||
- name: Extract pass2_image
|
|
||||||
run: tar -xf pass2_image.tar
|
|
||||||
- name: Query cache for sources
|
|
||||||
id: cache
|
|
||||||
uses: actions/cache/restore@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
mirror
|
|
||||||
mirror-state
|
|
||||||
key: cache-${{ hashFiles('steps/*/sources') }}
|
|
||||||
fail-on-cache-miss: true
|
|
||||||
- name: Copy distfiles
|
|
||||||
run: ./download-distfiles.sh file:///${PWD}/mirror
|
|
||||||
- name: Run bootstrap
|
|
||||||
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass3 --mirror file://${PWD}/mirror
|
|
||||||
- name: Archive created packages
|
- name: Archive created packages
|
||||||
if: always() # archive both failed and successful builds
|
if: always() # archive both failed and successful builds
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|
|
||||||
|
|
@ -38,14 +38,6 @@ class Generator():
|
||||||
self.target_dir = None
|
self.target_dir = None
|
||||||
self.external_dir = None
|
self.external_dir = None
|
||||||
|
|
||||||
def reuse(self, target):
|
|
||||||
"""
|
|
||||||
Reuse a previously prepared bwrap environment for further stages.
|
|
||||||
"""
|
|
||||||
self.target_dir = target.path
|
|
||||||
self.external_dir = os.path.join(self.target_dir, 'external')
|
|
||||||
self.distfiles()
|
|
||||||
|
|
||||||
def prepare(self, target, using_kernel=False, kernel_bootstrap=False, target_size=0):
|
def prepare(self, target, using_kernel=False, kernel_bootstrap=False, target_size=0):
|
||||||
"""
|
"""
|
||||||
Prepare basic media of live-bootstrap.
|
Prepare basic media of live-bootstrap.
|
||||||
|
|
|
||||||
10
rootfs.py
10
rootfs.py
|
|
@ -39,7 +39,6 @@ def create_configuration_file(args):
|
||||||
config.write(f"JOBS={args.cores}\n")
|
config.write(f"JOBS={args.cores}\n")
|
||||||
config.write(f"SWAP_SIZE={args.swap}\n")
|
config.write(f"SWAP_SIZE={args.swap}\n")
|
||||||
config.write(f"FINAL_JOBS={args.cores}\n")
|
config.write(f"FINAL_JOBS={args.cores}\n")
|
||||||
config.write(f"INTERNAL_CI={args.internal_ci or False}\n")
|
|
||||||
config.write(f"INTERACTIVE={args.interactive}\n")
|
config.write(f"INTERACTIVE={args.interactive}\n")
|
||||||
config.write(f"QEMU={args.qemu}\n")
|
config.write(f"QEMU={args.qemu}\n")
|
||||||
config.write(f"BARE_METAL={args.bare_metal or (args.qemu and args.interactive)}\n")
|
config.write(f"BARE_METAL={args.bare_metal or (args.qemu and args.interactive)}\n")
|
||||||
|
|
@ -252,13 +251,10 @@ print(shutil.which('chroot'))
|
||||||
|
|
||||||
elif args.bwrap:
|
elif args.bwrap:
|
||||||
init = '/init'
|
init = '/init'
|
||||||
if not args.internal_ci or args.internal_ci == "pass1":
|
generator.prepare(target, using_kernel=False)
|
||||||
generator.prepare(target, using_kernel=False)
|
|
||||||
|
|
||||||
arch = stage0_arch_map.get(args.arch, args.arch)
|
arch = stage0_arch_map.get(args.arch, args.arch)
|
||||||
init = os.path.join(os.sep, 'bootstrap-seeds', 'POSIX', arch, 'kaem-optional-seed')
|
init = os.path.join(os.sep, 'bootstrap-seeds', 'POSIX', arch, 'kaem-optional-seed')
|
||||||
else:
|
|
||||||
generator.reuse(target)
|
|
||||||
|
|
||||||
run('env', '-i', 'bwrap', '--unshare-user',
|
run('env', '-i', 'bwrap', '--unshare-user',
|
||||||
'--uid', '0',
|
'--uid', '0',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue