Skip to content

Commit a636186

Browse files
committed
ENH: migrate to runs-on GPU instance
1 parent 88bff63 commit a636186

File tree

4 files changed

+73
-21
lines changed

4 files changed

+73
-21
lines changed

.github/workflows/cache.yml

+14-5
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,26 @@ on:
66
workflow_dispatch:
77
jobs:
88
cache:
9-
runs-on: quantecon-gpu
10-
container:
11-
image: ghcr.io/quantecon/lecture-python-container:cuda-12.8.1-anaconda-2024-10-py312
12-
options: --gpus all
9+
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=ubuntu24-gpu-x64/disk=large"
1310
steps:
1411
- uses: actions/checkout@v4
1512
with:
1613
ref: ${{ github.event.pull_request.head.sha }}
17-
- name: Check nvidia drivers
14+
- name: Setup Anaconda
15+
uses: conda-incubator/setup-miniconda@v3
16+
with:
17+
auto-update-conda: true
18+
auto-activate-base: true
19+
miniconda-version: 'latest'
20+
python-version: "3.12"
21+
environment-file: environment.yml
22+
activate-environment: quantecon
23+
- name: Install jax (and install checks for GPU)
1824
shell: bash -l {0}
1925
run: |
26+
pip install -U "jax[cuda12]"
27+
python --version
28+
python scripts/test-jax-install.py
2029
nvidia-smi
2130
- name: Build HTML
2231
shell: bash -l {0}

.github/workflows/ci.yml

+30-7
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,41 @@ name: Build Project [using jupyter-book]
22
on: [pull_request]
33
jobs:
44
preview:
5-
runs-on: quantecon-gpu
6-
container:
7-
image: ghcr.io/quantecon/lecture-python-container:cuda-12.8.1-anaconda-2024-10-py312
8-
options: --gpus all
5+
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=ubuntu24-gpu-x64/disk=large"
96
steps:
107
- uses: actions/checkout@v4
118
with:
129
ref: ${{ github.event.pull_request.head.sha }}
13-
# Check nvidia drivers
14-
- name: nvidia Drivers
10+
- name: Setup Anaconda
11+
uses: conda-incubator/setup-miniconda@v3
12+
with:
13+
auto-update-conda: true
14+
auto-activate-base: true
15+
miniconda-version: 'latest'
16+
python-version: "3.12"
17+
environment-file: environment.yml
18+
activate-environment: quantecon
19+
- name: Install jax (and install checks for GPU)
20+
shell: bash -l {0}
21+
run: |
22+
pip install -U "jax[cuda12]"
23+
python --version
24+
python scripts/test-jax-install.py
25+
nvidia-smi
26+
- name: Install latex dependencies
1527
shell: bash -l {0}
16-
run: nvidia-smi
28+
run: |
29+
sudo apt-get -qq update
30+
sudo apt-get install -y \
31+
texlive-latex-recommended \
32+
texlive-latex-extra \
33+
texlive-fonts-recommended \
34+
texlive-fonts-extra \
35+
texlive-xetex \
36+
latexmk \
37+
xindy \
38+
dvipng \
39+
cm-super
1740
- name: Display Conda Environment Versions
1841
shell: bash -l {0}
1942
run: conda list

.github/workflows/collab.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build Project on Google Collab (Execution)
22
on: [pull_request]
33
jobs:
44
execution-checks:
5-
runs-on: quantecon-gpu
5+
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=ubuntu24-gpu-x64/disk=large"
66
container:
77
image: docker://us-docker.pkg.dev/colab-images/public/runtime
88
options: --gpus all

.github/workflows/publish.yml

+28-8
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,40 @@ on:
66
jobs:
77
publish:
88
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
9-
runs-on: quantecon-gpu
10-
container:
11-
image: ghcr.io/quantecon/lecture-python-container:cuda-12.8.1-anaconda-2024-10-py312
12-
options: --gpus all
9+
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=ubuntu24-gpu-x64/disk=large"
1310
steps:
1411
- name: Checkout
1512
uses: actions/checkout@v4
16-
- name: Install Git (required to commit notebooks)
17-
shell: bash -l {0}
18-
run: apt-get install -y git
19-
- name: Check nvidia drivers
13+
- name: Setup Anaconda
14+
uses: conda-incubator/setup-miniconda@v3
15+
with:
16+
auto-update-conda: true
17+
auto-activate-base: true
18+
miniconda-version: 'latest'
19+
python-version: "3.12"
20+
environment-file: environment.yml
21+
activate-environment: quantecon
22+
- name: Install jax (and install checks for GPU)
2023
shell: bash -l {0}
2124
run: |
25+
pip install -U "jax[cuda12]"
26+
python --version
27+
python scripts/test-jax-install.py
2228
nvidia-smi
29+
- name: Install latex dependencies
30+
shell: bash -l {0}
31+
run: |
32+
sudo apt-get -qq update
33+
sudo apt-get install -y \
34+
texlive-latex-recommended \
35+
texlive-latex-extra \
36+
texlive-fonts-recommended \
37+
texlive-fonts-extra \
38+
texlive-xetex \
39+
latexmk \
40+
xindy \
41+
dvipng \
42+
cm-super
2343
- name: Display Conda Environment Versions
2444
shell: bash -l {0}
2545
run: conda list

0 commit comments

Comments
 (0)