From 0ecfd274eb33acb04c93e01b61924d21a67919d5 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 10 Jun 2024 15:06:40 +1000 Subject: [PATCH 01/16] PUBLISH to GitHub Container Registry --- .github/workflows/build-gha.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/build-gha.yml diff --git a/.github/workflows/build-gha.yml b/.github/workflows/build-gha.yml new file mode 100644 index 0000000..89c7c5c --- /dev/null +++ b/.github/workflows/build-gha.yml @@ -0,0 +1,28 @@ +name: Build and Push Docker Containers to GitHub Container Registry + +on: [pull_request] + +env: + IMAGE_NAME: quantecon-lecture-python + TAG: cuda-12.3.1-anaconda-2024-02-py311 + +jobs: + push_to_registry: + name: Push Docker image to GitHub Containers + permissions: + packages: write + contents: read + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + # - name: Create more disk space on Ubuntu + # run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY" + - name: Build image + run: docker build . --file Dockerfile --tag $IMAGE_NAME --label $TAG + - name: Log in to registr y + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin + - name: Build & Push Container + run: | + docker tag $IMAGE_NAME $IMAGE_ID:$TAG + docker push $IMAGE_ID:$TAG From 919d65e682bb39fcf85928ab1c0c39f685af33a6 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 10 Jun 2024 15:08:09 +1000 Subject: [PATCH 02/16] fix context --- .github/workflows/build-gha.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-gha.yml b/.github/workflows/build-gha.yml index 89c7c5c..c1e4ddd 100644 --- a/.github/workflows/build-gha.yml +++ b/.github/workflows/build-gha.yml @@ -19,7 +19,9 @@ jobs: # - name: Create more disk space on Ubuntu # run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY" - name: Build image - run: docker build . --file Dockerfile --tag $IMAGE_NAME --label $TAG + run: | + cd cuda-12.3.1-anaconda-2024-02-py311 + docker build . --file Dockerfile --tag $IMAGE_NAME --label $TAG - name: Log in to registr y run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - name: Build & Push Container From 6fa7cbf2edf32e8952c0a69128b126aed1365010 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 10 Jun 2024 15:15:34 +1000 Subject: [PATCH 03/16] free up space on the instance --- .github/workflows/build-gha.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-gha.yml b/.github/workflows/build-gha.yml index c1e4ddd..31a6b00 100644 --- a/.github/workflows/build-gha.yml +++ b/.github/workflows/build-gha.yml @@ -16,8 +16,8 @@ jobs: steps: - name: Check out the repo uses: actions/checkout@v4 - # - name: Create more disk space on Ubuntu - # run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY" + - name: Create more disk space on Ubuntu + run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY" - name: Build image run: | cd cuda-12.3.1-anaconda-2024-02-py311 From 13b52758018e3a76122734555308dc99d495e3e1 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 10 Jun 2024 15:30:10 +1000 Subject: [PATCH 04/16] fix typo for IMAGE_NAME --- .github/workflows/build-gha.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-gha.yml b/.github/workflows/build-gha.yml index 31a6b00..735d539 100644 --- a/.github/workflows/build-gha.yml +++ b/.github/workflows/build-gha.yml @@ -26,5 +26,5 @@ jobs: run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - name: Build & Push Container run: | - docker tag $IMAGE_NAME $IMAGE_ID:$TAG - docker push $IMAGE_ID:$TAG + docker tag $IMAGE_NAME $IMAGE_NAME:$TAG + docker push $IMAGE_NAME:$TAG From b1fbeda83b6d545182cc2051d91af15584216126 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 10 Jun 2024 15:46:51 +1000 Subject: [PATCH 05/16] update push to ghca --- .github/workflows/build-gha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-gha.yml b/.github/workflows/build-gha.yml index 735d539..f1cbb67 100644 --- a/.github/workflows/build-gha.yml +++ b/.github/workflows/build-gha.yml @@ -27,4 +27,4 @@ jobs: - name: Build & Push Container run: | docker tag $IMAGE_NAME $IMAGE_NAME:$TAG - docker push $IMAGE_NAME:$TAG + docker push ghcr.io/QuantEcon/$IMAGE_NAME:$TAG From 64a73b6681bd895d39a1d1651da58e3a3d0a140a Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 10 Jun 2024 15:59:32 +1000 Subject: [PATCH 06/16] try lowercase orgname --- .github/workflows/build-gha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-gha.yml b/.github/workflows/build-gha.yml index f1cbb67..8135446 100644 --- a/.github/workflows/build-gha.yml +++ b/.github/workflows/build-gha.yml @@ -27,4 +27,4 @@ jobs: - name: Build & Push Container run: | docker tag $IMAGE_NAME $IMAGE_NAME:$TAG - docker push ghcr.io/QuantEcon/$IMAGE_NAME:$TAG + docker push ghcr.io/quantecon/$IMAGE_NAME:$TAG From eff977b492ec5a290ad3f157f9ab70e1e9dcbbc9 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 10 Jun 2024 16:11:38 +1000 Subject: [PATCH 07/16] update command for push --- .github/workflows/build-gha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-gha.yml b/.github/workflows/build-gha.yml index 8135446..22e1c15 100644 --- a/.github/workflows/build-gha.yml +++ b/.github/workflows/build-gha.yml @@ -26,5 +26,5 @@ jobs: run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - name: Build & Push Container run: | - docker tag $IMAGE_NAME $IMAGE_NAME:$TAG + docker tag ghcr.io/quantecon/$IMAGE_NAME $IMAGE_NAME:$TAG docker push ghcr.io/quantecon/$IMAGE_NAME:$TAG From de318fff48c0a8e3bd17ac77ccf3ca549eb1084a Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 10 Jun 2024 16:18:21 +1000 Subject: [PATCH 08/16] setup similar to githbu action docs --- .github/workflows/build-gha.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-gha.yml b/.github/workflows/build-gha.yml index 22e1c15..9f81c20 100644 --- a/.github/workflows/build-gha.yml +++ b/.github/workflows/build-gha.yml @@ -2,8 +2,9 @@ name: Build and Push Docker Containers to GitHub Container Registry on: [pull_request] -env: - IMAGE_NAME: quantecon-lecture-python +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} TAG: cuda-12.3.1-anaconda-2024-02-py311 jobs: @@ -26,5 +27,5 @@ jobs: run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - name: Build & Push Container run: | - docker tag ghcr.io/quantecon/$IMAGE_NAME $IMAGE_NAME:$TAG - docker push ghcr.io/quantecon/$IMAGE_NAME:$TAG + docker tag ${{ env.REGISTRY }}/{{ env.IMAGE_NAME }}:$TAG + docker push ${{ env.REGISTRY }}/{{ env.IMAGE_NAME }}:$TAG From 3adb9ee4ebf2b5c9e1f1e9eb95cc2818e343c7ba Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 10 Jun 2024 16:22:48 +1000 Subject: [PATCH 09/16] setup similar to githbu action docs --- .github/workflows/build-gha.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-gha.yml b/.github/workflows/build-gha.yml index 9f81c20..e1de1b3 100644 --- a/.github/workflows/build-gha.yml +++ b/.github/workflows/build-gha.yml @@ -21,11 +21,10 @@ jobs: run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY" - name: Build image run: | - cd cuda-12.3.1-anaconda-2024-02-py311 - docker build . --file Dockerfile --tag $IMAGE_NAME --label $TAG + cd ${{ env.TAG }} + docker build . --file Dockerfile --tag ${{ env.IMAGE_NAME }} --label ${{ env.TAG }} - name: Log in to registr y run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - name: Build & Push Container run: | - docker tag ${{ env.REGISTRY }}/{{ env.IMAGE_NAME }}:$TAG - docker push ${{ env.REGISTRY }}/{{ env.IMAGE_NAME }}:$TAG + docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$TAG From 34886cb53d642e424c114cebba6ffa53b661789b Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 10 Jun 2024 16:27:14 +1000 Subject: [PATCH 10/16] all lower case --- .github/workflows/build-gha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-gha.yml b/.github/workflows/build-gha.yml index e1de1b3..1c1117d 100644 --- a/.github/workflows/build-gha.yml +++ b/.github/workflows/build-gha.yml @@ -4,7 +4,7 @@ on: [pull_request] env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} + IMAGE_NAME: quantecon/lecture-python.docker TAG: cuda-12.3.1-anaconda-2024-02-py311 jobs: From faea586e280602fef4890eeb6bab9be4bcff4a6f Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 10 Jun 2024 17:16:33 +1000 Subject: [PATCH 11/16] check if already loged into the registry --- .github/workflows/build-gha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-gha.yml b/.github/workflows/build-gha.yml index 1c1117d..2e7a627 100644 --- a/.github/workflows/build-gha.yml +++ b/.github/workflows/build-gha.yml @@ -27,4 +27,4 @@ jobs: run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - name: Build & Push Container run: | - docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$TAG + docker push ${{ env.IMAGE_NAME }}:$TAG From 24197e10a4890350e226515341d80675abd5d2b2 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 10 Jun 2024 18:13:21 +1000 Subject: [PATCH 12/16] last try for today --- .github/workflows/build-gha.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-gha.yml b/.github/workflows/build-gha.yml index 2e7a627..b122a6d 100644 --- a/.github/workflows/build-gha.yml +++ b/.github/workflows/build-gha.yml @@ -3,8 +3,7 @@ name: Build and Push Docker Containers to GitHub Container Registry on: [pull_request] env: - REGISTRY: ghcr.io - IMAGE_NAME: quantecon/lecture-python.docker + IMAGE_NAME: lecture-python-container TAG: cuda-12.3.1-anaconda-2024-02-py311 jobs: @@ -27,4 +26,4 @@ jobs: run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - name: Build & Push Container run: | - docker push ${{ env.IMAGE_NAME }}:$TAG + docker push ghcr.io/quantecon/${{ env.IMAGE_NAME }}:${{ env.TAG }} From 40eb1bc5f92237b90c208772ae0fb82393681ecd Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 11 Jun 2024 13:02:04 +1000 Subject: [PATCH 13/16] rework docker build --- .github/workflows/build-gha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-gha.yml b/.github/workflows/build-gha.yml index b122a6d..fca2472 100644 --- a/.github/workflows/build-gha.yml +++ b/.github/workflows/build-gha.yml @@ -21,7 +21,7 @@ jobs: - name: Build image run: | cd ${{ env.TAG }} - docker build . --file Dockerfile --tag ${{ env.IMAGE_NAME }} --label ${{ env.TAG }} + docker build -t ghcr.io/quantecon/${{ IMAGE_NAME }}:${{ TAG }} . - name: Log in to registr y run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - name: Build & Push Container From 1897179dc8f066d4d9c12920c723ea854c056dc5 Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 11 Jun 2024 13:04:37 +1000 Subject: [PATCH 14/16] rework docker build --- .github/workflows/build-gha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-gha.yml b/.github/workflows/build-gha.yml index fca2472..aead5ff 100644 --- a/.github/workflows/build-gha.yml +++ b/.github/workflows/build-gha.yml @@ -21,7 +21,7 @@ jobs: - name: Build image run: | cd ${{ env.TAG }} - docker build -t ghcr.io/quantecon/${{ IMAGE_NAME }}:${{ TAG }} . + docker build -t ghcr.io/quantecon/${{ env.IMAGE_NAME }}:${{ env.TAG }} . - name: Log in to registr y run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - name: Build & Push Container From 3cfba181937c8fd3607ed86c9ee0ede31b19ac77 Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 11 Jun 2024 15:01:36 +1000 Subject: [PATCH 15/16] build cuda-12.5.0 --- .github/workflows/build-gha.yml | 2 +- cuda-12.5.0-anaconda-2024-02-py311/Dockerfile | 47 +++++++++++++++++++ .../environment.yml | 26 ++++++++++ 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 cuda-12.5.0-anaconda-2024-02-py311/Dockerfile create mode 100644 cuda-12.5.0-anaconda-2024-02-py311/environment.yml diff --git a/.github/workflows/build-gha.yml b/.github/workflows/build-gha.yml index aead5ff..38356ff 100644 --- a/.github/workflows/build-gha.yml +++ b/.github/workflows/build-gha.yml @@ -4,7 +4,7 @@ on: [pull_request] env: IMAGE_NAME: lecture-python-container - TAG: cuda-12.3.1-anaconda-2024-02-py311 + TAG: cuda-12.5.0-anaconda-2024-02-py311 jobs: push_to_registry: diff --git a/cuda-12.5.0-anaconda-2024-02-py311/Dockerfile b/cuda-12.5.0-anaconda-2024-02-py311/Dockerfile new file mode 100644 index 0000000..fa3f890 --- /dev/null +++ b/cuda-12.5.0-anaconda-2024-02-py311/Dockerfile @@ -0,0 +1,47 @@ +FROM nvidia/cuda:12.5.0-devel-ubuntu22.04 + +ENV DEBIAN_FRONTEND=noninteractive +RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + +# Install base utilities +RUN apt-get update && \ + apt-get install -y sudo + +# Install tzdata +# ENV TZ=Etc/UTC +# RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN apt-get install -y tzdata + +# Install developer tools +RUN apt-get install -y build-essential && \ + apt-get install -y wget && \ + apt-get install -y git + +# Install LaTeX build system +RUN apt-get install -y texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-xetex latexmk xindy dvipng ghostscript cm-super + +# Clean apt +RUN sudo apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install miniconda +ENV CONDA_DIR /opt/conda +RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \ + /bin/bash ~/miniconda.sh -b -p /opt/conda +RUN rm -rf Miniconda3-latest-Linux-x86_64.sh + +# Put conda in path so we can use conda activate +ENV PATH=$CONDA_DIR/bin:$PATH + +# Setup Environment +COPY environment.yml . +RUN conda env create -f environment.yml +RUN echo "source activate quantecon" > ~/.bashrc +ENV PATH /opt/conda/envs/quantecon/bin:$PATH +ENV CONDA_DEFAULT_ENV quantecon + +# Install JAX +RUN nvcc --version +RUN pip install "numpyro[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html +# Note: always install jax[cuda] last to ensure proper CUDA+CUDANN version linking +RUN pip install --upgrade "jax[cuda12_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html diff --git a/cuda-12.5.0-anaconda-2024-02-py311/environment.yml b/cuda-12.5.0-anaconda-2024-02-py311/environment.yml new file mode 100644 index 0000000..28cb889 --- /dev/null +++ b/cuda-12.5.0-anaconda-2024-02-py311/environment.yml @@ -0,0 +1,26 @@ +name: quantecon +channels: + - default +dependencies: + - python=3.11 + - anaconda=2024.02 + - pip + - pip: + - jupyter-book==0.15.1 + - quantecon-book-theme==0.7.1 + - sphinx-tojupyter==0.3.0 + - sphinxext-rediraffe==0.2.7 + - sphinx-reredirects==0.1.3 + - sphinx-exercise==0.4.1 + - ghp-import==1.1.0 + - sphinxcontrib-youtube==1.1.0 + - sphinx-togglebutton==0.3.1 + - array-to-latex + - prettytable + - kaleido + - arviz + # Docker Requirements + - pytz + # Docutils Issue (https://github.com/mcmtroffaes/sphinxcontrib-bibtex/issues/322) + - docutils==0.17.1 + From 754a61717b3f53ae8aa8dd1028000a3929bfbf1b Mon Sep 17 00:00:00 2001 From: mmcky Date: Wed, 12 Jun 2024 14:17:35 +1000 Subject: [PATCH 16/16] remove builds to dockerhub and migrate to githut container service --- .github/workflows/_archive/build.yml | 130 +++++++++++++++++++++++++ .github/workflows/build-gha.yml | 29 ------ .github/workflows/build.yml | 139 ++++----------------------- 3 files changed, 150 insertions(+), 148 deletions(-) create mode 100644 .github/workflows/_archive/build.yml delete mode 100644 .github/workflows/build-gha.yml diff --git a/.github/workflows/_archive/build.yml b/.github/workflows/_archive/build.yml new file mode 100644 index 0000000..ff89c0f --- /dev/null +++ b/.github/workflows/_archive/build.yml @@ -0,0 +1,130 @@ +name: Build and Push Docker Containers + +on: + push: + branches: [main] + +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v2.1.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + # - name: Build & Push (py39-anaconda-2022-10-jb-0.12.1) + # uses: docker/build-push-action@v3.2.0 + # with: + # context: py39-anaconda-2022-10-jb-0.12.1 + # push: true + # tags: mmcky/quantecon-lecture-python:py39-anaconda-2022-10-jb-0.12.1 + + # - name: Build & Push (py39-anaconda-2022-10-jb-0.15.1) + # uses: docker/build-push-action@v3.2.0 + # with: + # context: py39-anaconda-2022-10-jb-0.15.1 + # push: true + # tags: mmcky/quantecon-lecture-python:py39-anaconda-2022-10-jb-0.15.1 + + # - name: Build & Push (cuda-12.1.0-anaconda-2023-03-py310) + # uses: docker/build-push-action@v3.2.0 + # with: + # context: cuda-12.1.0-anaconda-2023-03-py310 + # push: true + # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-03-py310 + + # # Upgrade quantecon-book-theme==0.5.0 + # - name: Build & Push (cuda-12.1.0-anaconda-2023-03-py310-b) + # uses: docker/build-push-action@v3.2.0 + # with: + # context: cuda-12.1.0-anaconda-2023-03-py310-b + # push: true + # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-03-py310-b + + # Upgrade quantecon-book-theme==0.5.1 + # - name: Build & Push (cuda-12.1.0-anaconda-2023-03-py310-c) + # uses: docker/build-push-action@v3.2.0 + # with: + # context: cuda-12.1.0-anaconda-2023-03-py310-c + # push: true + # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-03-py310-c + + - name: Create more disk space + run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY" + + # # Upgrade quantecon-book-theme==0.5.3 + # - name: Build & Push (cuda-12.1.0-anaconda-2023-03-py310-d) + # uses: docker/build-push-action@v3.2.0 + # with: + # context: cuda-12.1.0-anaconda-2023-03-py310-d + # push: true + # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-03-py310-d + + # - name: Build & Push (cuda-12.1.0-anaconda-2023-07-py310) + # uses: docker/build-push-action@v3.2.0 + # with: + # context: cuda-12.1.0-anaconda-2023-07-py310 + # push: true + # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-07-py310 + + # - name: Build & Push (cuda-12.1.0-anaconda-2023-07-py310-b) + # uses: docker/build-push-action@v3.2.0 + # with: + # context: cuda-12.1.0-anaconda-2023-07-py310-b + # push: true + # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-07-py310-b + + # - name: Build & Push (cuda-12.1.0-anaconda-2023-09-py311) + # uses: docker/build-push-action@v3.2.0 + # with: + # context: cuda-12.1.0-anaconda-2023-09-py311 + # push: true + # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-09-py311 + + # - name: Build & Push (cuda-12.1.0-anaconda-2023-09-py311-b) + # uses: docker/build-push-action@v3.2.0 + # with: + # context: cuda-12.1.0-anaconda-2023-09-py311-b + # push: true + # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-09-py311-b + + # - name: Build & Push (cuda-12.1.0-anaconda-2023-09-py311-c) + # uses: docker/build-push-action@v3.2.0 + # with: + # context: cuda-12.1.0-anaconda-2023-09-py311-c + # push: true + # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-09-py311-c + + # - name: Build & Push (cuda-12.1.0-anaconda-2023-09-py311-d) + # uses: docker/build-push-action@v3.2.0 + # with: + # context: cuda-12.1.0-anaconda-2023-09-py311-d + # push: true + # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-09-py311-d + + # - name: Build & Push (cuda-12.3.1-anaconda-2023-09-py311) + # uses: docker/build-push-action@v3.2.0 + # with: + # context: cuda-12.3.1-anaconda-2023-09-py311 + # push: true + # tags: mmcky/quantecon-lecture-python:cuda-12.3.1-anaconda-2023-09-py311 + + - name: Build & Push (cuda-12.3.1-anaconda-2024-02-py311) + uses: docker/build-push-action@v3.2.0 + with: + context: cuda-12.3.1-anaconda-2024-02-py311 + push: true + tags: mmcky/quantecon-lecture-python:cuda-12.3.1-anaconda-2024-02-py311 + + # - name: Build & Push (cuda-12.1.0-anaconda-2024-02-py311) + # uses: docker/build-push-action@v3.2.0 + # with: + # context: cuda-12.1.0-anaconda-2024-02-py311 + # push: true + # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2024-02-py311 \ No newline at end of file diff --git a/.github/workflows/build-gha.yml b/.github/workflows/build-gha.yml deleted file mode 100644 index 38356ff..0000000 --- a/.github/workflows/build-gha.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Build and Push Docker Containers to GitHub Container Registry - -on: [pull_request] - -env: - IMAGE_NAME: lecture-python-container - TAG: cuda-12.5.0-anaconda-2024-02-py311 - -jobs: - push_to_registry: - name: Push Docker image to GitHub Containers - permissions: - packages: write - contents: read - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v4 - - name: Create more disk space on Ubuntu - run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY" - - name: Build image - run: | - cd ${{ env.TAG }} - docker build -t ghcr.io/quantecon/${{ env.IMAGE_NAME }}:${{ env.TAG }} . - - name: Log in to registr y - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Build & Push Container - run: | - docker push ghcr.io/quantecon/${{ env.IMAGE_NAME }}:${{ env.TAG }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff89c0f..1ad907a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,130 +1,31 @@ -name: Build and Push Docker Containers +name: Build and Push Docker Containers to GitHub Container Registry on: push: branches: [main] +env: + IMAGE_NAME: lecture-python-container + TAG: cuda-12.5.0-anaconda-2024-02-py311 + jobs: push_to_registry: - name: Push Docker image to Docker Hub + name: Push Docker image to GitHub Containers + permissions: + packages: write + contents: read runs-on: ubuntu-latest steps: - name: Check out the repo - uses: actions/checkout@v3 - - - name: Log in to Docker Hub - uses: docker/login-action@v2.1.0 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - # - name: Build & Push (py39-anaconda-2022-10-jb-0.12.1) - # uses: docker/build-push-action@v3.2.0 - # with: - # context: py39-anaconda-2022-10-jb-0.12.1 - # push: true - # tags: mmcky/quantecon-lecture-python:py39-anaconda-2022-10-jb-0.12.1 - - # - name: Build & Push (py39-anaconda-2022-10-jb-0.15.1) - # uses: docker/build-push-action@v3.2.0 - # with: - # context: py39-anaconda-2022-10-jb-0.15.1 - # push: true - # tags: mmcky/quantecon-lecture-python:py39-anaconda-2022-10-jb-0.15.1 - - # - name: Build & Push (cuda-12.1.0-anaconda-2023-03-py310) - # uses: docker/build-push-action@v3.2.0 - # with: - # context: cuda-12.1.0-anaconda-2023-03-py310 - # push: true - # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-03-py310 - - # # Upgrade quantecon-book-theme==0.5.0 - # - name: Build & Push (cuda-12.1.0-anaconda-2023-03-py310-b) - # uses: docker/build-push-action@v3.2.0 - # with: - # context: cuda-12.1.0-anaconda-2023-03-py310-b - # push: true - # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-03-py310-b - - # Upgrade quantecon-book-theme==0.5.1 - # - name: Build & Push (cuda-12.1.0-anaconda-2023-03-py310-c) - # uses: docker/build-push-action@v3.2.0 - # with: - # context: cuda-12.1.0-anaconda-2023-03-py310-c - # push: true - # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-03-py310-c - - - name: Create more disk space + uses: actions/checkout@v4 + - name: Create more disk space on Ubuntu run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY" - - # # Upgrade quantecon-book-theme==0.5.3 - # - name: Build & Push (cuda-12.1.0-anaconda-2023-03-py310-d) - # uses: docker/build-push-action@v3.2.0 - # with: - # context: cuda-12.1.0-anaconda-2023-03-py310-d - # push: true - # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-03-py310-d - - # - name: Build & Push (cuda-12.1.0-anaconda-2023-07-py310) - # uses: docker/build-push-action@v3.2.0 - # with: - # context: cuda-12.1.0-anaconda-2023-07-py310 - # push: true - # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-07-py310 - - # - name: Build & Push (cuda-12.1.0-anaconda-2023-07-py310-b) - # uses: docker/build-push-action@v3.2.0 - # with: - # context: cuda-12.1.0-anaconda-2023-07-py310-b - # push: true - # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-07-py310-b - - # - name: Build & Push (cuda-12.1.0-anaconda-2023-09-py311) - # uses: docker/build-push-action@v3.2.0 - # with: - # context: cuda-12.1.0-anaconda-2023-09-py311 - # push: true - # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-09-py311 - - # - name: Build & Push (cuda-12.1.0-anaconda-2023-09-py311-b) - # uses: docker/build-push-action@v3.2.0 - # with: - # context: cuda-12.1.0-anaconda-2023-09-py311-b - # push: true - # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-09-py311-b - - # - name: Build & Push (cuda-12.1.0-anaconda-2023-09-py311-c) - # uses: docker/build-push-action@v3.2.0 - # with: - # context: cuda-12.1.0-anaconda-2023-09-py311-c - # push: true - # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-09-py311-c - - # - name: Build & Push (cuda-12.1.0-anaconda-2023-09-py311-d) - # uses: docker/build-push-action@v3.2.0 - # with: - # context: cuda-12.1.0-anaconda-2023-09-py311-d - # push: true - # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-09-py311-d - - # - name: Build & Push (cuda-12.3.1-anaconda-2023-09-py311) - # uses: docker/build-push-action@v3.2.0 - # with: - # context: cuda-12.3.1-anaconda-2023-09-py311 - # push: true - # tags: mmcky/quantecon-lecture-python:cuda-12.3.1-anaconda-2023-09-py311 - - - name: Build & Push (cuda-12.3.1-anaconda-2024-02-py311) - uses: docker/build-push-action@v3.2.0 - with: - context: cuda-12.3.1-anaconda-2024-02-py311 - push: true - tags: mmcky/quantecon-lecture-python:cuda-12.3.1-anaconda-2024-02-py311 - - # - name: Build & Push (cuda-12.1.0-anaconda-2024-02-py311) - # uses: docker/build-push-action@v3.2.0 - # with: - # context: cuda-12.1.0-anaconda-2024-02-py311 - # push: true - # tags: mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2024-02-py311 \ No newline at end of file + - name: Build image + run: | + cd ${{ env.TAG }} + docker build -t ghcr.io/quantecon/${{ env.IMAGE_NAME }}:${{ env.TAG }} . + - name: Log in to registr y + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin + - name: Build & Push Container + run: | + docker push ghcr.io/quantecon/${{ env.IMAGE_NAME }}:${{ env.TAG }}