From 215a8e3f8d9b63a25221ef163fe21f212313d3cf Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Wed, 15 Jan 2025 08:25:09 -0800 Subject: [PATCH 01/14] chore: Migrate the github pages deploy flow --- .circleci/config.yml | 54 ++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9d7605ddf..ecb83ec6f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,13 +1,17 @@ version: 2.1 + orbs: slack: circleci/slack@4.10.1 -parameters: - ci_builder_image: - type: string - default: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.35.0 - base_image: - type: string - default: ubuntu-2204:2022.07.1 + utils: ethereum-optimism/circleci-utils@0.0.11 + +executors: + base: + machine: + image: ubuntu-2204:2022.07.1 + builder: + docker: + - image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder-rust:v0.35.0 + commands: notify-failures-on-develop: description: "Notify Slack" @@ -21,15 +25,12 @@ commands: event: fail template: basic_fail_1 branch_pattern: develop + jobs: lint-specs: - docker: - - image: <> + executor: builder steps: - checkout - - run: - name: Install pnpm - command: npm install -g pnpm@9.1.0 - run: name: Install deps command: just deps @@ -42,9 +43,9 @@ jobs: - run: name: build book command: just build + lint-links: - machine: - image: <> + executor: base steps: - checkout - run: @@ -52,6 +53,24 @@ jobs: command: just lint-links - notify-failures-on-develop: channel: C055R639XT9 #notify-link-check + + publish-pages: + executor: builder + steps: + - checkout + - run: + name: Install dependencies + command: just deps + - run: + name: Build + command: just build + - run: + name: Add CNAME file + command: echo "specs.optimism.io" > ./book/html/CNAME + - utils/get-github-access-token + - utils/github-pages-deploy: + src-pages-dir: ./book/html + workflows: specs-check: when: @@ -65,3 +84,10 @@ workflows: jobs: - lint-links: context: slack + + publish: + jobs: + - publish-pages: + filters: + branches: + only: main From 75c890e14d10881c3461f3ec80e7db7bae1af14d Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Wed, 15 Jan 2025 09:06:04 -0800 Subject: [PATCH 02/14] fix: PNPM --- .circleci/config.yml | 19 ++++++++++++------- package.json | 3 ++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ecb83ec6f..b752591ca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,9 +10,18 @@ executors: image: ubuntu-2204:2022.07.1 builder: docker: - - image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder-rust:v0.35.0 + - image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder-rust:22ebfb824d959a27a372cca10fe39aeb0b610343 commands: + install-dependencies: + description: Install dependencies + steps: + - run: + name: Enable corepack + command: corepack enable + - run: + name: Install dependencies + command: just deps notify-failures-on-develop: description: "Notify Slack" parameters: @@ -31,9 +40,7 @@ jobs: executor: builder steps: - checkout - - run: - name: Install deps - command: just deps + - install-dependencies - run: name: markdown lint command: just lint-specs-md-check @@ -58,9 +65,7 @@ jobs: executor: builder steps: - checkout - - run: - name: Install dependencies - command: just deps + - install-dependencies - run: name: Build command: just build diff --git a/package.json b/package.json index 7b27f9053..596cd95d3 100644 --- a/package.json +++ b/package.json @@ -10,5 +10,6 @@ "doctoc": "^2.2.1", "markdownlint-cli2": "0.4.0", "cspell": "^8.1.3" - } + }, + "packageManager": "pnpm@9.15.4" } From f61bf5f5504363cf9708fcc3e0efe7045f3aac9c Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Wed, 15 Jan 2025 09:41:31 -0800 Subject: [PATCH 03/14] chore: Bump utils orb version --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b752591ca..ea45f54e3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2.1 orbs: slack: circleci/slack@4.10.1 - utils: ethereum-optimism/circleci-utils@0.0.11 + utils: ethereum-optimism/circleci-utils@0.0.12 executors: base: From bd570ec631e252452510ba6befdb9305a99a031e Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Wed, 15 Jan 2025 09:43:19 -0800 Subject: [PATCH 04/14] chore: Add context --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index ea45f54e3..29d4dfb81 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -93,6 +93,8 @@ workflows: publish: jobs: - publish-pages: + context: + - circleci-repo-specs filters: branches: only: main From 023915ec666a361e1cfcefcd8b1f52559af557ae Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Wed, 15 Jan 2025 09:44:02 -0800 Subject: [PATCH 05/14] debug: Pages --- .circleci/config.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 29d4dfb81..18ba7604d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,6 +75,7 @@ jobs: - utils/get-github-access-token - utils/github-pages-deploy: src-pages-dir: ./book/html + pages-branch: gh-pages-test workflows: specs-check: @@ -95,6 +96,6 @@ workflows: - publish-pages: context: - circleci-repo-specs - filters: - branches: - only: main + # filters: + # branches: + # only: main From 00e8cf258ef87c60021a878a3f635dc76b6b167a Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Wed, 15 Jan 2025 10:08:58 -0800 Subject: [PATCH 06/14] debug: Persisting --- .circleci/config.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 18ba7604d..f4e7158e8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,7 +61,7 @@ jobs: - notify-failures-on-develop: channel: C055R639XT9 #notify-link-check - publish-pages: + build-pages: executor: builder steps: - checkout @@ -72,9 +72,22 @@ jobs: - run: name: Add CNAME file command: echo "specs.optimism.io" > ./book/html/CNAME + - persist_to_workspace: + root: ./book + paths: + - html + + publish-pages: + executor: base + steps: + - attach_workspace: + at: /tmp/book + - run: + name: List + command: ls -al /tmp/book - utils/get-github-access-token - utils/github-pages-deploy: - src-pages-dir: ./book/html + src-pages-dir: /tmp/book/html pages-branch: gh-pages-test workflows: @@ -93,7 +106,10 @@ workflows: publish: jobs: + - build-pages - publish-pages: + requires: + - build-pages context: - circleci-repo-specs # filters: From fd5e0c55216aefb65bf616cf5854c4f38e75c414 Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Wed, 15 Jan 2025 12:42:37 -0800 Subject: [PATCH 07/14] chore: Cleanup --- .circleci/config.yml | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f4e7158e8..23808b9ea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ orbs: executors: base: machine: - image: ubuntu-2204:2022.07.1 + image: ubuntu-2404:current builder: docker: - image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder-rust:22ebfb824d959a27a372cca10fe39aeb0b610343 @@ -16,6 +16,8 @@ commands: install-dependencies: description: Install dependencies steps: + # We enable corepack, a nodejs package manager manager + # that is reponsible for automatically determining the correct version of pnpm to use - run: name: Enable corepack command: corepack enable @@ -37,19 +39,15 @@ commands: jobs: lint-specs: - executor: builder + executor: base steps: - checkout - - install-dependencies - run: name: markdown lint command: just lint-specs-md-check - run: name: markdown toc command: just lint-specs-toc-check - - run: - name: build book - command: just build lint-links: executor: base @@ -61,7 +59,7 @@ jobs: - notify-failures-on-develop: channel: C055R639XT9 #notify-link-check - build-pages: + build-book: executor: builder steps: - checkout @@ -77,18 +75,15 @@ jobs: paths: - html - publish-pages: + publish-book: executor: base steps: + - checkout - attach_workspace: at: /tmp/book - - run: - name: List - command: ls -al /tmp/book - utils/get-github-access-token - utils/github-pages-deploy: src-pages-dir: /tmp/book/html - pages-branch: gh-pages-test workflows: specs-check: @@ -97,6 +92,7 @@ workflows: equal: [scheduled_pipeline, << pipeline.trigger_source >>] jobs: - lint-specs + - build-book scheduled-links-check: when: equal: [build_daily, <>] @@ -106,10 +102,10 @@ workflows: publish: jobs: - - build-pages - - publish-pages: + - build-book + - publish-book: requires: - - build-pages + - build-book context: - circleci-repo-specs # filters: From b8dfd7a6659a8fd8c8ea0b8dcffe0dc48ff65cd6 Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Wed, 15 Jan 2025 13:44:52 -0800 Subject: [PATCH 08/14] debug: Branch --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 23808b9ea..3831b1b68 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -84,6 +84,7 @@ jobs: - utils/get-github-access-token - utils/github-pages-deploy: src-pages-dir: /tmp/book/html + pages-branch: gh-pages-test workflows: specs-check: From 02ab96dc6fcf5b5c53e2d74b80c490e6d19c8b44 Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Wed, 15 Jan 2025 13:46:34 -0800 Subject: [PATCH 09/14] debug: Executor --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3831b1b68..40a6fb8f2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,7 +39,7 @@ commands: jobs: lint-specs: - executor: base + executor: builder steps: - checkout - run: @@ -50,7 +50,7 @@ jobs: command: just lint-specs-toc-check lint-links: - executor: base + executor: builder steps: - checkout - run: From 12dd0d80760f27d01060e56c464f7fba608e7ec9 Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Wed, 15 Jan 2025 14:01:45 -0800 Subject: [PATCH 10/14] chore: Remove debugging --- .circleci/config.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 40a6fb8f2..f3b5fcacd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -84,7 +84,6 @@ jobs: - utils/get-github-access-token - utils/github-pages-deploy: src-pages-dir: /tmp/book/html - pages-branch: gh-pages-test workflows: specs-check: @@ -109,6 +108,6 @@ workflows: - build-book context: - circleci-repo-specs - # filters: - # branches: - # only: main + filters: + branches: + only: main From ca2fd2e199b7ffcfdeb353b8da90a6c1291c5401 Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Fri, 17 Jan 2025 08:19:18 -0800 Subject: [PATCH 11/14] chore: Move filters upstream --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f3b5fcacd..7b66bc9a1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -102,12 +102,12 @@ workflows: publish: jobs: - - build-book + - build-book: + filters: + branches: + only: main - publish-book: requires: - build-book context: - circleci-repo-specs - filters: - branches: - only: main From 2963caa95e7a21c35baafca791c5f13e148619aa Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Fri, 17 Jan 2025 08:21:27 -0800 Subject: [PATCH 12/14] chore: Newline --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7b66bc9a1..9c7194a96 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -93,6 +93,7 @@ workflows: jobs: - lint-specs - build-book + scheduled-links-check: when: equal: [build_daily, <>] From be57242e7734f12fd226d20649f45ba221f8dd43 Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Fri, 17 Jan 2025 08:51:18 -0800 Subject: [PATCH 13/14] chore: Add mise --- .circleci/config.yml | 30 ++++++++++++++---------------- README.md | 20 ++++++++++++++++++++ mise.toml | 23 +++++++++++++++++++++++ 3 files changed, 57 insertions(+), 16 deletions(-) create mode 100644 mise.toml diff --git a/.circleci/config.yml b/.circleci/config.yml index 9c7194a96..c4d689ceb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,25 +5,23 @@ orbs: utils: ethereum-optimism/circleci-utils@0.0.12 executors: - base: + default: machine: - image: ubuntu-2404:current - builder: - docker: - - image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder-rust:22ebfb824d959a27a372cca10fe39aeb0b610343 + image: ubuntu-2204:2024.08.1 commands: install-dependencies: - description: Install dependencies steps: - # We enable corepack, a nodejs package manager manager - # that is reponsible for automatically determining the correct version of pnpm to use - run: - name: Enable corepack - command: corepack enable + name: Install mise + command: curl https://mise.run | MISE_INSTALL_PATH=/home/circleci/bin/mise sh - run: - name: Install dependencies - command: just deps + name: Activate mise + command: echo 'eval "$(mise activate bash)"' >> $BASH_ENV + - run: + name: Install mise dependencies + command: mise install + notify-failures-on-develop: description: "Notify Slack" parameters: @@ -39,7 +37,7 @@ commands: jobs: lint-specs: - executor: builder + executor: default steps: - checkout - run: @@ -50,7 +48,7 @@ jobs: command: just lint-specs-toc-check lint-links: - executor: builder + executor: default steps: - checkout - run: @@ -60,7 +58,7 @@ jobs: channel: C055R639XT9 #notify-link-check build-book: - executor: builder + executor: default steps: - checkout - install-dependencies @@ -76,7 +74,7 @@ jobs: - html publish-book: - executor: base + executor: default steps: - checkout - attach_workspace: diff --git a/README.md b/README.md index 26c506cce..19d9a0b04 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,26 @@ We welcome your contributions. Read through [CONTRIBUTING.md](./CONTRIBUTING.md) ### Dependencies +#### Using `mise` + +We use [`mise`](https://mise.jdx.dev/) as a dependency manager for these tools. +Once properly installed, `mise` will provide the correct versions for each tool. `mise` does not +replace any other installations of these binaries and will only serve these binaries when you are +working inside of the `optimism` directory. + +##### Install `mise` + +Install `mise` by following the instructions provided on the +[Getting Started page](https://mise.jdx.dev/getting-started.html#_1-install-mise-cli). + +##### Install dependencies + +```sh +mise install +``` + +#### Manual installation + **Rust Toolchain** ```sh diff --git a/mise.toml b/mise.toml new file mode 100644 index 000000000..e7d9067cf --- /dev/null +++ b/mise.toml @@ -0,0 +1,23 @@ +[tools] + +# Core dependencies +rust = "1.83.0" +just = "1.37.0" +node = "20.9.0" + +# Cargo dependencies +"cargo:mdbook" = "0.4.43" +"cargo:mdbook-katex" = "0.9.2" +"cargo:mdbook-linkcheck" = "0.7.7" +"cargo:mdbook-mermaid" = "0.14.1" + +[hooks] +postinstall = [ + # Enabling corepack will install the `pnpm` package manager specified in package.json + 'npx corepack enable', + 'pnpm i --frozen-lockfile' +] + +[settings] +# Needs to be enabled for hooks to work +experimental = true \ No newline at end of file From bac1b5b1458ce007988594c4f637ec5aef681afb Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Fri, 17 Jan 2025 08:53:33 -0800 Subject: [PATCH 14/14] fix: CircleCI config --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index c4d689ceb..5b9106b8e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,6 +40,7 @@ jobs: executor: default steps: - checkout + - install-dependencies - run: name: markdown lint command: just lint-specs-md-check @@ -51,6 +52,7 @@ jobs: executor: default steps: - checkout + - install-dependencies - run: name: Lint check command: just lint-links