Skip to content

Commit 5e13494

Browse files
Factor out common install scripts; bump Verilator in integration-test (#39)
Move the commonly-used tool installation scripts into a new `install/` directory instead of each image having an almost-identical copy of it lying around. Move the dockerfiles into the same directory such that they are built from the same context, having access ot the same install script directory. This also bumps Verilator in the integration-test image to 5.040, which was the original trigger for this. Also move cleanup into the individual install scripts instead of having the dockerfiles run rm.
1 parent 3d73767 commit 5e13494

22 files changed

+49
-193
lines changed

.github/workflows/esiruntime-build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ jobs:
1111
- name: Get CIRCT images repo
1212
uses: actions/checkout@v4
1313
- name: Build and push image
14-
working-directory: ./esiruntime-wheel
1514
run: |
1615
TAG=$(date -u +%Y%m%d%H%M%S)
1716
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
18-
docker build . --tag ghcr.io/${{github.repository}}/esiruntime-wheel:$TAG
17+
docker build . -f esiruntime-wheel.dockerfile --tag ghcr.io/${{github.repository}}/esiruntime-wheel:$TAG
1918
docker push ghcr.io/${{github.repository}}/esiruntime-wheel:$TAG
2019
docker tag ghcr.io/${{github.repository}}/esiruntime-wheel:$TAG ghcr.io/${{github.repository}}/esiruntime-wheel:latest
2120
docker push ghcr.io/${{github.repository}}/esiruntime-wheel:latest

.github/workflows/integration-test.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Integration Test Image
22

33
on:
44
push:
5-
branches: [trunk]
5+
branches: [trunk, main]
66
paths:
77
- 'integration-test/**'
88
- '.github/workflows/integration-test.yml'
@@ -18,9 +18,6 @@ jobs:
1818
build:
1919
name: Build
2020
runs-on: ubuntu-latest
21-
defaults:
22-
run:
23-
working-directory: integration-test
2421
steps:
2522
- name: Checkout repository
2623
uses: actions/checkout@v4
@@ -31,7 +28,7 @@ jobs:
3128
echo "GHCR_TAG=ghcr.io/${{github.repository}}/circt-integration-test:$TAG" >> $GITHUB_ENV
3229
3330
- name: Build image
34-
run: docker build . --tag $GHCR_TAG
31+
run: docker build . -f integration-test.dockerfile --tag $GHCR_TAG
3532

3633
- name: Push image
3734
if: ${{ github.event_name == 'release' }}

.github/workflows/pycde-build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ jobs:
1111
- name: Get CIRCT images repo
1212
uses: actions/checkout@v4
1313
- name: Build and push image
14-
working-directory: ./pycde-build
1514
run: |
1615
TAG=$(date -u +%Y%m%d%H%M%S)
1716
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
18-
docker build . --tag ghcr.io/${{github.repository}}/pycde-build:$TAG
17+
docker build . -f pycde-build.dockerfile --tag ghcr.io/${{github.repository}}/pycde-build:$TAG
1918
docker push ghcr.io/${{github.repository}}/pycde-build:$TAG
2019
docker tag ghcr.io/${{github.repository}}/pycde-build:$TAG ghcr.io/${{github.repository}}/pycde-build:latest
2120
docker push ghcr.io/${{github.repository}}/pycde-build:latest

.github/workflows/pycde-esi-test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ jobs:
1111
- name: Get CIRCT images repo
1212
uses: actions/checkout@v4
1313
- name: Build and push image
14-
working-directory: ./pycde-esi-test
1514
run: |
1615
TAG=$(date -u +%Y%m%d%H%M%S)
1716
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
18-
docker build . --tag ghcr.io/${{github.repository}}/pycde-esi-test:$TAG
17+
docker build . -f pycde-esi-test.dockerfile --tag ghcr.io/${{github.repository}}/pycde-esi-test:$TAG
1918
docker push ghcr.io/${{github.repository}}/pycde-esi-test:$TAG
2019
docker tag ghcr.io/${{github.repository}}/pycde-esi-test:$TAG ghcr.io/${{github.repository}}/pycde-esi-test:latest
2120
docker push ghcr.io/${{github.repository}}/pycde-esi-test:latest

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ requires that the image definition and any files the definition needs to
1010
testing) `cd` into the image directory and run `docker build . -t <tag>`
1111
wherein tag is what you want the image to be called.
1212

13+
The `install` directory contains installation scripts shared by multiple images.
14+
1315
## Workflow
1416

1517
The publishing workflow for all the images is in
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ RUN yum install -y \
44
wget ninja-build autoconf bc bison flex flex-devel perl \
55
python3 python3-devel
66

7-
COPY *.sh /tmp/
8-
9-
# Compile, install, then cleanup gRPC
7+
# Install tools
8+
COPY install/*.sh /tmp/
109
RUN /tmp/grpc.sh
11-
RUN rm -r /tmp/grpc
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#!/bin/bash
2-
# Download and install a modern release of CMake into "/usr".
1+
#!/bin/bash -xe
32

43
CMAKE_VER=3.23.2
54

@@ -15,4 +14,9 @@ cd /tmp
1514
wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VER/$INSTALL_SCRIPT
1615
chmod +x $INSTALL_SCRIPT
1716
./$INSTALL_SCRIPT --skip-license --prefix=/usr
17+
18+
# Cleanup
1819
rm $INSTALL_SCRIPT
20+
21+
# Sanity check
22+
cmake --version | grep "cmake version $CMAKE_VER"
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
#!/usr/bin/env bash
2-
set -e
1+
#!/bin/bash -xe
32

4-
# Installs gRPC from source.
3+
GRPC_VER=1.54.2
4+
# v1.54.2 is the version in Ubuntu 22.04
55

66
cd /tmp
77

8-
# v1.54.2 is the version in Ubuntu 22.04
9-
GRPC_VER=1.54.2
10-
echo "Installing gRPC..."
11-
128
if [ ! -d grpc ]; then
139
git clone --recurse-submodules -b v$GRPC_VER https://github.com/grpc/grpc
1410
fi
@@ -23,4 +19,6 @@ cmake -S ../.. -B . \
2319
ninja -j$(nproc)
2420
ninja install
2521

26-
echo "Done."
22+
# Cleanup
23+
cd /tmp
24+
rm -r grpc
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
#!/bin/bash
2-
# Downloads, compiles, and installs OR-Tools into /usr
3-
4-
set -e
1+
#!/bin/bash -xe
2+
# Downloads, compiles, and installs OR-Tools
53

64
OR_TOOLS_VER=9.5
75

@@ -13,7 +11,6 @@ OR_TOOLS_VER=9.5
1311
cd /tmp
1412
wget https://github.com/google/or-tools/archive/v$OR_TOOLS_VER.tar.gz
1513
tar -zxf v$OR_TOOLS_VER.tar.gz
16-
rm v$OR_TOOLS_VER.tar.gz
1714
cd or-tools-$OR_TOOLS_VER
1815
cmake -S . -B build \
1916
-GNinja \
@@ -26,3 +23,8 @@ cmake -S . -B build \
2623

2724
cmake --build build --parallel $(nproc)
2825
cmake --install build --prefix /usr
26+
27+
# Cleanup
28+
cd /tmp
29+
rm v$OR_TOOLS_VER.tar.gz
30+
rm -r or-tools-$OR_TOOLS_VER
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ tar -zxf yosys-$YOSYS_VER.tar.gz
1010
rm yosys-$YOSYS_VER.tar.gz
1111
cd sby-yosys-$YOSYS_VER
1212
make PREFIX=/usr install
13-
cd ..
13+
14+
# Cleanup
15+
cd /tmp
1416
rm -r sby-yosys-$YOSYS_VER
1517

1618
# Perform a sanity check.

0 commit comments

Comments
 (0)