Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 44 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Validate Build Configuration
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0

- name: Make scripts executable
run: |
Expand All @@ -24,7 +24,10 @@ jobs:
run: bash validate-build.sh

- name: Run unit tests
run: python3 tests/test_nn.py -v
run: python3 -m unittest discover -s tests -p 'test_*.py' -v

- name: Air-gap check (no new outbound network calls)
run: bash scripts/check-airgap.sh

- name: Check shell script syntax
run: |
Expand All @@ -38,7 +41,7 @@ jobs:
name: Lint & Format Check
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0

- name: Check all Python files compile
run: |
Expand Down Expand Up @@ -72,11 +75,11 @@ jobs:
done

build-iso:
name: Build ISO (Structure Check)
name: Build ISO (Structure + lb config + package resolution)
runs-on: ubuntu-24.04
needs: validate
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0

- name: Install dependencies
run: |
Expand All @@ -91,17 +94,50 @@ jobs:
test -d config/package-lists && echo "OK: package lists present"
test -f build.sh && echo "OK: build.sh present"
test -f validate-build.sh && echo "OK: validate-build.sh present"
echo "Structure OK — full ISO build requires 20GB disk (CI runners limited)"
echo "Structure OK — a full ISO build (debootstrap + chroot + squashfs)"
echo "needs 20GB+ disk and privileged mounts CI runners don't have."

- name: Run lb config with the pinned snapshot mirror
run: |
SNAPSHOT_TS=$(grep -oP '(?<=SNAPSHOT_TS=")[^"]+' build.sh)
SNAPSHOT_MIRROR="https://snapshot.ubuntu.com/ubuntu/${SNAPSHOT_TS}"
echo "Pinned snapshot: $SNAPSHOT_MIRROR"
lb config \
--mode ubuntu \
--distribution noble \
--archive-areas "main restricted universe multiverse" \
--debian-installer false \
--memtest none \
--binary-images iso-hybrid \
--mirror-bootstrap "$SNAPSHOT_MIRROR" \
--mirror-chroot "$SNAPSHOT_MIRROR" \
--mirror-chroot-security "$SNAPSHOT_MIRROR"
echo "OK: lb config succeeded against the pinned snapshot"

- name: Resolve neuros.list.chroot against the pinned snapshot
run: |
SNAPSHOT_TS=$(grep -oP '(?<=SNAPSHOT_TS=")[^"]+' build.sh)
SNAPSHOT_MIRROR="https://snapshot.ubuntu.com/ubuntu/${SNAPSHOT_TS}"
sudo tee /etc/apt/sources.list.d/neuros-snapshot.list > /dev/null <<SRC
deb $SNAPSHOT_MIRROR noble main restricted universe multiverse
deb $SNAPSHOT_MIRROR noble-updates main restricted universe multiverse
deb $SNAPSHOT_MIRROR noble-backports main restricted universe multiverse
deb $SNAPSHOT_MIRROR noble-security main restricted universe multiverse
SRC
sudo apt-get update
PACKAGES=$(grep -vE '^\s*(#|$)' config/package-lists/neuros.list.chroot | tr '\n' ' ')
echo "Packages: $PACKAGES"
sudo apt-get install --dry-run -y $PACKAGES

docker-build:
name: Docker Container Build
runs-on: ubuntu-24.04
needs: validate
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0

- name: Build Docker image
run: docker build -t neuros-build . 2>&1 || echo "Docker build skipped (non-critical in CI)"
Expand Down
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,27 @@ Thumbs.db
*.md
!README.md


# live-build artifacts
.build/
cache/
chroot/
binary/
local/
config/binary
config/bootstrap
config/chroot
config/common
config/source
config/build
*.packages
*.contents
*.hybrid.iso.zsync
*.list

# live-build lock file, left behind when a build is killed
.lock
boot-test/
*.zsync.xz
chroot.headers
chroot.packages.*
33 changes: 30 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@
# Or use with docker-compose:
# docker compose up

FROM ubuntu:24.04
# Pinned to a digest instead of the floating 24.04 tag, which Canonical
# rebuilds in place for security updates -- the digest is immutable, so the
# build container's starting filesystem can't drift between builds.
FROM ubuntu:24.04@sha256:561618e2c15bf2397621dd04f96926663a3b5616c189cf7e38db7e82f5c538ea

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=UTC

# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
live-build \
zstd \
lz4 \
xz-utils \
debootstrap \
squashfs-tools \
xorriso \
Expand Down Expand Up @@ -48,8 +54,9 @@ COPY build.sh /opt/neuros/
COPY Makefile /opt/neuros/
COPY validate-build.sh /opt/neuros/

# Install Python dependencies
RUN pip3 install --break-system-packages requests || true
# Install Python dependencies (pinned so this doesn't silently pick up a
# newer requests on rebuild)
RUN pip3 install --break-system-packages requests==2.34.2 || true

# Set up neuros tools in container
RUN mkdir -p /usr/local/bin && \
Expand All @@ -65,4 +72,24 @@ RUN echo "NeurOS Build Container Ready" && \
echo "Tools: $(ls /usr/local/bin/ | grep neuros | tr '\n' ' ')"

ENTRYPOINT ["/opt/neuros/build.sh"]

# Upstream bug in Ubuntu's live-build 3.0~a57: the casper branch of
# lb_binary_syslinux rewrites ${_SUFFIX}/live.cfg (undefined) instead of
# ${_TARGET}/live.cfg, so any build with a plain live.cfg template dies with
# "sed: can't read /live.cfg". Fix the one variable name.
RUN sed -i 's|${_SUFFIX}/live.cfg|${_TARGET}/live.cfg|' /usr/lib/live/build/lb_binary_syslinux \
&& grep -q '${_TARGET}/live.cfg' /usr/lib/live/build/lb_binary_syslinux \
&& ! grep -q '_SUFFIX' /usr/lib/live/build/lb_binary_syslinux


# genisoimage (cdrkit) cannot store a file over 4 GiB; NeurOS's squashfs is
# ~8.5 GB because Mistral 7B ships inside it. Build the ISO with xorriso's
# mkisofs emulation at ISO level 3 instead, which is what Ubuntu's own ISOs use.
RUN sed -i \
-e 's|Check_package chroot/usr/bin/genisoimage genisoimage|Check_package chroot/usr/bin/xorriso xorriso|' \
-e 's|^genisoimage \${GENISOIMAGE_OPTIONS}|xorriso -as mkisofs -iso-level 3 ${GENISOIMAGE_OPTIONS}|' \
/usr/lib/live/build/lb_binary_iso \
&& grep -q 'xorriso -as mkisofs -iso-level 3' /usr/lib/live/build/lb_binary_iso \
&& grep -q 'chroot/usr/bin/xorriso xorriso' /usr/lib/live/build/lb_binary_iso

CMD ["--help"]
Loading