From 057877eada469b513229dad418653e08ce3a1f69 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Tue, 4 Jun 2024 16:30:21 -0700 Subject: [PATCH 1/4] Attempt doc preview with mystjs. --- .circleci/config.yml | 47 ++++++++++++++++++++++---------------------- requirements.txt | 4 ++++ 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 716a2610..1e43f3f7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ jobs: build-docs: working_directory: ~/repo docker: - - image: cimg/python:3.10 + - image: cimg/python:3.10-node steps: - checkout @@ -17,7 +17,7 @@ jobs: python3 -m venv venv source venv/bin/activate pip install --upgrade pip wheel setuptools - pip install -r site/requirements.txt -r requirements.txt + pip install -r requirements.txt - restore_cache: keys: @@ -30,9 +30,7 @@ jobs: # NOTE: blas multithreading behaves badly on circleci export OMP_NUM_THREADS=1 source venv/bin/activate - # n = nitpicky (broken links), W = warnings as errors, - # T = full tracebacks, keep-going = run to completion even with errors - make -C site/ SPHINXOPTS="-nWT --keep-going" html + myst build --html --execute - save_cache: key: cache-data @@ -40,42 +38,43 @@ jobs: - _data - store_artifacts: - path: site/_build/html + path: _build/html - persist_to_workspace: - root: site/_build + root: _build paths: html deploy-docs: working_directory: ~/repo docker: - - image: cimg/python:3.10 + - image: cimg/python:3.10-node steps: - checkout - attach_workspace: - at: site/_build + at: _build - run: name: install deploy deps command : | python3 -m pip install --user ghp-import - - run: - name: configure git - command: | - git config --global user.name "ci-doc-deploy-bot" - git config --global user.email "ci-doc-deploy-bot@nomail" - git config --global push.default simple - - - add_ssh_keys: - fingerprints: - 5c:54:62:37:75:7f:4d:14:f4:07:82:1c:50:0d:ee:9b - - - run: - name: deploy to gh-pages - command: | - ghp-import -n -f -p -m "[skip ci] docs build of $CIRCLE_SHA1" site/_build/html + # TODO! + # - run: + # name: configure git + # command: | + # git config --global user.name "ci-doc-deploy-bot" + # git config --global user.email "ci-doc-deploy-bot@nomail" + # git config --global push.default simple + # + # - add_ssh_keys: + # fingerprints: + # 5c:54:62:37:75:7f:4d:14:f4:07:82:1c:50:0d:ee:9b + # + # - run: + # name: deploy to gh-pages + # command: | + # ghp-import -n -f -p -m "[skip ci] docs build of $CIRCLE_SHA1" site/_build/html workflows: diff --git a/requirements.txt b/requirements.txt index dd03cc89..24031568 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,3 +7,7 @@ pandas imageio # For supporting .md-based notebooks jupytext +mystmd +ipykernel +jupyter_server +jupyterlab-myst From aaccdba197656c7401139c6ddf2f261f8292de2e Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Tue, 4 Jun 2024 17:11:16 -0700 Subject: [PATCH 2/4] Introspect build env vars. --- .circleci/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1e43f3f7..499f8e2e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,6 +32,14 @@ jobs: source venv/bin/activate myst build --html --execute + - run: + name: CircleCI Build meta + command: | + echo $CIRCLE_BUILD_URL + echo $CIRCLE_WORKFLOW_ID + echo $CIRCLE_WORKFLOW_JOB_ID + echo $CIRCLE_WORKFLOW_WORKSPACE_ID + - save_cache: key: cache-data paths: From dc6da5bc7d0451394314fcfcd1678ac5e35a64b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 5 Jun 2024 02:24:18 -0700 Subject: [PATCH 3/4] Use BASE_URL Co-authored-by: Rowan Cockett --- .circleci/config.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 499f8e2e..151708f3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,6 +30,13 @@ jobs: # NOTE: blas multithreading behaves badly on circleci export OMP_NUM_THREADS=1 source venv/bin/activate + # Construct the BASE_URL using the CIRCLE_WORKFLOW_JOB_ID + export BASE_URL="/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/_build/html" + + # Output the BASE_URL for debugging purposes + echo "BASE_URL is set to $BASE_URL" + + # Run your myst build command myst build --html --execute - run: From f3b5c6e56ebdde16b4f6f890c8f238df776d5b60 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Wed, 5 Jun 2024 09:57:16 -0700 Subject: [PATCH 4/4] Rm debugging step from CCI workflow. --- .circleci/config.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 151708f3..d87f81bf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,14 +39,6 @@ jobs: # Run your myst build command myst build --html --execute - - run: - name: CircleCI Build meta - command: | - echo $CIRCLE_BUILD_URL - echo $CIRCLE_WORKFLOW_ID - echo $CIRCLE_WORKFLOW_JOB_ID - echo $CIRCLE_WORKFLOW_WORKSPACE_ID - - save_cache: key: cache-data paths: