Skip to content
Draft
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
19 changes: 19 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This is a good default: files that are auto-detected by git to be text are
# converted to the platform-native line ending (LF on Unix, CRLF on Windows)
# in the working tree and to LF in the repository.
#
* text=auto

# Use `eol=crlf` for files that should have the CRLF line ending both in the
# working tree (even on Unix) and in the repository.
#
#*.bat text eol=crlf

# Use `eol=lf` for files that should have the LF line ending both in the
# working tree (even on Windows) and in the repository.
#
#*.sh text eol=lf

# Use `binary` to make sure certain files are never auto-detected as text.
#
#*.png binary
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
push:
pull_request:

permissions:
contents: read

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
uses: vivarium-ai/certifiable-github/.github/workflows/ci.yml@master
with:
build-target: certifiable-deploy

tt-build:
uses: vivarium-ai/certifiable-github/.github/workflows/tt-ci.yml@master
with:
build-target: certifiable-deploy
tt_dev_image: ghcr.io/tenstorrent/tt-metal/tt-metalium/ubuntu-22.04-dev-amd64:d6958801d86fe1e20a07f2be7795fac0b2c9b211
42 changes: 41 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
.bdep/

# Local default options files.
#
.build2/local/

# Compiler/linker output.
#
*.d
*.t
*.i
*.i.*
*.ii
*.ii.*
*.o
*.obj
*.gcm
*.pcm
*.ifc
*.so
*.dylib
*.dll
*.a
*.lib
*.exp
*.pdb
*.ilk
*.exe
*.exe.dlls/
*.exe.manifest
*.pc

# Build2 symlinks exes from build dir to src dir for convenient
tests/unit/test_attest
tests/unit/test_audit
tests/unit/test_target
tests/unit/test_verify
tests/unit/test_bundle
tests/unit/test_loader
tests/unit/test_manifest

# Build
build/
*.o
*.a
*.so
Expand Down
131 changes: 63 additions & 68 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,68 +1,63 @@
# certifiable-deploy Makefile
# Copyright (c) 2026 The Murray Family Innovation Trust. All rights reserved.

CC = gcc
CFLAGS = -std=c99 -Wall -Wextra -Wpedantic -Werror -Wshadow -Wconversion
CFLAGS += -Wstrict-prototypes -fno-common -O2 -g
CFLAGS += -I./include

# Source files
AUDIT_SRC = src/audit/sha256.c src/audit/domain_hash.c
ATTEST_SRC = src/attest/merkle.c
TARGET_SRC = src/target/target.c
VERIFY_SRC = src/verify/verify.c

ALL_SRC = $(AUDIT_SRC) $(ATTEST_SRC) $(TARGET_SRC) $(VERIFY_SRC)

# Test executables
TEST_AUDIT = tests/unit/test_audit
TEST_ATTEST = tests/unit/test_attest
TEST_TARGET = tests/unit/test_target
TEST_VERIFY = tests/unit/test_verify

.PHONY: all clean test test-audit test-attest test-target test-verify

all: $(TEST_AUDIT) $(TEST_ATTEST) $(TEST_TARGET) $(TEST_VERIFY)

# Test executables
$(TEST_AUDIT): tests/unit/test_audit.c $(AUDIT_SRC)
$(CC) $(CFLAGS) -o $@ $^

$(TEST_ATTEST): tests/unit/test_attest.c $(AUDIT_SRC) $(ATTEST_SRC)
$(CC) $(CFLAGS) -o $@ $^

$(TEST_TARGET): tests/unit/test_target.c $(TARGET_SRC)
$(CC) $(CFLAGS) -o $@ $^

$(TEST_VERIFY): tests/unit/test_verify.c $(ALL_SRC)
$(CC) $(CFLAGS) -o $@ $^

# Test targets
test-audit: $(TEST_AUDIT)
./$(TEST_AUDIT)

test-attest: $(TEST_ATTEST)
./$(TEST_ATTEST)

test-target: $(TEST_TARGET)
./$(TEST_TARGET)

test-verify: $(TEST_VERIFY)
./$(TEST_VERIFY)

test: all
@echo ""
@echo "========================================"
@echo " certifiable-deploy test suite"
@echo "========================================"
@./$(TEST_AUDIT)
@./$(TEST_ATTEST)
@./$(TEST_TARGET)
@./$(TEST_VERIFY)
@echo "========================================"
@echo " All tests passed!"
@echo "========================================"

clean:
rm -f $(TEST_AUDIT) $(TEST_ATTEST) $(TEST_TARGET) $(TEST_VERIFY)
rm -f *.o src/*/*.o tests/unit/*.o
EXES :=
DIST :=

# Versioning
VERSION ?= $(shell (git describe --tags 2>/dev/null || echo "develop") | sed 's/^v//')
REVISION ?= $(shell git rev-parse --short HEAD)

export VERSION
export REVISION

# Build configuration (overrideable)
# build2 requires out-of-source builds. Default to parent directory with compiler suffix.
SRCDIR := $(notdir $(CURDIR))
SCRIPTS_DIR ?= ./certifiable-build/scripts
BUILD_DIR ?= ../build2/$(SRCDIR)-default
BUILD_TYPE ?= release
PREFIX ?= /usr/local

# Export for scripts
export BUILD_DIR
export BUILD_TYPE
export PREFIX

.PHONY: all help setup start-tt config build test install package release clean

all: config build test

##@ Dependencies
setup: ## Setup project
$(SCRIPTS_DIR)/setup.sh

##@ Development
config: ## Configure the build
$(SCRIPTS_DIR)/config.sh

build: ## Build the project
$(SCRIPTS_DIR)/build.sh

start-tt: ## Start the Tenstorrent container
$(SCRIPTS_DIR)/start-tt.sh

##@ Testing
test: ## Run tests
$(SCRIPTS_DIR)/test.sh

##@ Project Management
install: build ## Install the project
$(SCRIPTS_DIR)/install.sh

package: ## Build release artifacts
$(SCRIPTS_DIR)/package.sh

release: ## Publish release artifacts
$(SCRIPTS_DIR)/release.sh

##@ Maintenance
clean: ## Remove all build artifacts
$(SCRIPTS_DIR)/clean.sh

##@ Documentation
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "Makefile Usage:\n make \033[36m<target>\033[0m\n"} /^[.a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

4 changes: 4 additions & 0 deletions build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/config.build
/root/
/bootstrap/
build/
7 changes: 7 additions & 0 deletions build/bootstrap.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
project = certifiable-deploy

using version
using config
using test
using install
using dist
6 changes: 6 additions & 0 deletions build/export.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$out_root/
{
include include/
}

export $out_root/include/$import.target
11 changes: 11 additions & 0 deletions build/root.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using c
using test

c.std = c99
c.warnings = all
c.coptions += -Werror -pedantic -Wno-unused-parameter

if ($c.id == 'gcc')
c.coptions += -fanalyzer

c.poptions =+ "-I$src_root/include"
13 changes: 13 additions & 0 deletions buildfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
./: {*/ -build/ -certifiable-build/ -include/ -.github/ -docs/} \
doc{README.md} \
legal{LICENSE} \
manifest

./: src/ tests/

import src = src/
import tests = tests/

# Don't install tests.
#
tests/: install = false
Empty file added certifiable-build/.gitignore
Empty file.
Loading