Skip to content

Commit 604a2aa

Browse files
committed
Merge branch 'master' into secure-check_antennas_metrics
Signed-off-by: Eder Monteiro <[email protected]>
2 parents 1544013 + f8d87d5 commit 604a2aa

File tree

18 files changed

+596
-874
lines changed

18 files changed

+596
-874
lines changed

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
os: ["ubuntu20.04", "ubuntu22.04", "centos7"]
29+
os: ["ubuntu20.04", "ubuntu22.04"]
3030
runs-on: ubuntu-latest
3131
steps:
3232
- name: Check out repository code
@@ -52,9 +52,4 @@ jobs:
5252
- name: Test build
5353
run: |
5454
cmd="source ./env.sh ; yosys -help ; openroad -help ; make -C flow ;"
55-
if [[ ${{ matrix.os }} == "centos7" ]]; then
56-
cmd="source /opt/rh/devtoolset-8/enable; ${cmd}"
57-
cmd="source /opt/rh/llvm-toolset-7.0/enable; ${cmd}"
58-
cmd="source /opt/rh/rh-python38/enable; ${cmd}"
59-
fi
6055
docker run openroad/flow-${{ matrix.os }}-builder /bin/bash -c "${cmd}"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,4 @@ docs/main
8989
docs/build
9090
GitGuide.md
9191
mainREADME.md
92+
build

docker/Dockerfile.builder

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# i.e., "./build_openroad.sh --local" from inside a docker container
33
# NOTE: don't use this file directly unless you know what you are doing,
44
# instead use etc/DockerHelper.sh
5-
ARG fromImage=openroad/flow-centos7-dev:latest
5+
ARG fromImage=openroad/flow-ubuntu22.04-dev:latest
66

77
FROM $fromImage
88

docker/Dockerfile.dev

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# create image with dependencies needed to compile openroad app and run openroad flow scripts
22
# NOTE: don't use this file directly unless you know what you are doing,
33
# instead use etc/DockerHelper.sh
4-
ARG fromImage=centos:centos7
4+
ARG fromImage=ubuntu:22.04
55

66
FROM $fromImage
77

@@ -12,11 +12,13 @@ COPY DependencyInstaller.sh .
1212
COPY InstallerOpenROAD.sh \
1313
/tmp/installer/tools/OpenROAD/etc/DependencyInstaller.sh
1414

15-
RUN ./DependencyInstaller.sh \
15+
ARG options=""
16+
17+
RUN ./DependencyInstaller.sh $options \
1618
&& rm -rf /tmp/installer
1719

1820
ARG fromImage
1921

2022
RUN echo "$fromImage" | grep -q "ubuntu" && \
2123
strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so || \
22-
echo "Skipping strip command as fromImage does not contain 'ubuntu'"
24+
echo "Skipping strip command as fromImage does not contain 'ubuntu'"

etc/DependencyInstaller.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,29 @@ _installDarwinPackages() {
111111
brew install --cask klayout
112112
}
113113

114+
_installCI() {
115+
apt-get -y update
116+
117+
#docker
118+
apt install -y \
119+
apt-transport-https \
120+
ca-certificates \
121+
curl \
122+
software-properties-common
123+
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
129+
130+
# python
131+
apt-get install -y python3
132+
133+
# stdbuf
134+
apt-get install -y coreutils
135+
}
136+
114137
_help() {
115138
cat <<EOF
116139
@@ -138,6 +161,8 @@ Usage: $0
138161
# "$HOME/.local". Only used with
139162
# -common. This flag cannot be used with
140163
# sudo or with root access.
164+
$0 -ci
165+
# Installs CI tools
141166
EOF
142167
exit "${1:-1}"
143168
}
@@ -150,6 +175,7 @@ PREFIX=""
150175
option="all"
151176
# default isLocal
152177
isLocal="false"
178+
CI="no"
153179

154180
# default values, can be overwritten by cmdline args
155181
while [ "$#" -gt 0 ]; do
@@ -174,6 +200,9 @@ while [ "$#" -gt 0 ]; do
174200
-local)
175201
OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} -local"
176202
;;
203+
-ci)
204+
CI="yes"
205+
;;
177206
-prefix=*)
178207
OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} $1"
179208
;;
@@ -209,6 +238,9 @@ esac
209238

210239
case "${os}" in
211240
"CentOS Linux" )
241+
if [[ ${CI} == "yes" ]]; then
242+
echo "WARNING: Installing CI dependencies is only supported on Ubuntu 22.04" >&2
243+
fi
212244
_installORDependencies
213245
if [[ "${option}" == "base" || "${option}" == "all" ]]; then
214246
_installCentosPackages
@@ -220,6 +252,10 @@ case "${os}" in
220252
;;
221253
"Ubuntu" )
222254
version=$(awk -F= '/^VERSION_ID/{print $2}' /etc/os-release | sed 's/"//g')
255+
if [[ ${CI} == "yes" ]]; then
256+
echo "Installing CI Tools"
257+
_installCI
258+
fi
223259
_installORDependencies
224260
if [[ "${option}" == "base" || "${option}" == "all" ]]; then
225261
_installUbuntuPackages "${version}"
@@ -232,6 +268,9 @@ case "${os}" in
232268
fi
233269
;;
234270
"Darwin" )
271+
if [[ ${CI} == "yes" ]]; then
272+
echo "WARNING: Installing CI dependencies is only supported on Ubuntu 22.04" >&2
273+
fi
235274
_installORDependencies
236275
if [[ "${option}" == "base" || "${option}" == "all" ]]; then
237276
_installDarwinPackages

etc/DockerHelper.sh

Lines changed: 69 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,26 @@ usage: $0 [CMD] [OPTIONS]
1818
push Push the docker image to Docker Hub
1919
2020
OPTIONS:
21-
-os=OS_NAME Choose beween centos7 (default), ubuntu20.04 and ubuntu22.04.
21+
-os=OS_NAME Choose beween ubuntu20.04 and ubuntu22.04 (default).
2222
-target=TARGET Choose target fo the Docker image:
2323
'dev': os + packages to compile app
2424
'builder': os + packages to compile app +
2525
copy source code and build app
2626
-threads Max number of threads to use if compiling.
2727
-sha Use git commit sha as the tag image. Default is
2828
'latest'.
29+
-ci Install CI tools in image
2930
-h -help Show this message and exits
31+
-username Docker Username
32+
-password Docker Password
3033
3134
EOF
3235
exit "${1:-1}"
3336
}
3437

3538
_setup() {
36-
commitSha="$(git rev-parse HEAD)"
39+
commitSha="$(git rev-parse HEAD | tr -cd 'a-zA-Z0-9-')"
3740
case "${os}" in
38-
"centos7")
39-
osBaseImage="centos:centos7"
40-
;;
4141
"ubuntu20.04")
4242
osBaseImage="ubuntu:20.04"
4343
;;
@@ -50,13 +50,12 @@ _setup() {
5050
;;
5151
esac
5252
imageName="${IMAGE_NAME_OVERRIDE:-"${org}/flow-${os}-${target}"}"
53-
if [[ "${useCommitSha}" == "yes" ]]; then
54-
imageTag="${commitSha}"
55-
else
56-
imageTag="latest"
53+
imageTag="${commitSha}"
54+
if [[ "${tag}" != "NONE" ]]; then
55+
imageTag="${tag}"
5756
fi
5857
case "${target}" in
59-
"builder" )
58+
"builder" | "master")
6059
fromImage="${FROM_IMAGE_OVERRIDE:-"${org}/flow-${os}-dev"}:${imageTag}"
6160
context="."
6261
buildArgs="--build-arg numThreads=${numThreads}"
@@ -65,7 +64,7 @@ _setup() {
6564
fromImage="${FROM_IMAGE_OVERRIDE:-$osBaseImage}"
6665
cp tools/OpenROAD/etc/DependencyInstaller.sh etc/InstallerOpenROAD.sh
6766
context="etc"
68-
buildArgs=""
67+
buildArgs="--build-arg options=${options}"
6968
;;
7069
*)
7170
echo "Target ${target} not found" >&2
@@ -79,38 +78,57 @@ _setup() {
7978

8079
_create() {
8180
echo "Create docker image ${imagePath} using ${file}"
82-
docker build --file "${file}" --tag "${imagePath}" ${buildArgs} "${context}"
81+
docker build \
82+
--file "${file}" \
83+
--tag "${imagePath}" \
84+
${buildArgs} \
85+
"${context}"
8386
rm -f etc/InstallerOpenROAD.sh
8487
}
8588

8689
_push() {
90+
if [[ -z ${username+x} ]]; then
91+
echo "Missing required -username=<USER> argument"
92+
_help
93+
fi
94+
if [[ -z ${password+x} ]]; then
95+
echo "Missing required -password=<PASS> argument"
96+
_help
97+
fi
98+
docker login --username ${username} --password ${password}
99+
if [[ "${tag}" == "NONE" ]]; then
100+
tag="latest"
101+
fi
102+
mkdir -p build
87103
case "${target}" in
88104
"dev" )
89-
read -p "Will push docker image ${imagePath} to DockerHub [y/N]" -n 1 -r
90-
echo
91-
if [[ $REPLY =~ ^[Yy]$ ]]; then
92-
mkdir -p build
93-
94-
OS_LIST="centos7 ubuntu20.04 ubuntu22.04"
95-
# create image with sha and latest tag for all os
96-
for os in ${OS_LIST}; do
97-
./etc/DockerHelper.sh create -target=dev \
98-
2>&1 | tee build/create-${os}-latest.log
99-
./etc/DockerHelper.sh create -target=dev -sha \
100-
2>&1 | tee build/create-${os}-${commitSha}.log
101-
done
102-
103-
for os in ${OS_LIST}; do
104-
echo [DRY-RUN] docker push openroad/flow-${os}-dev:latest
105-
echo [DRY-RUN] docker push openroad/flow-${os}-dev:${commitSha}
106-
done
107-
108-
else
109-
echo "Will not push."
110-
fi
105+
./etc/DockerHelper.sh create -os=${os} -ci -target=${target} \
106+
2>&1 | tee build/create-${os}-${target}-${tag}.log
107+
docker push ${imagePath}
111108
;;
109+
110+
"master" )
111+
# Create dev image needed as a base for builder image
112+
./etc/DockerHelper.sh create -os=${os} -target=dev \
113+
2>&1 | tee build/create-${os}-dev-${target}-${tag}.log
114+
# Create builder image
115+
./etc/DockerHelper.sh create -os=${os} -target=builder \
116+
2>&1 | tee build/create-${os}-${target}-${tag}.log
117+
118+
docker push ${org}/flow-${os}-dev:${commitSha}
119+
120+
docker tag ${org}/flow-${os}-dev:${commitSha} ${org}/flow-${os}-dev:latest
121+
docker push ${org}/flow-${os}-dev:latest
122+
123+
docker tag ${org}/flow-${os}-builder:${commitSha} ${org}/orfs:${commitSha}
124+
docker push ${org}/orfs:${commitSha}
125+
126+
docker tag ${org}/flow-${os}-builder:${commitSha} ${org}/orfs:${tag}
127+
docker push ${org}/orfs:${tag}
128+
;;
129+
112130
*)
113-
echo "Target ${target} is not valid candidate for push to DockerHub." >&2
131+
echo "Target ${target} is not valid candidate for push to Docker Hub." >&2
114132
_help
115133
;;
116134
esac
@@ -139,17 +157,21 @@ if [[ -z $(command -v "${_rule}") ]]; then
139157
_help
140158
fi
141159

142-
# default values, can be overwritten by cmdline args
143-
os="centos7"
160+
# default values, can be overwritten by command line arguments
161+
os="ubuntu22.04"
144162
target="dev"
145-
useCommitSha="no"
146163
numThreads="-1"
164+
tag="NONE"
165+
options=""
147166

148167
while [ "$#" -gt 0 ]; do
149168
case "${1}" in
150169
-h|-help)
151170
_help 0
152171
;;
172+
-ci )
173+
options="-ci"
174+
;;
153175
-os=* )
154176
os="${1#*=}"
155177
;;
@@ -159,10 +181,16 @@ while [ "$#" -gt 0 ]; do
159181
-threads=* )
160182
numThreads="${1#*=}"
161183
;;
162-
-sha )
163-
useCommitSha=yes
184+
-username=* )
185+
username="${1#*=}"
186+
;;
187+
-password=* )
188+
password="${1#*=}"
189+
;;
190+
-tag=* )
191+
tag="${1#*=}"
164192
;;
165-
-os | -target )
193+
-os | -target | -threads | -username | -password | -tag )
166194
echo "${1} requires an argument" >&2
167195
_help
168196
;;

flow/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ elapsed-all:
865865

866866
# ==============================================================================
867867

868-
ifneq ($(USE_FILL),)
868+
ifeq ($(USE_FILL),1)
869869
$(eval $(call do-step,6_1_fill,$(RESULTS_DIR)/5_route.odb $(RESULTS_DIR)/5_route.sdc $(FILL_CONFIG),density_fill))
870870
else
871871
$(eval $(call do-copy,6_1_fill,5_route.odb))

0 commit comments

Comments
 (0)