Skip to content

Commit e47f96c

Browse files
authored
ENH: Upgrade to jb-0.15.1 + associated packages (#324)
* ENH: Upgrade to jb-0.15.1 + associated packages * migrate to use quantecon docker * TST: latest jax[cuda] + remove cache * Revert "TST: latest jax[cuda] + remove cache" This reverts commit a114abf. * TST: latest nvidia cuda image + latest jax + full build * Revert "TST: latest nvidia cuda image + latest jax + full build" This reverts commit 2c44ed8. * update cache and publish workflows' * TST: Upgrade image for jax[gpu] * TST: disable cache * TST: disable warning errors * Revert "TST: disable warning errors" This reverts commit ce34918. * enable build failures for download notebook build * add nitpicky mode * revert test of new image and use anaconda=2022.10
1 parent b50d210 commit e47f96c

File tree

5 files changed

+63
-149
lines changed

5 files changed

+63
-149
lines changed

.github/workflows/cache.yml

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,12 @@ jobs:
2727
needs: deploy-runner
2828
runs-on: [self-hosted, cml-gpu]
2929
container:
30-
image: docker://nvidia/cuda:11.2.1-devel-ubuntu20.04
30+
image: docker://mmcky/quantecon-lecture-python:py39-anaconda-2022-10-jb-0.15.1
3131
options: --gpus all
3232
steps:
3333
- uses: actions/checkout@v3
3434
with:
3535
ref: ${{ github.event.pull_request.head.sha }}
36-
# Install LaTeX (Support for matplotlib)
37-
- name: Install latex dependencies
38-
shell: bash -l {0}
39-
run: |
40-
apt-get -qq update
41-
export DEBIAN_FRONTEND=noninteractive
42-
apt-get install -y tzdata
43-
apt-get install -y \
44-
texlive-latex-recommended \
45-
texlive-latex-extra \
46-
texlive-fonts-recommended \
47-
texlive-fonts-extra \
48-
texlive-xetex \
49-
latexmk \
50-
xindy \
51-
dvipng \
52-
ghostscript \
53-
cm-super
54-
- name: Setup Anaconda
55-
uses: conda-incubator/setup-miniconda@v2
56-
with:
57-
auto-update-conda: true
58-
auto-activate-base: true
59-
miniconda-version: 'latest'
60-
python-version: 3.9
61-
environment-file: environment.yml
62-
activate-environment: quantecon
6336
- name: Install Jax and Upgrade CUDA
6437
shell: bash -l {0}
6538
run: |

.github/workflows/ci.yml

Lines changed: 21 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -24,84 +24,54 @@ jobs:
2424
needs: deploy-runner
2525
runs-on: [self-hosted, cml-gpu]
2626
container:
27-
image: docker://nvidia/cuda:11.8.0-devel-ubuntu22.04
27+
image: docker://mmcky/quantecon-lecture-python:py39-anaconda-2022-10-jb-0.15.1
2828
options: --gpus all
2929
steps:
3030
- uses: actions/checkout@v3
3131
with:
3232
ref: ${{ github.event.pull_request.head.sha }}
33-
# Install LaTeX (Support for matplotlib and PDF builds)
34-
- name: Install latex dependencies
35-
shell: bash -l {0}
36-
run: |
37-
apt-get -qq update
38-
export DEBIAN_FRONTEND=noninteractive
39-
apt-get install -y tzdata
40-
apt-get install -y \
41-
texlive-latex-recommended \
42-
texlive-latex-extra \
43-
texlive-fonts-recommended \
44-
texlive-fonts-extra \
45-
texlive-xetex \
46-
latexmk \
47-
xindy \
48-
dvipng \
49-
ghostscript \
50-
cm-super
51-
- name: Setup Anaconda
52-
uses: conda-incubator/setup-miniconda@v2
53-
with:
54-
auto-update-conda: true
55-
auto-activate-base: true
56-
miniconda-version: 'latest'
57-
python-version: 3.9
58-
environment-file: environment.yml
59-
activate-environment: quantecon
33+
# Install Hardware Dependant Libraries
6034
- name: Install Jax and Upgrade CUDA
6135
shell: bash -l {0}
6236
run: |
6337
pip install --upgrade "jax[cuda]==0.4.2" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
6438
pip install --upgrade "numpyro[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
6539
nvidia-smi
66-
- name: Install latex dependencies
40+
# Check nvidia drivers
41+
- name: nvidia Drivers
6742
shell: bash -l {0}
68-
run: |
69-
apt-get -qq update
70-
export DEBIAN_FRONTEND=noninteractive
71-
apt-get install -y tzdata
72-
apt-get install -y \
73-
texlive-latex-recommended \
74-
texlive-latex-extra \
75-
texlive-fonts-recommended \
76-
texlive-fonts-extra \
77-
texlive-xetex \
78-
latexmk \
79-
xindy
43+
run: nvidia-smi
8044
- name: Display Conda Environment Versions
8145
shell: bash -l {0}
8246
run: conda list
8347
- name: Display Pip Versions
8448
shell: bash -l {0}
8549
run: pip list
86-
- name: Download "build" folder (cache)
87-
uses: dawidd6/action-download-artifact@v2
88-
with:
89-
workflow: cache.yml
90-
branch: main
91-
name: build-cache
92-
path: _build
50+
# - name: Download "build" folder (cache)
51+
# uses: dawidd6/action-download-artifact@v2
52+
# with:
53+
# workflow: cache.yml
54+
# branch: main
55+
# name: build-cache
56+
# path: _build
9357
# Build Assets (Download Notebooks and PDF via LaTeX)
9458
- name: Build Download Notebooks (sphinx-tojupyter)
9559
shell: bash -l {0}
9660
run: |
97-
jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter -n -W --keep-going
61+
jb build lectures -n -W --keep-going --path-output ./ --builder=custom --custom-builder=jupyter
9862
mkdir -p _build/html/_notebooks
9963
cp -u _build/jupyter/*.ipynb _build/html/_notebooks
64+
- name: Upload Execution Reports (Download Notebooks)
65+
uses: actions/upload-artifact@v2
66+
if: failure()
67+
with:
68+
name: execution-reports
69+
path: _build/jupyter/reports
10070
- name: Build PDF from LaTeX
10171
shell: bash -l {0}
10272
run: |
103-
jb build lectures --builder pdflatex --path-output ./ -n -W --keep-going
104-
mkdir _build/html/_pdf
73+
jb build lectures --builder pdflatex --path-output ./ -W --keep-going
74+
mkdir -p _build/html/_pdf
10575
cp -u _build/latex/*.pdf _build/html/_pdf
10676
- name: Upload Execution Reports (LaTeX)
10777
uses: actions/upload-artifact@v2

.github/workflows/publish.yml

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -28,41 +28,14 @@ jobs:
2828
needs: deploy-runner
2929
runs-on: [self-hosted, cml-gpu]
3030
container:
31-
image: docker://nvidia/cuda:11.2.1-devel-ubuntu20.04
31+
image: docker://mmcky/quantecon-lecture-python:py39-anaconda-2022-10-jb-0.15.1
3232
options: --gpus all
3333
steps:
3434
- name: Checkout
3535
uses: actions/checkout@v3
36-
# Install LaTeX (Support for matplotlib and PDF builds)
37-
- name: Install latex dependencies
38-
shell: bash -l {0}
39-
run: |
40-
apt-get -qq update
41-
export DEBIAN_FRONTEND=noninteractive
42-
apt-get install -y tzdata
43-
apt-get install -y \
44-
texlive-latex-recommended \
45-
texlive-latex-extra \
46-
texlive-fonts-recommended \
47-
texlive-fonts-extra \
48-
texlive-xetex \
49-
latexmk \
50-
xindy \
51-
dvipng \
52-
ghostscript \
53-
cm-super
54-
- name: Install Git
36+
- name: Install Git (required to commit notebooks)
5537
shell: bash -l {0}
5638
run: apt-get install -y git
57-
- name: Setup Anaconda
58-
uses: conda-incubator/setup-miniconda@v2
59-
with:
60-
auto-update-conda: true
61-
auto-activate-base: true
62-
miniconda-version: 'latest'
63-
python-version: 3.9
64-
environment-file: environment.yml
65-
activate-environment: quantecon
6639
- name: Install Jax and Upgrade CUDA
6740
shell: bash -l {0}
6841
run: |

environment.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,15 @@ dependencies:
66
- anaconda=2022.10
77
- pip
88
- pip:
9-
- jupyter-book==0.12.3
10-
- quantecon-book-theme==0.3.1
11-
- sphinx-tojupyter==0.2.1
9+
- jupyter-book==0.15.1
10+
- quantecon-book-theme==0.4.1
11+
- sphinx-tojupyter==0.3.0
1212
- sphinxext-rediraffe==0.2.7
13-
- sphinx-exercise==0.4.0
13+
- sphinx-exercise==0.4.1
1414
- ghp-import==1.1.0
1515
- sphinxcontrib-youtube==1.1.0
1616
- sphinx-togglebutton==0.3.1
1717
- arviz==0.13.0
1818
- kaleido
19-
# Sandpit Requirements
20-
- quantecon
21-
- array-to-latex
22-
- PuLP
23-
- cvxpy
24-
- cvxopt
25-
- cylp
26-
- prettytable
19+
# Docker Requirements
20+
- pytz

lectures/_config.yml

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ title: Quantitative Economics with Python
22
author: Thomas J. Sargent & John Stachurski
33
logo: _static/qe-logo-large.png
44
description: This website presents a set of lectures on quantitative economic modeling, designed and written by Thomas J. Sargent and John Stachurski.
5+
analytics:
6+
google_analytics_id: UA-54984338-10
57

68
parse:
79
myst_enable_extensions:
@@ -34,34 +36,37 @@ latex:
3436
sphinx:
3537
extra_extensions: [sphinx_multitoc_numbering, sphinxext.rediraffe, sphinx_tojupyter, sphinxcontrib.youtube, sphinx.ext.todo, sphinx_exercise, sphinx_togglebutton]
3638
config:
37-
nb_render_priority:
38-
html:
39-
- "application/vnd.jupyter.widget-view+json"
40-
- "application/javascript"
41-
- "text/html"
42-
- "text/latex"
43-
- "image/svg+xml"
44-
- "image/png"
45-
- "image/jpeg"
46-
- "text/markdown"
47-
- "text/plain"
48-
jupyter:
49-
- "application/vnd.jupyter.widget-view+json"
50-
- "application/javascript"
51-
- "text/html"
52-
- "text/latex"
53-
- "image/svg+xml"
54-
- "image/png"
55-
- "image/jpeg"
56-
- "text/markdown"
57-
- "text/plain"
58-
latex:
59-
- "text/latex"
60-
- "application/pdf"
61-
- "image/png"
62-
- "image/jpeg"
63-
- "text/markdown"
64-
- "text/plain"
39+
nb_mime_priority_overrides: [
40+
# HTML
41+
['html', 'application/vnd.jupyter.widget-view+json', 10],
42+
['html', 'application/javascript', 20],
43+
['html', 'text/html', 30],
44+
['html', 'text/latex', 40],
45+
['html', 'image/svg+xml', 50],
46+
['html', 'image/png', 60],
47+
['html', 'image/jpeg', 70],
48+
['html', 'text/markdown', 80],
49+
['html', 'text/plain', 90],
50+
# Jupyter Notebooks
51+
['jupyter', 'application/vnd.jupyter.widget-view+json', 10],
52+
['jupyter', 'application/javascript', 20],
53+
['jupyter', 'text/html', 30],
54+
['jupyter', 'text/latex', 40],
55+
['jupyter', 'image/svg+xml', 50],
56+
['jupyter', 'image/png', 60],
57+
['jupyter', 'image/jpeg', 70],
58+
['jupyter', 'text/markdown', 80],
59+
['jupyter', 'text/plain', 90],
60+
# LaTeX
61+
['latex', 'text/latex', 10],
62+
['latex', 'application/pdf', 20],
63+
['latex', 'image/png', 30],
64+
['latex', 'image/jpeg', 40],
65+
['latex', 'text/markdown', 50],
66+
['latex', 'text/plain', 60],
67+
# Link Checker
68+
['linkcheck', 'text/plain', 10],
69+
]
6570
html_favicon: _static/lectures-favicon.ico
6671
html_theme: quantecon_book_theme
6772
html_static_path: ['_static']
@@ -75,7 +80,6 @@ sphinx:
7580
og_logo_url: https://assets.quantecon.org/img/qe-og-logo.png
7681
description: This website presents a set of lectures on quantitative economic modeling, designed and written by Thomas J. Sargent and John Stachurski.
7782
keywords: Python, QuantEcon, Quantitative Economics, Economics, Sloan, Alfred P. Sloan Foundation, Tom J. Sargent, John Stachurski
78-
google_analytics_id: UA-54984338-10
7983
launch_buttons:
8084
colab_url : https://colab.research.google.com
8185
mathjax3_config:

0 commit comments

Comments
 (0)