forked from The-OpenROAD-Project/OpenLane
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Multi-Arch Docker Builds (The-OpenROAD-Project#1075)
Tested on Apple M1 and AWS Graviton. + Add support for multiple-architecture building + Support for amd64, ppc64le and arm64v8 added + amd64 and arm64v8 will be automatically built by the CI ~ Major CI Overhauls ~ Added composite actions for the Docker build and setting environment variables ~ pdk build is now its own job, and amd64/aarch64 have a job each ~ matrix -> design_matrix, designs only tested on amd64 for performance reasons ~ run/build base docker images now pushed to Docker Hub based on a hash of dependency lists (to work with the buildx `docker-container` driver) - Remove pandas (overkill for what we're using it for) - Remove `cugr`, `drcu` *for now* (they're x86-64 Linux-only utilities)
- Loading branch information
Showing
39 changed files
with
602 additions
and
468 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Docker Build | ||
description: Build an OpenLane Docker Container | ||
inputs: | ||
arch: | ||
description: "The Docker architecture/platform to build for" | ||
required: true | ||
default: "amd64" | ||
dockerhub_user: | ||
description: The input dockerhub user | ||
required: false | ||
default: "" | ||
dockerhub_password: | ||
description: The input dockerhub password | ||
required: false | ||
default: "" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: docker/setup-buildx-action@v2 | ||
- uses: ./.github/actions/set_env_variables | ||
|
||
- name: Check If Going To Push An Image To Docker | ||
shell: bash | ||
run: | | ||
export PUSHING=$(ruby -e 'if ("${{ github.event_name }}" != "pull_request" && "${{ inputs.dockerhub_user }}" != ""); print(1) else print(0) end') | ||
echo "PUSHING=$PUSHING" >> $GITHUB_ENV | ||
- name: Login to DockerHub | ||
if: ${{ env.PUSHING == '1' }} | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ inputs.dockerhub_user }} | ||
password: ${{ inputs.dockerhub_password }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Docker Build | ||
shell: bash | ||
run: | | ||
export BUILD_IF_CANT_PULL=1 | ||
export BUILD_COMMAND="docker build" | ||
if [ "$PUSHING" = "1" ]; then | ||
export BUILD_IF_CANT_PULL_THEN_PUSH=1 | ||
export BUILD_COMMAND="docker buildx build --load --cache-from=type=gha --cache-to=type=gha,scope=${{ github.workflow }}}" | ||
fi | ||
export BUILD_ARCH=${{ inputs.arch }} | ||
cd docker/ && make merge | ||
- name: Export Docker Image | ||
shell: bash | ||
run: docker save -o /tmp/image-${{ inputs.arch }}.tar ${{ env.OPENLANE_IMAGE_NAME }}-${{ inputs.arch }} | ||
|
||
- name: Upload Docker Image | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: docker-image-${{ inputs.arch }} | ||
path: /tmp/image-${{ inputs.arch }}.tar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Set up environment variables | ||
description: Sets up various environment variables required by various OpenLane steps. | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Export Repo URL | ||
shell: bash | ||
run: echo "REPO_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV | ||
|
||
- name: Export PDK ROOT | ||
shell: bash | ||
run: echo "PDK_ROOT=/usr/local/pdk" >> $GITHUB_ENV | ||
|
||
- name: Export Branch Name | ||
shell: bash | ||
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV | ||
|
||
- name: Export Temp Image Name | ||
shell: bash | ||
run: echo "OPENLANE_IMAGE_NAME=openlane:intermediate" >> $GITHUB_ENV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.