diff --git a/.github/workflows/github-actions-cron-test-installer.yml b/.github/workflows/github-actions-cron-test-installer.yml index ebd5aef3d6..52c020a962 100644 --- a/.github/workflows/github-actions-cron-test-installer.yml +++ b/.github/workflows/github-actions-cron-test-installer.yml @@ -29,14 +29,15 @@ jobs: os: [["ubuntu20.04", "ubuntu:20.04"], ["ubuntu22.04", "ubuntu:22.04"], ["centos7", "centos:centos7"]] runs-on: ubuntu-latest env: - IMAGE: ghcr.io/antmicro/openroad-flow-scripts-test-cache - IMAGE_DEPS: ghcr.io/antmicro/openroad-flow-scripts-test-cache-deps + IMAGE: ghcr.io/antmicro/openroad-flow-scripts-test-cache/${{ matrix.os[0] }}:latest + IMAGE_DEPS: ghcr.io/antmicro/openroad-flow-scripts-test-cache-deps/${{ matrix.os[0] }}:latest steps: - name: Check out repository code uses: actions/checkout@v3 with: fetch-depth: 1 submodules: recursive + - name: Network Setup run: | sudo apt-get update @@ -46,29 +47,10 @@ jobs: sudo ifconfig docker0 down sudo brctl delbr docker0 sudo service docker restart + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Run installer - run: | - ./etc/DockerHelper.sh create -target=dev -os=${{ matrix.os[0] }} - docker images - - name: Build project - run: | - docker images - ./etc/DockerHelper.sh create -target=builder -os=${{ matrix.os[0] }} - docker images - - name: Test build - run: | - cmd="source ./env.sh && yosys -help && openroad -help && make -C flow ;" - if [[ ${{ matrix.os[0] }} == "centos7" ]]; then - cmd="source /opt/rh/devtoolset-8/enable && ${cmd}" - cmd="source /opt/rh/llvm-toolset-7.0/enable && ${cmd}" - cmd="source /opt/rh/rh-python38/enable && ${cmd}" - fi - docker run openroad/flow-${{ matrix.os[0] }}-builder /bin/bash -c "${cmd}" - - name: Tag the image - run: | - docker tag openroad/flow-${{ matrix.os[0] }}-builder ${{ env.IMAGE }}/${{ matrix.os[0] }} + - name: Login to GitHub Container Registry (GHCR) if: github.event_name != 'pull_request' && github.repository == 'antmicro/OpenROAD-flow-scripts' uses: docker/login-action@v2 @@ -76,17 +58,54 @@ jobs: registry: ghcr.io username: gha password: ${{ github.token }} - - name: Build and export the dependencies image + + - name: Copy OpenROAD installer + run: cp tools/OpenROAD/etc/DependencyInstaller.sh etc/InstallerOpenROAD.sh + + - name: Build and export dependencies image uses: docker/build-push-action@v6 with: - push: true - tags: ${{ env.IMAGE_DEPS }}/${{ matrix.os[0] }} context: etc + push: true + tags: ${{ env.IMAGE_DEPS }} file: docker/Dockerfile.dev - build-args: fromImage=${{ matrix.os[1] }} - cache-from: type=registry,ref=${{ env.IMAGE_DEPS }}/${{ matrix.os[0] }} - cache-to: type=registry,ref=${{ env.IMAGE_DEPS }}/${{ matrix.os[0] }},mode=max - - name: Push container image to GitHub Container Registry (GHCR) - if: github.event_name != 'pull_request' && github.repository == 'antmicro/OpenROAD-flow-scripts' + build-args: | + fromImage=${{ matrix.os[1] }} + numThreads=$(nproc) + cache-from: type=registry,ref=${{ env.IMAGE_DEPS }} + cache-to: type=registry,ref=${{ env.IMAGE_DEPS }},mode=max + + - name: Build ORFS image + uses: docker/build-push-action@v6 + with: + context: . + push: false + tags: ${{ env.IMAGE }} + file: docker/Dockerfile.builder + build-args: | + fromImage=${{ env.IMAGE_DEPS }} + numThreads=$(nproc) + cache-from: type=registry,ref=${{ env.IMAGE }} + + - name: Test build run: | - docker push ${{ env.IMAGE }}/${{ matrix.os[0] }} + cmd="source ./env.sh && yosys -help && openroad -help && make -C flow ;" + if [[ ${{ matrix.os[0] }} == "centos7" ]]; then + cmd="source /opt/rh/devtoolset-8/enable && ${cmd}" + cmd="source /opt/rh/llvm-toolset-7.0/enable && ${cmd}" + cmd="source /opt/rh/rh-python38/enable && ${cmd}" + fi + docker run ${{ env.IMAGE }} /bin/bash -c "${cmd}" + + - name: Export ORFS image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ env.IMAGE }} + file: docker/Dockerfile.builder + build-args: | + fromImage=${{ env.IMAGE_DEPS }} + numThreads=$(nproc) + cache-from: type=registry,ref=${{ env.IMAGE }} + cache-to: type=registry,ref=${{ env.IMAGE }},mode=max diff --git a/docker/Dockerfile.builder b/docker/Dockerfile.builder index 7a19f3e43f..4e35a82b2d 100644 --- a/docker/Dockerfile.builder +++ b/docker/Dockerfile.builder @@ -8,20 +8,20 @@ FROM $fromImage AS openroad-builder-base ARG numThreads=$(nproc) -COPY . /OpenROAD-flow-scripts -WORKDIR /OpenROAD-flow-scripts - -RUN ./build_openroad.sh --no_init --local --threads ${numThreads} - -FROM $fromImage AS openroad-flow-scripts-base - -COPY . /OpenROAD-flow-scripts - -RUN rm -rf /OpenROAD-flow-scripts/tools - -COPY --from=openroad-builder-base /OpenROAD-flow-scripts/tools/install /OpenROAD-flow-scripts/tools/install - -FROM $fromImage - -COPY --from=openroad-flow-scripts-base /OpenROAD-flow-scripts /OpenROAD-flow-scripts -WORKDIR /OpenROAD-flow-scripts +# COPY . /OpenROAD-flow-scripts +# WORKDIR /OpenROAD-flow-scripts +# +# RUN ./build_openroad.sh --no_init --local --threads ${numThreads} +# +# FROM $fromImage AS openroad-flow-scripts-base +# +# COPY . /OpenROAD-flow-scripts +# +# RUN rm -rf /OpenROAD-flow-scripts/tools +# +# COPY --from=openroad-builder-base /OpenROAD-flow-scripts/tools/install /OpenROAD-flow-scripts/tools/install +# +# FROM $fromImage +# +# COPY --from=openroad-flow-scripts-base /OpenROAD-flow-scripts /OpenROAD-flow-scripts +# WORKDIR /OpenROAD-flow-scripts diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev index 78a08a1b1e..da4cfdf1fb 100644 --- a/docker/Dockerfile.dev +++ b/docker/Dockerfile.dev @@ -9,8 +9,8 @@ WORKDIR /tmp/installer/etc COPY DependencyInstaller.sh . -COPY InstallerOpenROAD.sh \ - /tmp/installer/tools/OpenROAD/etc/DependencyInstaller.sh - -RUN ./DependencyInstaller.sh \ - && rm -rf /tmp/installer +# COPY InstallerOpenROAD.sh \ +# /tmp/installer/tools/OpenROAD/etc/DependencyInstaller.sh +# +# RUN ./DependencyInstaller.sh \ +# && rm -rf /tmp/installer