Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create CI to build & push PyBaMM's Docker Images #3316

Merged
merged 21 commits into from
Oct 8, 2023
Merged
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build & Push Docker Images

on:
workflow_dispatch:
pull_request:
branches:
- develop
arjxn-py marked this conversation as resolved.
Show resolved Hide resolved

jobs:
pre_job:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
arjxn-py marked this conversation as resolved.
Show resolved Hide resolved

- name: List built images
run: docker images

- name: Build and Push Docker Image (Without Solvers)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one also has the latest tag

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the earlier one (with all solvers) should have had the all tag. I do have a local branch which fixes things up a bit for this workflow (including logging in and uploading these images in parallel jobs) and will write a PR soon, I might look into adding the multi-platform images there itself.

env:
IMAGE_NAME: pybamm/pybamm:latest
run: |
docker build -t $IMAGE_NAME -f scripts/Dockerfile .
docker push $IMAGE_NAME
arjxn-py marked this conversation as resolved.
Show resolved Hide resolved

- name: Build and Push Docker Image (With JAX Solver)
env:
IMAGE_NAME: pybamm/pybamm:jax
ARG_NAME: JAX
run: |
docker build -t $IMAGE_NAME -f scripts/Dockerfile --build-arg $ARG_NAME=true .
docker push $IMAGE_NAME

- name: Build and Push Docker Image (With ODES & DAE Solver)
env:
IMAGE_NAME: pybamm/pybamm:odes
ARG_NAME: ODES
run: |
docker build -t $IMAGE_NAME -f scripts/Dockerfile --build-arg $ARG_NAME=true .
docker push $IMAGE_NAME

- name: Build and Push Docker Image (With IDAKLU Solver)
env:
IMAGE_NAME: pybamm/pybamm:idaklu
ARG_NAME: IDAKLU
run: |
docker build -t $IMAGE_NAME -f scripts/Dockerfile --build-arg $ARG_NAME=true .
docker push $IMAGE_NAME

- name: Build and Push Docker Image (With All Solvers)
env:
IMAGE_NAME: pybamm/pybamm:all
ARG_NAME: ALL
run: |
docker build -t $IMAGE_NAME -f scripts/Dockerfile --build-arg $ARG_NAME=true .
docker push $IMAGE_NAME
Loading