Skip to content

Commit b9f478c

Browse files
committed
Merge branch 'master' into manpage_docs
2 parents 2584a2c + eb58be1 commit b9f478c

26 files changed

+966
-1221
lines changed

.github/workflows/github-actions-cron-test-installer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ jobs:
4545
sudo service docker restart
4646
- name: Run installer
4747
run: |
48-
./etc/DockerHelper.sh create -target=dev -os=${{ matrix.os }}
48+
./etc/DockerHelper.sh create -target=dev -os=${{ matrix.os }} -tag=latest
4949
- name: Build project
5050
run: |
51-
./etc/DockerHelper.sh create -target=builder -os=${{ matrix.os }}
51+
./etc/DockerHelper.sh create -target=builder -os=${{ matrix.os }} -tag=latest
5252
- name: Test build
5353
run: |
5454
cmd="source ./env.sh ; yosys -help ; openroad -help ; make -C flow ;"
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: Build and publish ORFS images
2+
on:
3+
push:
4+
paths:
5+
- etc/DependencyInstaller.sh
6+
- etc/DockerHelper.sh
7+
- .github/workflows/github-actions-publish-docker-images.yml
8+
- build_openroad.sh
9+
- env.sh
10+
- flow/Makefile
11+
- docker/Dockerfile.dev
12+
- docker/Dockerfile.builder
13+
pull_request:
14+
paths:
15+
- etc/DependencyInstaller.sh
16+
- etc/DockerHelper.sh
17+
- .github/workflows/github-actions-publish-docker-images.yml
18+
- build_openroad.sh
19+
- env.sh
20+
- flow/Makefile
21+
- docker/Dockerfile.dev
22+
- docker/Dockerfile.builder
23+
24+
jobs:
25+
buildDependenciesImage:
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
os: [["ubuntu20.04", "ubuntu:20.04"], ["ubuntu22.04", "ubuntu:22.04"]]
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Check out repository code
33+
uses: actions/checkout@v3
34+
with:
35+
fetch-depth: 1
36+
submodules: recursive
37+
38+
- name: Set environment variables
39+
run: |
40+
echo "IMAGE_DEPS=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')-dev/${{ matrix.os[0] }}" >> $GITHUB_ENV
41+
42+
- name: Set up Docker Buildx
43+
uses: docker/setup-buildx-action@v3
44+
45+
- name: Login to GitHub Container Registry (GHCR)
46+
if: github.event_name != 'pull_request'
47+
uses: docker/login-action@v2
48+
with:
49+
registry: ghcr.io
50+
username: gha
51+
password: ${{ github.token }}
52+
53+
- name: Copy OpenROAD installer
54+
run: cp tools/OpenROAD/etc/DependencyInstaller.sh etc/InstallerOpenROAD.sh
55+
56+
- name: Build and export dependencies image
57+
uses: docker/build-push-action@v6
58+
with:
59+
context: etc
60+
push: true
61+
tags: ${{ env.IMAGE_DEPS }}:latest
62+
file: docker/Dockerfile.dev
63+
build-args: |
64+
fromImage=${{ matrix.os[1] }}
65+
numThreads=$(nproc)
66+
cache-from: type=registry,ref=${{ env.IMAGE_DEPS }}:buildcache
67+
cache-to: type=registry,ref=${{ env.IMAGE_DEPS }}:buildcache,mode=max
68+
69+
buildORFSImage:
70+
needs: buildDependenciesImage
71+
strategy:
72+
fail-fast: false
73+
matrix:
74+
os: ["ubuntu20.04", "ubuntu22.04"]
75+
runs-on: ubuntu-latest
76+
steps:
77+
- name: Free Disk Space
78+
uses: jlumbroso/free-disk-space@main
79+
with:
80+
tool-cache: false
81+
82+
- name: Check out repository code
83+
uses: actions/checkout@v3
84+
with:
85+
fetch-depth: 1
86+
submodules: recursive
87+
88+
- name: Set environment variables
89+
run: |
90+
echo "IMAGE=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')/${{ matrix.os }}" >> $GITHUB_ENV
91+
echo "IMAGE_DEPS=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')-dev/${{ matrix.os }}" >> $GITHUB_ENV
92+
93+
- name: Set up Docker Buildx
94+
uses: docker/setup-buildx-action@v3
95+
96+
# We don't use the build-push-action here because it hangs
97+
- name: Build ORFS image
98+
run: |
99+
docker buildx build \
100+
--load \
101+
--build-arg fromImage=${{ env.IMAGE_DEPS }}:latest \
102+
--build-arg numThreads=$(nproc) \
103+
--cache-from type=registry,ref=${{ env.IMAGE }}:buildcache \
104+
--tag ${{ env.IMAGE }}:latest \
105+
--file docker/Dockerfile.builder \
106+
.
107+
108+
- name: Test build
109+
run: |
110+
cmd="source ./env.sh && yosys -help && openroad -help && make -C flow ;"
111+
docker run ${{ env.IMAGE }}:latest /bin/bash -c "${cmd}"
112+
113+
- name: Login to GitHub Container Registry (GHCR)
114+
if: github.event_name != 'pull_request'
115+
uses: docker/login-action@v2
116+
with:
117+
registry: ghcr.io
118+
username: gha
119+
password: ${{ github.token }}
120+
121+
- name: Export ORFS image
122+
run: |
123+
docker buildx build \
124+
--build-arg fromImage=${{ env.IMAGE_DEPS }}:latest \
125+
--build-arg numThreads=$(nproc) \
126+
--cache-from type=registry,ref=${{ env.IMAGE }}:buildcache \
127+
--cache-to type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max \
128+
--tag ${{ env.IMAGE }}:latest \
129+
--file docker/Dockerfile.builder \
130+
--push \
131+
.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,5 @@ GitGuide.md
9191
Manpage.md
9292
mainREADME.md
9393
build
94+
.scala-build/
95+
.bsp/

build_openroad.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ OPENROAD_APP_BRANCH="master"
2020
INSTALL_PATH="$(pwd)/tools/install"
2121

2222
YOSYS_USER_ARGS=""
23-
YOSYS_ARGS="CONFIG=gcc"
23+
YOSYS_ARGS="CONFIG=clang"
2424

2525
OPENROAD_APP_USER_ARGS=""
2626
OPENROAD_APP_ARGS=""
@@ -206,6 +206,8 @@ EOF
206206
fi
207207
fi
208208

209+
echo "[INFO FLW-0028] Compiling with ${PROC} threads."
210+
209211
# Only add install prefix variables after parsing arguments.
210212
YOSYS_ARGS+=" PREFIX=${INSTALL_PATH}/yosys"
211213
OPENROAD_APP_ARGS+=" -D CMAKE_INSTALL_PREFIX=${INSTALL_PATH}/OpenROAD"

docker/Dockerfile.builder

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,24 @@
44
# instead use etc/DockerHelper.sh
55
ARG fromImage=openroad/flow-ubuntu22.04-dev:latest
66

7-
FROM $fromImage
7+
FROM $fromImage AS openroad-builder-base
88

99
ARG numThreads=$(nproc)
1010

1111
COPY . /OpenROAD-flow-scripts
1212
WORKDIR /OpenROAD-flow-scripts
1313
1414
RUN ./build_openroad.sh --no_init --local --threads ${numThreads}
15+
16+
FROM $fromImage AS openroad-flow-scripts-base
17+
18+
COPY . /OpenROAD-flow-scripts
19+
20+
RUN rm -rf /OpenROAD-flow-scripts/tools /OpenROAD-flow-scripts/.git
21+
22+
COPY --from=openroad-builder-base /OpenROAD-flow-scripts/tools/install /OpenROAD-flow-scripts/tools/install
23+
24+
FROM $fromImage
25+
26+
COPY --from=openroad-flow-scripts-base /OpenROAD-flow-scripts /OpenROAD-flow-scripts
27+
WORKDIR /OpenROAD-flow-scripts

docker/Dockerfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ COPY InstallerOpenROAD.sh \
1515
ARG options=""
1616

1717
RUN ./DependencyInstaller.sh $options \
18-
&& rm -rf /tmp/installer
18+
&& rm -rf /tmp/installer /tmp/* /var/tmp/* /var/lib/apt/lists/*
1919

2020
ARG fromImage
2121

etc/DependencyInstaller.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ _installCommon() {
3030
fi
3131
local pkgs="pandas numpy firebase_admin click pyyaml"
3232
if [[ $(id -u) == 0 ]]; then
33-
pip3 install -U $pkgs
33+
pip3 install --no-cache-dir -U $pkgs
3434
else
35-
pip3 install --user -U $pkgs
35+
pip3 install --no-cache-dir --user -U $pkgs
3636
fi
3737
}
3838

@@ -42,22 +42,22 @@ _installCentosCleanUp() {
4242
}
4343

4444
_installCentosPackages() {
45-
yum update -y
46-
yum install -y \
45+
yum -y update
46+
yum -y install \
4747
time \
4848
ruby \
4949
ruby-devel
5050

5151
if ! [ -x "$(command -v klayout)" ]; then
52-
yum install -y https://www.klayout.org/downloads/CentOS_7/klayout-${klayoutVersion}-0.x86_64.rpm
52+
yum -y install https://www.klayout.org/downloads/CentOS_7/klayout-${klayoutVersion}-0.x86_64.rpm
5353
else
5454
currentVersion=$(klayout -v | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
5555
if _versionCompare $currentVersion -ge $klayoutVersion; then
5656
echo "KLayout version greater than or equal to ${klayoutVersion}"
5757
else
5858
echo "KLayout version less than ${klayoutVersion}"
5959
sudo yum remove -y klayout
60-
yum install -y https://www.klayout.org/downloads/CentOS_7/klayout-${klayoutVersion}-0.x86_64.rpm
60+
yum -y install https://www.klayout.org/downloads/CentOS_7/klayout-${klayoutVersion}-0.x86_64.rpm
6161
fi
6262
fi
6363
}
@@ -70,10 +70,11 @@ _installUbuntuCleanUp() {
7070
_installUbuntuPackages() {
7171
export DEBIAN_FRONTEND="noninteractive"
7272
apt-get -y update
73-
apt-get -y install \
73+
apt-get -y install --no-install-recommends \
7474
libqt5multimediawidgets5 \
7575
libqt5svg5-dev \
7676
libqt5xmlpatterns5-dev \
77+
libqt5opengl5 \
7778
libz-dev \
7879
python3-pip \
7980
qtmultimedia5-dev \
@@ -84,7 +85,7 @@ _installUbuntuPackages() {
8485

8586
# install KLayout
8687
if _versionCompare $1 -ge 23.04; then
87-
apt-get install -y klayout python3-pandas
88+
apt-get -y install --no-install-recommends klayout python3-pandas
8889
else
8990
if [[ $1 == 20.04 ]]; then
9091
klayoutChecksum=15a26f74cf396d8a10b7985ed70ab135
@@ -113,25 +114,24 @@ _installDarwinPackages() {
113114

114115
_installCI() {
115116
apt-get -y update
116-
117-
#docker
118-
apt install -y \
117+
apt-get -y install --no-install-recommends \
119118
apt-transport-https \
120119
ca-certificates \
120+
coreutils \
121121
curl \
122+
python3 \
122123
software-properties-common
124+
123125
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
124-
echo \
125-
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
126-
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
127-
apt-get -y update
128-
apt-get install -y docker-ce docker-ce-cli containerd.io
126+
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
127+
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
129128

130-
# python
131-
apt-get install -y python3
129+
apt-get -y update
130+
apt-get -y install --no-install-recommends \
131+
docker-ce \
132+
docker-ce-cli \
133+
containerd.io
132134

133-
# stdbuf
134-
apt-get install -y coreutils
135135
}
136136

137137
_help() {

0 commit comments

Comments
 (0)