From 02adef8c755b8972620ac48fe261bdd604e6f9a6 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 3 Jan 2024 23:58:18 +0000 Subject: [PATCH 1/7] feat: doxygen initial --- barretenberg/cpp/.dockerignore | 5 ++++- barretenberg/cpp/docs/Dockerfile | 18 ++++++++++++++++++ barretenberg/cpp/docs/Doxyfile | 18 ++++++++++++++++++ build_manifest.yml | 4 ++++ 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 barretenberg/cpp/docs/Dockerfile create mode 100644 barretenberg/cpp/docs/Doxyfile diff --git a/barretenberg/cpp/.dockerignore b/barretenberg/cpp/.dockerignore index 7c18c4a13f92..27554eeebccf 100644 --- a/barretenberg/cpp/.dockerignore +++ b/barretenberg/cpp/.dockerignore @@ -20,4 +20,7 @@ !scripts/install-wasi-sdk.sh !scripts/strip-wasm.sh !./.clang-format -!./format.sh \ No newline at end of file +!./format.sh + +# Doxygen stuff. +!docs diff --git a/barretenberg/cpp/docs/Dockerfile b/barretenberg/cpp/docs/Dockerfile new file mode 100644 index 000000000000..2ced75618f04 --- /dev/null +++ b/barretenberg/cpp/docs/Dockerfile @@ -0,0 +1,18 @@ +FROM alpine:3.18 AS builder +RUN apk update \ + && apk upgrade \ + && apk add --no-cache \ + build-base \ + clang16 \ + cmake \ + ninja \ + git \ + curl \ + perl \ + doxygen +WORKDIR /usr/src/barretenberg/cpp/ +COPY . . +RUN cd docs +RUN doxygen --version +RUN doxygen . +RUN ls build diff --git a/barretenberg/cpp/docs/Doxyfile b/barretenberg/cpp/docs/Doxyfile new file mode 100644 index 000000000000..0a2ddc9342dc --- /dev/null +++ b/barretenberg/cpp/docs/Doxyfile @@ -0,0 +1,18 @@ +# Minimal Doxyfile. See https://www.doxygen.nl/manual/config.html + +# Project related configuration options +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = "barretenberg" +OUTPUT_DIRECTORY = ./build + +# Paths and filenames +INPUT = ../src/barretenberg +FILE_PATTERNS = *.c \ + *.cpp \ + *.h \ + *.hpp +RECURSIVE = YES + +# Output format options +GENERATE_HTML = YES +HTML_OUTPUT = html diff --git a/build_manifest.yml b/build_manifest.yml index 17b2506a382b..be3cf2432739 100644 --- a/build_manifest.yml +++ b/build_manifest.yml @@ -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 From 512543e05bd86db67c1a36a0a80e687fbc72e357 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 4 Jan 2024 02:16:32 +0000 Subject: [PATCH 2/7] Doxygen CI --- .circleci/config.yml | 17 +++++++++++++++++ barretenberg/cpp/docs/Dockerfile | 5 +---- barretenberg/cpp/docs/Doxyfile | 7 ++++--- barretenberg/cpp/docs/deploy_doxygen.sh | 13 +++++++++++++ 4 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 barretenberg/cpp/docs/deploy_doxygen.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 7237ac8093ad..7278c2d6d17a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -192,6 +192,22 @@ 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 docs" + working_directory: + command: | + docs/deploy_netlify.sh + barretenberg-stdlib-tests: docker: - image: aztecprotocol/alpine-build-image @@ -1091,6 +1107,7 @@ workflows: - barretenberg-x86_64-linux-clang-assert - noir-compile-acir-tests <<: *defaults + - barretenberg-docs: *defaults - bb-js: requires: - barretenberg-wasm-linux-clang diff --git a/barretenberg/cpp/docs/Dockerfile b/barretenberg/cpp/docs/Dockerfile index 2ced75618f04..cbebaac1a2ee 100644 --- a/barretenberg/cpp/docs/Dockerfile +++ b/barretenberg/cpp/docs/Dockerfile @@ -12,7 +12,4 @@ RUN apk update \ doxygen WORKDIR /usr/src/barretenberg/cpp/ COPY . . -RUN cd docs -RUN doxygen --version -RUN doxygen . -RUN ls build +RUN doxygen docs/Doxyfile diff --git a/barretenberg/cpp/docs/Doxyfile b/barretenberg/cpp/docs/Doxyfile index 0a2ddc9342dc..c2f8de480992 100644 --- a/barretenberg/cpp/docs/Doxyfile +++ b/barretenberg/cpp/docs/Doxyfile @@ -3,10 +3,10 @@ # Project related configuration options DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = "barretenberg" -OUTPUT_DIRECTORY = ./build # Paths and filenames -INPUT = ../src/barretenberg +INPUT = src/barretenberg +HTML_OUTPUT = docs/build FILE_PATTERNS = *.c \ *.cpp \ *.h \ @@ -15,4 +15,5 @@ RECURSIVE = YES # Output format options GENERATE_HTML = YES -HTML_OUTPUT = html +GENERATE_LATEX = NO +HAVE_DOT = NO diff --git a/barretenberg/cpp/docs/deploy_doxygen.sh b/barretenberg/cpp/docs/deploy_doxygen.sh new file mode 100644 index 000000000000..60f10688df08 --- /dev/null +++ b/barretenberg/cpp/docs/deploy_doxygen.sh @@ -0,0 +1,13 @@ +# 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" +COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" +TARGET_FOLDER="doxygen/$COMMIT_HASH" + +aws s3 cp extracted-repo/src/barretenberg/cpp/docs/build "s3://$BUCKET_NAME/$TARGET_FOLDER" --recursive \ No newline at end of file From 1ff030d8d5841804bed3d3242827a1338897f832 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 4 Jan 2024 02:23:16 +0000 Subject: [PATCH 3/7] Doxygen CI --- .circleci/config.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7278c2d6d17a..7581421ad381 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -200,13 +200,12 @@ jobs: - *checkout - *setup_env - run: - name: "Build barretenberg-docs" + name: "Build barretenberg docs" command: build barretenberg-docs - run: - name: "Deploy docs" - working_directory: + name: "Deploy barretenberg docs" command: | - docs/deploy_netlify.sh + barretenberg/cpp/docs/deploy_doxygen.sh barretenberg-stdlib-tests: docker: From a9341596d90053f722ea9dc1d831fddca1ffb449 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 4 Jan 2024 02:25:21 +0000 Subject: [PATCH 4/7] Doxygen CI --- barretenberg/cpp/docs/deploy_doxygen.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 barretenberg/cpp/docs/deploy_doxygen.sh diff --git a/barretenberg/cpp/docs/deploy_doxygen.sh b/barretenberg/cpp/docs/deploy_doxygen.sh old mode 100644 new mode 100755 From b4698b822e6d73dd87433f4d5c9c01572ca041b0 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 4 Jan 2024 02:27:00 +0000 Subject: [PATCH 5/7] Doxygen CI --- barretenberg/cpp/docs/deploy_doxygen.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/barretenberg/cpp/docs/deploy_doxygen.sh b/barretenberg/cpp/docs/deploy_doxygen.sh index 60f10688df08..51c85a4a91b5 100755 --- a/barretenberg/cpp/docs/deploy_doxygen.sh +++ b/barretenberg/cpp/docs/deploy_doxygen.sh @@ -10,4 +10,5 @@ BUCKET_NAME="aztec-ci-artifacts" COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" TARGET_FOLDER="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 \ No newline at end of file From 3f0fad0de81d472cf71c03df11cf01ed6e7e09e0 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 4 Jan 2024 02:49:50 +0000 Subject: [PATCH 6/7] Doxygen CI --- barretenberg/cpp/docs/deploy_doxygen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/barretenberg/cpp/docs/deploy_doxygen.sh b/barretenberg/cpp/docs/deploy_doxygen.sh index 51c85a4a91b5..14560bd01a23 100755 --- a/barretenberg/cpp/docs/deploy_doxygen.sh +++ b/barretenberg/cpp/docs/deploy_doxygen.sh @@ -8,7 +8,7 @@ extract_repo barretenberg-docs /usr/src extracted-repo BUCKET_NAME="aztec-ci-artifacts" COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" -TARGET_FOLDER="doxygen/$COMMIT_HASH" +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 \ No newline at end of file From 5035c8b04421927d9181e1a2d81643b2dda02012 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 4 Jan 2024 09:48:34 -0500 Subject: [PATCH 7/7] Update barretenberg/cpp/docs/Dockerfile Co-authored-by: Maddiaa <47148561+Maddiaa0@users.noreply.github.com> --- barretenberg/cpp/docs/Dockerfile | 7 ------- 1 file changed, 7 deletions(-) diff --git a/barretenberg/cpp/docs/Dockerfile b/barretenberg/cpp/docs/Dockerfile index cbebaac1a2ee..509ab46e5395 100644 --- a/barretenberg/cpp/docs/Dockerfile +++ b/barretenberg/cpp/docs/Dockerfile @@ -2,13 +2,6 @@ FROM alpine:3.18 AS builder RUN apk update \ && apk upgrade \ && apk add --no-cache \ - build-base \ - clang16 \ - cmake \ - ninja \ - git \ - curl \ - perl \ doxygen WORKDIR /usr/src/barretenberg/cpp/ COPY . .