Skip to content

Commit 6f36610

Browse files
authored
Merge pull request #10 from martin-g/update-ubuntu-for-cross-build-4
Split build_cross/Dockerfile into two
2 parents 66ba781 + 00738c4 commit 6f36610

File tree

3 files changed

+97
-9
lines changed

3 files changed

+97
-9
lines changed

.github/workflows/docker-image-upload.yml

Lines changed: 86 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ on:
99
- 'master'
1010

1111
jobs:
12-
docker:
12+
build-su2:
1313
runs-on: ubuntu-latest
14+
outputs:
15+
date_tag: ${{ steps.vars.outputs.date_tag }}
1416
steps:
1517
- name: Checkout
1618
uses: actions/checkout@v2
@@ -40,8 +42,89 @@ jobs:
4042
- name: Build and push build-su2
4143
run: docker buildx build --platform=linux/amd64 --platform=linux/arm64 -t ghcr.io/${{ github.repository_owner }}/su2/build-su2:${{ steps.vars.outputs.date_tag }} --push ./build/
4244

45+
test-su2:
46+
needs: [build-su2]
47+
if: ${{ always() && !(contains(needs.*.result, 'failure')) }}
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v2
52+
53+
- name: Set up QEMU
54+
uses: docker/setup-qemu-action@v1
55+
with:
56+
platforms: arm64
57+
58+
- name: Set up Docker Buildx
59+
uses: docker/setup-buildx-action@v1
60+
61+
- name: Login to Github Docker Registry
62+
uses: docker/login-action@v1
63+
with:
64+
registry: ghcr.io
65+
username: ${{ github.actor }}
66+
password: ${{ secrets.GITHUB_TOKEN }}
67+
68+
- name: Docker Buildx Create
69+
run: docker buildx create --use
70+
4371
- name: Build and push test-su2
44-
run: docker buildx build --platform=linux/amd64 --platform=linux/arm64 --build-arg BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/su2/build-su2:${{ steps.vars.outputs.date_tag }} -t ghcr.io/${{ github.repository_owner }}/su2/test-su2:${{ steps.vars.outputs.date_tag }} --push ./test/
72+
run: docker buildx build --platform=linux/amd64 --platform=linux/arm64 --build-arg BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/su2/build-su2:${{ needs.build-su2.outputs.date_tag }} -t ghcr.io/${{ github.repository_owner }}/su2/test-su2:${{ needs.build-su2.outputs.date_tag }} --push ./test/
73+
74+
cross-build-su2-mac:
75+
needs: [build-su2]
76+
if: ${{ always() && !(contains(needs.*.result, 'failure')) }}
77+
runs-on: ubuntu-latest
78+
steps:
79+
- name: Checkout
80+
uses: actions/checkout@v2
81+
82+
- name: Set up QEMU
83+
uses: docker/setup-qemu-action@v1
84+
with:
85+
platforms: arm64
86+
87+
- name: Set up Docker Buildx
88+
uses: docker/setup-buildx-action@v1
89+
90+
- name: Login to Github Docker Registry
91+
uses: docker/login-action@v1
92+
with:
93+
registry: ghcr.io
94+
username: ${{ github.actor }}
95+
password: ${{ secrets.GITHUB_TOKEN }}
96+
97+
- name: Docker Buildx Create
98+
run: docker buildx create --use
99+
100+
- name: Build and push build-su2-cross
101+
run: docker buildx build --platform=linux/amd64 --platform=linux/arm64 --build-arg BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/su2/build-su2:${{ needs.build-su2.outputs.date_tag }} -t ghcr.io/${{ github.repository_owner }}/su2/build-su2-cross-stage1:${{ needs.build-su2.outputs.date_tag }} --push --file Dockerfile.stage1 ./build_cross/
102+
103+
cross-build-su2-linux:
104+
needs: [cross-build-su2-mac]
105+
if: ${{ always() && !(contains(needs.*.result, 'failure')) }}
106+
runs-on: ubuntu-latest
107+
steps:
108+
- name: Checkout
109+
uses: actions/checkout@v2
110+
111+
- name: Set up QEMU
112+
uses: docker/setup-qemu-action@v1
113+
with:
114+
platforms: arm64
115+
116+
- name: Set up Docker Buildx
117+
uses: docker/setup-buildx-action@v1
118+
119+
- name: Login to Github Docker Registry
120+
uses: docker/login-action@v1
121+
with:
122+
registry: ghcr.io
123+
username: ${{ github.actor }}
124+
password: ${{ secrets.GITHUB_TOKEN }}
125+
126+
- name: Docker Buildx Create
127+
run: docker buildx create --use
45128

46129
- name: Build and push build-su2-cross
47-
run: docker buildx build --platform=linux/amd64 --platform=linux/arm64 --build-arg BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/su2/build-su2:${{ steps.vars.outputs.date_tag }} -t ghcr.io/${{ github.repository_owner }}/su2/build-su2-cross:${{ steps.vars.outputs.date_tag }} --push ./build_cross/
130+
run: docker buildx build --platform=linux/amd64 --platform=linux/arm64 --build-arg BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/su2/build-su2-cross-stage1:${{ needs.build-su2.outputs.date_tag }} -t ghcr.io/${{ github.repository_owner }}/su2/build-su2-cross:${{ needs.build-su2.outputs.date_tag }} --push --file Dockerfile.stage2 ./build_cross/
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y \
1414
mingw-w64
1515

1616
# Get the osxcross tool
17-
RUN git clone https://github.com/tpoechtrager/osxcross && cd osxcross
17+
RUN git clone https://github.com/tpoechtrager/osxcross && cd osxcross
1818

1919
# Copy the OSX sdk
2020
COPY MacOSX10.15.sdk.tar.xz /osxcross/tarballs/MacOSX10.15.sdk.tar.xz
@@ -28,7 +28,7 @@ RUN cd osxcross && UNATTENDED=1 ./build.sh
2828
COPY msmpi_v10.1.2.tar.gz /msmpi_v10.1.2.tar.gz
2929
RUN tar xzf msmpi_v10.1.2.tar.gz
3030

31-
# Copy hostfiles
31+
# Copy hostfiles
3232
COPY hostfiles /hostfiles
3333

3434
# Copy the mpich script
@@ -37,10 +37,7 @@ COPY download_compile_mpich.sh /download_compile_mpich.sh
3737
ENV PATH /osxcross/target/bin:$PATH
3838

3939
# Compile MPICH for darwin
40-
RUN sh download_compile_mpich.sh 3.3.2 x86_64-apple-darwin19
41-
42-
# Compile MPICH for linux
43-
RUN LDFLAGS=" -static -static-libstdc++ -static-libgcc" sh download_compile_mpich.sh 3.3.2 x86_64-linux-gnu
40+
RUN sh download_compile_mpich.sh 3.3.2 x86_64-apple-darwin19
4441

4542
# Code file to execute when the docker container starts up (`entrypoint.sh`)
4643
ENTRYPOINT ["/compileSU2.sh"]

build_cross/Dockerfile.stage2

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ARG BASE_IMAGE
2+
FROM $BASE_IMAGE
3+
4+
# Compile MPICH for linux
5+
RUN LDFLAGS=" -static -static-libstdc++ -static-libgcc" sh download_compile_mpich.sh 3.3.2 x86_64-linux-gnu
6+
7+
# Code file to execute when the docker container starts up (`entrypoint.sh`)
8+
ENTRYPOINT ["/compileSU2.sh"]

0 commit comments

Comments
 (0)