Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.9.0 #16

Merged
merged 8 commits into from
Feb 9, 2024
Merged
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
79 changes: 31 additions & 48 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ name: Build/Test/Release
on: [push]
env:
EMULATOR_REPOSITORY: cartesi/machine-emulator
EMULATOR_TAG: 0.15.3
ROM_VERSION: v0.17.0
KERNEL_VERSION: v0.17.0
LINUX_VERSION: 5.15.63-ctsi-2-v0.17.0
ROOTFS_VERSION: v0.18.0
EMULATOR_TAG: 0.16.0
KERNEL_VERSION: v0.19.1
LINUX_VERSION: 6.5.9-ctsi-1-v0.19.1
TOOLS_VERSION: v0.14.0
CARTESI_IMAGES_PATH: /usr/share/cartesi-machine/images
HOST_IMAGES_PATH: /tmp/cartesi-machine-images/
permissions:
Expand All @@ -19,18 +18,18 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout server-manager source code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down Expand Up @@ -69,25 +68,25 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout server-manager source code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Depot CLI
uses: depot/setup-action@v1
Expand Down Expand Up @@ -130,9 +129,9 @@ jobs:
- name: Download [rootfs.ext2]
uses: Legion2/[email protected]
with:
repository: ${{ github.repository_owner }}/image-rootfs
tag: ${{ env.ROOTFS_VERSION }}
file: rootfs-${{ env.ROOTFS_VERSION }}.ext2
repository: ${{ github.repository_owner }}/machine-emulator-tools
tag: ${{ env.TOOLS_VERSION }}
file: rootfs-tools-${{ env.TOOLS_VERSION }}.ext2

- name: Download [kernel.bin]
uses: Legion2/[email protected]
Expand All @@ -141,20 +140,12 @@ jobs:
tag: ${{ env.KERNEL_VERSION }}
file: linux-${{ env.LINUX_VERSION }}.bin

- name: Download [rom.bin]
uses: Legion2/[email protected]
with:
repository: ${{ github.repository_owner }}/machine-emulator-rom
tag: ${{ env.ROM_VERSION }}
file: rom-${{ env.ROM_VERSION }}.bin

- name: Move images to cartesi images folder
run: |
mkdir -m 755 -p /tmp/cartesi-machine-images
mv rom-*.bin linux-*.bin rootfs-*.ext2 ${{ env.HOST_IMAGES_PATH }}
mv linux-*.bin rootfs-*.ext2 ${{ env.HOST_IMAGES_PATH }}
cd ${{ env.HOST_IMAGES_PATH }} && ln -s linux-${{ env.LINUX_VERSION }}.bin linux.bin
cd ${{ env.HOST_IMAGES_PATH }} && ln -s rom-${{ env.ROM_VERSION }}.bin rom.bin
cd ${{ env.HOST_IMAGES_PATH }} && ln -s rootfs-${{ env.ROOTFS_VERSION }}.ext2 rootfs.ext2
cd ${{ env.HOST_IMAGES_PATH }} && ln -s rootfs-tools-${{ env.TOOLS_VERSION }}.ext2 rootfs.ext2

- name: Run test suite inside the docker image (Linux/${{ matrix.arch }})
run: |
Expand All @@ -180,25 +171,25 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout server-manager source code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Depot CLI
uses: depot/setup-action@v1
Expand Down Expand Up @@ -241,9 +232,9 @@ jobs:
- name: Download [rootfs.ext2]
uses: Legion2/[email protected]
with:
repository: ${{ github.repository_owner }}/image-rootfs
tag: ${{ env.ROOTFS_VERSION }}
file: rootfs-${{ env.ROOTFS_VERSION }}.ext2
repository: ${{ github.repository_owner }}/machine-emulator-tools
tag: ${{ env.TOOLS_VERSION }}
file: rootfs-tools-${{ env.TOOLS_VERSION }}.ext2

- name: Download [kernel.bin]
uses: Legion2/[email protected]
Expand All @@ -252,20 +243,12 @@ jobs:
tag: ${{ env.KERNEL_VERSION }}
file: linux-${{ env.LINUX_VERSION }}.bin

- name: Download [rom.bin]
uses: Legion2/[email protected]
with:
repository: ${{ github.repository_owner }}/machine-emulator-rom
tag: ${{ env.ROM_VERSION }}
file: rom-${{ env.ROM_VERSION }}.bin

- name: Move images to cartesi images folder
run: |
mkdir -m 755 -p /tmp/cartesi-machine-images
mv rom-*.bin linux-*.bin rootfs-*.ext2 ${{ env.HOST_IMAGES_PATH }}
mv linux-*.bin rootfs-*.ext2 ${{ env.HOST_IMAGES_PATH }}
cd ${{ env.HOST_IMAGES_PATH }} && ln -s linux-${{ env.LINUX_VERSION }}.bin linux.bin
cd ${{ env.HOST_IMAGES_PATH }} && ln -s rom-${{ env.ROM_VERSION }}.bin rom.bin
cd ${{ env.HOST_IMAGES_PATH }} && ln -s rootfs-${{ env.ROOTFS_VERSION }}.ext2 rootfs.ext2
cd ${{ env.HOST_IMAGES_PATH }} && ln -s rootfs-tools-${{ env.TOOLS_VERSION }}.ext2 rootfs.ext2

- name: Run test suite inside the docker image (Linux/${{ matrix.arch }})
run: |
Expand All @@ -285,18 +268,18 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout server-manager source code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down Expand Up @@ -335,7 +318,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout server-manager source code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -351,13 +334,13 @@ jobs:
type=semver,pattern={{version}},enable=${{startsWith(github.ref, 'refs/tags/v')}}

- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Conventional Commits Check
on: [push]
jobs:
commit_messages:
runs-on: ubuntu-latest
steps:
- name: Install cocogitto tool
run: |
VERSION=5.6.0
TAR=cocogitto-${VERSION}-x86_64-unknown-linux-musl.tar.gz
curl --output-dir /tmp -OL https://github.com/cocogitto/cocogitto/releases/download/${VERSION}/${TAR}
sudo tar -xzf /tmp/${TAR} -C /usr/local/bin

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Conventional commit check
run: |
# Assuming 'main' is the default base branch
BASE_BRANCH=${{ github.base_ref || 'origin/main' }}
cog check ${BASE_BRANCH}..HEAD
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "lib/grpc-interfaces"]
path = lib/grpc-interfaces
url = ../grpc-interfaces.git
[submodule "lib/machine-emulator-defines"]
path = lib/machine-emulator-defines
url = ../machine-emulator-defines.git
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.9.0] - 2024-02-09
### Changed
- Updated machine-emulator base image to v0.16.0
- Updated libboost version to 1.81
- Updated grpc-interfaces
- Removed machine-emulator-defines
- Look for remote-cartesi-machine in PATH
- Bumped version to 0.9.0

### Added
- Added \-\-version command line option

## [0.8.3] - 2024-01-25
### Changed
- Updated server-manager version to v0.8.3
Expand Down Expand Up @@ -44,7 +56,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The creation of test machines was extracted from the test-server-manager to a lua script
- The license changed to Apache license 2.0

[Unreleased]: https://github.com/cartesi/server-manager/compare/v0.8.3...HEAD
[Unreleased]: https://github.com/cartesi/server-manager/compare/v0.9.0...HEAD
[0.9.0]: https://github.com/cartesi/server-manager/releases/tag/v0.9.0
[0.8.3]: https://github.com/cartesi/server-manager/releases/tag/v0.8.3
[0.8.2]: https://github.com/cartesi/server-manager/releases/tag/v0.8.2
[0.8.1]: https://github.com/cartesi/server-manager/releases/tag/v0.8.1
Expand Down
28 changes: 16 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
ARG EMULATOR_REPOSITORY=cartesi/machine-emulator
ARG EMULATOR_TAG=0.15.3
ARG EMULATOR_TAG=0.16.0
ARG RELEASE=yes

FROM --platform=$TARGETPLATFORM ${EMULATOR_REPOSITORY}:${EMULATOR_TAG} as dep-builder
FROM --platform=$TARGETPLATFORM ${EMULATOR_REPOSITORY}:${EMULATOR_TAG} as linux-env

USER root

RUN apt-get update && \
DEBIAN_FRONTEND="noninteractive" apt-get install --no-install-recommends -y \
build-essential wget git \
libreadline-dev libboost-coroutine-dev libboost-context-dev \
libboost-filesystem-dev libboost-log-dev libssl-dev libc-ares-dev zlib1g-dev \
ca-certificates automake libtool patchelf cmake pkg-config lua5.4 liblua5.4-dev \
libgrpc++-dev libprotobuf-dev protobuf-compiler-grpc \
libcrypto++-dev clang-tidy-15 clang-format-15 && \
update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-15 120 && \
update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-15 120 && \
build-essential wget git procps \
libreadline-dev libboost-coroutine1.81-dev libboost-context1.81-dev \
libboost-filesystem1.81-dev libboost-log1.81-dev libssl-dev libc-ares-dev zlib1g-dev \
ca-certificates automake libtool patchelf cmake pkg-config lua5.4 liblua5.4-dev \
libgrpc++-dev libprotobuf-dev protobuf-compiler-grpc \
libcrypto++-dev clang-tidy-16 clang-format-16 && \
update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-16 120 && \
update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-16 120 && \
rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/server-manager

FROM --platform=$TARGETPLATFORM dep-builder as builder
FROM --platform=$TARGETPLATFORM linux-env as builder

COPY . .

Expand All @@ -36,7 +36,11 @@ FROM --platform=$TARGETPLATFORM ${EMULATOR_REPOSITORY}:${EMULATOR_TAG}
USER root

RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y \
libboost-log1.74.0 \
libboost-coroutine1.81.0 \
libboost-context1.81.0 \
libboost-filesystem1.81.0 \
libboost-log1.81.0 \
libcrypto++8 \
&& rm -rf /var/lib/apt/lists/*

COPY --from=installer /usr/bin/server-manager /usr/bin/server-manager
Expand Down
25 changes: 23 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ HEALTHCHECK_PROTO := third-party/health.proto

# Docker image settings
TAG ?= devel
EMULATOR_TAG ?= 0.15.3
EMULATOR_TAG ?= 0.16.0
EMULATOR_REPOSITORY ?= cartesi/machine-emulator

# Mac OS X specific settings
Expand Down Expand Up @@ -109,7 +109,7 @@ $(SERVER_MANAGER_PROTO):
@exit 1

test server-manager: | $(SERVER_MANAGER_PROTO) $(HEALTHCHECK_PROTO)
test lint coverage-report check-format format server-manager create-machines create-and-test clean-machines run-test-server-manager:
test lint coverage-report check-format format server-manager create-machines create-and-test clean-machines clean-test-processes run-test-server-manager:
@eval $$($(MAKE) -s --no-print-directory env); $(MAKE) -C $(SRCDIR) $@

source-default: | $(SERVER_MANAGER_PROTO) checksum
Expand All @@ -118,9 +118,30 @@ source-default: | $(SERVER_MANAGER_PROTO) checksum
image:
docker build -t cartesi/server-manager:$(TAG) -f Dockerfile --build-arg EMULATOR_REPOSITORY=$(EMULATOR_REPOSITORY) --build-arg EMULATOR_TAG=$(EMULATOR_TAG) .

linux-env-stage-image:
docker build --target linux-env -t cartesi/server-manager:linux-env -f Dockerfile --build-arg EMULATOR_REPOSITORY=$(EMULATOR_REPOSITORY) --build-arg EMULATOR_TAG=$(EMULATOR_TAG) .

installer-stage-image:
docker build --target installer -t cartesi/server-manager:installer -f Dockerfile --build-arg EMULATOR_REPOSITORY=$(EMULATOR_REPOSITORY) --build-arg EMULATOR_TAG=$(EMULATOR_TAG) .

check-linux-env:
@if docker images $(DOCKER_PLATFORM) -q cartesi/server-manager:linux-env 2>/dev/null | grep -q .; then \
echo "Docker image cartesi/server-manager:linux-env exists"; \
else \
echo "Docker image cartesi/server-manager:linux-env does not exist. Creating:"; \
$(MAKE) linux-env-stage-image; \
fi

linux-env: check-linux-env
@docker run $(DOCKER_PLATFORM) --hostname linux-env -it --rm \
-e USER=$$(id -u -n) \
-e GROUP=$$(id -g -n) \
-e UID=$$(id -u) \
-e GID=$$(id -g) \
-v `pwd`:/usr/src/server-manager \
-w /usr/src/server-manager \
cartesi/server-manager:linux-env /bin/bash

$(SUBCLEAN): %.clean:
$(MAKE) -C $* clean

Expand Down
Loading
Loading