Skip to content

Commit a9d42d8

Browse files
committed
docker: move to flow/util and rename to docker_shell and add OR_IMAGE
Allows specifying which ORFS Docker image to use. Signed-off-by: Øyvind Harboe <[email protected]>
1 parent 17fafea commit a9d42d8

File tree

3 files changed

+63
-30
lines changed

3 files changed

+63
-30
lines changed

flow/README.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

flow/util/README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
Building example design using Docker image
2+
==========================================
3+
4+
The `docker_shell` script is used as a prefix to launch a command within the OpenROAD docker image.
5+
6+
This script is set up to run the OpenROAD GUI from
7+
within the Docker image on the host platform.
8+
9+
Also, the current working directory is mapped into the Docker image using the current user's credentials.
10+
11+
Build docker image
12+
------------------
13+
14+
First build the docker image:
15+
16+
```
17+
cd OpenROAD-flow-scripts
18+
sudo ./setup.sh
19+
./build_openroad.sh
20+
```
21+
22+
Build an example design and run the GUI:
23+
24+
```
25+
cd flow
26+
util/docker_shell make
27+
util/docker_shell make gui_final
28+
```
29+
30+
You can also launch an interactive bash session:
31+
32+
```
33+
util/docker_shell bash
34+
```
35+
36+
If you need to use a different Docker image than default, override by using the `docker_shell_IMAGE`
37+
environment variable:
38+
39+
```
40+
OR_IMAGE=openroad/flow-centos7-builder:v1234 util/docker_shell make
41+
```
42+
43+
Using `docker_shell` from outside of `OpenROAD-flow-scripts/flow` folder
44+
------------------------------------------------------------------------
45+
46+
If you have designs you are keeping in a git source repository that is not
47+
a fork of the OpenROAD-flow-scripts git repository, you can still use
48+
the `docker_shell` script.
49+
50+
Two ways to use `docker_shell`
51+
52+
1. Simply invoke it from the ORFS location.
53+
2. Copy the script into your source folder. This would allow you
54+
to build and publish a Docker image to a private Docker repository
55+
and lock the ORFS version to the version of your source code. This
56+
gives you a way to deploy updates of ORFS
57+
easily, publish a new Docker image, modify the copy of `docker_shell`
58+
and create a pull request to possibly test your upgrade on your private
59+
build serves.

flow/or renamed to flow/util/docker_shell

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ if test -t 0; then
1313
DOCKER_INTERACTIVE=-ti
1414
fi
1515

16+
# Most of these options below has to do with allowing to
17+
# run the OpenROAD GUI from within Docker.
1618
docker run -u $(id -u ${USER}):$(id -g ${USER}) \
1719
-e LIBGL_ALWAYS_SOFTWARE=1 \
1820
-e "QT_X11_NO_MITSHM=1" \
@@ -26,10 +28,10 @@ docker run -u $(id -u ${USER}):$(id -g ${USER}) \
2628
-e MAKEFILES=/OpenROAD-flow-scripts/flow/Makefile \
2729
-v $WORKSPACE:`pwd` \
2830
$DOCKER_INTERACTIVE \
29-
openroad/flow-centos7-builder:latest \
31+
${OR_IMAGE:-openroad/flow-centos7-builder:latest} \
3032
bash -c "set -ex
3133
mkdir /tmp/xdg-run
3234
. ./env.sh
33-
cd $DIR
35+
cd $WORKSPACE
3436
$ARGUMENTS
3537
"

0 commit comments

Comments
 (0)