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

feat: barretenberg doxygen CI #3818

Merged
merged 9 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
16 changes: 16 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,21 @@ jobs:
name: "Build"
command: cond_spot_run_build barretenberg-x86_64-linux-clang-sol 32

barretenberg-docs:
machine:
image: ubuntu-2204:2023.07.2
resource_class: large
steps:
- *checkout
- *setup_env
- run:
name: "Build barretenberg docs"
command: build barretenberg-docs
- run:
name: "Deploy barretenberg docs"
command: |
barretenberg/cpp/docs/deploy_doxygen.sh

barretenberg-stdlib-tests:
docker:
- image: aztecprotocol/alpine-build-image
Expand Down Expand Up @@ -1091,6 +1106,7 @@ workflows:
- barretenberg-x86_64-linux-clang-assert
- noir-compile-acir-tests
<<: *defaults
- barretenberg-docs: *defaults
- bb-js:
requires:
- barretenberg-wasm-linux-clang
Expand Down
5 changes: 4 additions & 1 deletion barretenberg/cpp/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@
!scripts/install-wasi-sdk.sh
!scripts/strip-wasm.sh
!./.clang-format
!./format.sh
!./format.sh

# Doxygen stuff.
!docs
15 changes: 15 additions & 0 deletions barretenberg/cpp/docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM alpine:3.18 AS builder
RUN apk update \
&& apk upgrade \
&& apk add --no-cache \
build-base \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think everything but doxygen can be removed from here, its not doing any building

clang16 \
cmake \
ninja \
git \
curl \
perl \
doxygen
ludamad marked this conversation as resolved.
Show resolved Hide resolved
WORKDIR /usr/src/barretenberg/cpp/
COPY . .
RUN doxygen docs/Doxyfile
19 changes: 19 additions & 0 deletions barretenberg/cpp/docs/Doxyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal Doxyfile. See https://www.doxygen.nl/manual/config.html

# Project related configuration options
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "barretenberg"

# Paths and filenames
INPUT = src/barretenberg
HTML_OUTPUT = docs/build
FILE_PATTERNS = *.c \
*.cpp \
*.h \
*.hpp
RECURSIVE = YES

# Output format options
GENERATE_HTML = YES
GENERATE_LATEX = NO
HAVE_DOT = NO
14 changes: 14 additions & 0 deletions barretenberg/cpp/docs/deploy_doxygen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Uploads to S3 the contents of a doxygen barretenberg C++ documentation build.
# This is then to be used as a static website.
#!/usr/bin/env bash
[ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace
set -eu

extract_repo barretenberg-docs /usr/src extracted-repo

BUCKET_NAME="aztec-ci-artifacts"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this bucket be owned by some terraform?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, this will need DNS but that's about it, otherwise it's artifacts that aren't really controlled by declarative config

COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}"
TARGET_FOLDER="barretenberg-doxygen/$COMMIT_HASH"

echo "Uploading to s3://$BUCKET_NAME/$TARGET_FOLDER"
aws s3 cp extracted-repo/src/barretenberg/cpp/docs/build "s3://$BUCKET_NAME/$TARGET_FOLDER" --recursive
4 changes: 4 additions & 0 deletions build_manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ barretenberg-acir-tests-bb.js:
- bb.js
- noir-compile-acir-tests

barretenberg-docs:
buildDir: barretenberg/cpp
dockerfile: docs/Dockerfile

l1-contracts:
buildDir: l1-contracts

Expand Down