Skip to content

Commit

Permalink
refactor!: rework rootfs to be based on Ubuntu 24.04
Browse files Browse the repository at this point in the history
  • Loading branch information
edubart committed Jan 17, 2025
1 parent 44ddfa4 commit b80eaec
Show file tree
Hide file tree
Showing 33 changed files with 169 additions and 9,704 deletions.
4 changes: 0 additions & 4 deletions .dockerignore

This file was deleted.

116 changes: 36 additions & 80 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,99 +1,55 @@
name: Build
on: [push]
env:
TOOLCHAIN_REPOSITORY: cartesi/toolchain
TOOLCHAIN_VERSION: 0.15.0
CACHE_DIR: /home/runner/work/image-rootfs/image-rootfs/cache
permissions:
id-token: write
packages: write
contents: read
jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install libarchive-tools
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y --no-install-recommends build-essential autoconf automake libarchive-dev libarchive-tools pandoc
# Building from source cause the provided debian package is for Debian Bookworm
- name: Download, build and install xgenext2fs
run: |
wget https://github.com/cartesi/genext2fs/archive/refs/tags/v1.5.6.tar.gz
echo "34bfc26a037def23b85b676912462a3d126a87ef15c66c212b3500650da44f9e v1.5.6.tar.gz" | sha256sum -c -
tar -xzf v1.5.6.tar.gz
cd genext2fs-1.5.6
./autogen.sh
./configure
make
sudo make install
rm -rf genext2fs-1.5.6 v1.5.6.tar.gz
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # fetch tags

- name: Copy default Buildroot and Busybox config
run: make init-config
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Resolve rootfs filename from Makefile
run: echo ROOTFS_FILENAME="$(make rootfs-filename)" >> $GITHUB_ENV
- name: Buildx setup
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository_owner }}/rootfs
docker.io/${{ github.repository_owner }}/rootfs,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/tags/v') }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build rootfs
run: make build

- name: Login to Docker Hub
uses: docker/login-action@v2
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Depot CLI
uses: depot/setup-action@v1

- name: Create distribution details
run: make os-release

- name: Build docker image
uses: depot/build-push-action@v1
with:
context: .
platforms: linux/amd64,linux/arm64
tags: cartesi/rootfs:devel
push: false
load: true
build-args: |
TOOLCHAIN_REPOSITORY=${{ env.TOOLCHAIN_REPOSITORY }}
TOOLCHAIN_VERSION=${{ env.TOOLCHAIN_VERSION }}
ROOTFS_FILENAME=${{ env.ROOTFS_FILENAME }}
cache-from: type=gha,scope=regular
cache-to: type=gha,mode=max,scope=regular
project: ${{ vars.DEPOT_PROJECT }}

- name: Export rootfs.ext2 artifact
run: make copy

- name: Export download cache
run: make copy-br2-dl-cache CACHE_DIR=${{ env.CACHE_DIR }}
if-no-files-found: error
path: |
rootfs-ubuntu.ext2
rootfs-alpine.ext2
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
prerelease: true
files: rootfs-*.ext2
files: |
rootfs-ubuntu.ext2
rootfs-alpine.ext2
env:
GITHUB_TOKEN: ${{ secrets.CI_TOKEN }}

- name: Push docker image
uses: depot/build-push-action@v1
with:
context: .
platforms: linux/amd64,linux/arm64
tags: ${{ steps.docker_meta.outputs.tags }}
push: true
load: false
build-args: |
TOOLCHAIN_REPOSITORY=${{ env.TOOLCHAIN_REPOSITORY }}
TOOLCHAIN_VERSION=${{ env.TOOLCHAIN_VERSION }}
cache-from: type=gha,scope=regular
cache-to: type=gha,mode=max,scope=regular
project: ${{ vars.DEPOT_PROJECT }}
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
rootfs-*.ext2
cartesi-buildroot-config
cartesi-busybox-fragment
*.ext2
*.tar
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

51 changes: 29 additions & 22 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Installed many new cli applications for testing and debugging purposes
- Added experimental rootfs image based on Alpine 3.21

### Changed
- Rework rootfs image to be based on Ubuntu 24.04
- Update machine-guest-tools to v0.17.0

## [0.19.0] - 2023-10-13
### Changed
Expand Down Expand Up @@ -101,25 +108,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [0.2.0]
- [0.1.0]

[Unreleased]: https://github.com/cartesi/image-rootfs/compare/v0.19.0...HEAD
[0.19.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.19.0
[0.18.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.18.0
[0.17.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.17.0
[0.16.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.16.0
[0.15.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.15.0
[0.14.1]: https://github.com/cartesi/image-rootfs/releases/tag/v0.14.1
[0.14.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.14.0
[0.13.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.13.0
[0.12.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.12.0
[0.11.1]: https://github.com/cartesi/image-rootfs/releases/tag/v0.11.1
[0.11.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.11.0
[0.10.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.10.0
[0.9.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.9.0
[0.8.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.8.0
[0.7.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.7.0
[0.6.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.6.0
[0.5.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.5.0
[0.4.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.4.0
[0.3.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.3.0
[0.2.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.2.0
[0.1.0]: https://github.com/cartesi/image-rootfs/releases/tag/v0.1.0
[Unreleased]: https://github.com/cartesi/machine-rootfs-image/compare/v0.19.0...HEAD
[0.19.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.19.0
[0.18.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.18.0
[0.17.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.17.0
[0.16.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.16.0
[0.15.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.15.0
[0.14.1]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.14.1
[0.14.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.14.0
[0.13.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.13.0
[0.12.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.12.0
[0.11.1]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.11.1
[0.11.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.11.0
[0.10.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.10.0
[0.9.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.9.0
[0.8.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.8.0
[0.7.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.7.0
[0.6.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.6.0
[0.5.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.5.0
[0.4.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.4.0
[0.3.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.3.0
[0.2.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.2.0
[0.1.0]: https://github.com/cartesi/machine-rootfs-image/releases/tag/v0.1.0
74 changes: 0 additions & 74 deletions Dockerfile

This file was deleted.

Loading

0 comments on commit b80eaec

Please sign in to comment.