Skip to content

Commit ca3237f

Browse files
luarssvvbandeira
andauthored
[Docs] Docker shell update (#1427)
* Docker shell update --------- Signed-off-by: luarss <[email protected]> Co-authored-by: Vitor Bandeira <[email protected]>
1 parent 09d7d2d commit ca3237f

File tree

4 files changed

+87
-66
lines changed

4 files changed

+87
-66
lines changed

docs/user/BuildWithDocker.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ make
8585
exit
8686
```
8787

88+
Alternatively you may also use the `docker_shell` utility as follows.
89+
It is important that you are in the `flow` directory.
90+
91+
```shell
92+
cd flow
93+
util/docker_shell make
94+
```
95+
8896
## Enable GUI support
8997

9098
To use the GUI feature you will need to start the docker with the
@@ -112,10 +120,19 @@ Then use:
112120
docker run --rm -it -e DISPLAY=<IP_LIKE_FROM_TUTORIAL>:0 --network host --privileged <IMAGE_NAME>
113121
```
114122

115-
## Docker Shell Utility
123+
Alternatively, you may also use the `docker_shell` utility for GUI as follows.
124+
It is important that you are in the `flow` directory.
116125

117-
Alternatively, use `docker_shell` to automate the above commands using the
118-
user's parameters. Do refer to the documentation [here](./DockerShell.md).
126+
```shell
127+
cd flow
128+
util/docker_shell gui_final
129+
```
130+
131+
```{note}
132+
`docker_shell` is a helpful utility to automate the
133+
aforementioned Docker commands using the user's parameters.
134+
Do refer to the documentation [here](./DockerShell.md).
135+
```
119136

120137
## Build Docker Image for Different OS
121138

docs/user/DockerShell.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,62 @@
1-
```{include} ../../flow/util/README.md
1+
Building example design using Docker image
2+
==========================================
3+
4+
The `docker_shell` script is used as a prefix to launch a command using a OpenROAD docker image.
5+
6+
Also, the current working directory is mapped into the Docker image using the current user's credentials.
7+
8+
Build docker image
9+
------------------
10+
11+
First build the docker image:
12+
13+
```
14+
cd OpenROAD-flow-scripts
15+
./build_openroad.sh
16+
```
17+
18+
Build an example design and run the GUI:
19+
20+
```
21+
cd flow
22+
util/docker_shell make
23+
util/docker_shell make gui_final
24+
```
25+
26+
You can also launch an interactive bash session:
27+
28+
```
29+
util/docker_shell bash
30+
```
31+
32+
If you need to use a different Docker image than default, override by using the `docker_shell_IMAGE`
33+
environment variable:
34+
35+
```
36+
OR_IMAGE=openroad/flow-centos7-builder:v1234 util/docker_shell make
237
```
338

39+
If you have built your OpenROAD Docker image using prebuilt binaries,
40+
you might want to source custom paths for your modules as follows.
41+
42+
```
43+
OR_IMAGE=openroad_prebuilt_image YOSYS_CMD=/oss-cad-suite/bin/yosys util/docker_shell make
44+
```
45+
46+
Using `docker_shell` from outside of `OpenROAD-flow-scripts/flow` folder
47+
------------------------------------------------------------------------
48+
49+
If you have designs you are keeping in a git source repository that is not
50+
a fork of the OpenROAD-flow-scripts git repository, you can still use
51+
the `docker_shell` script.
52+
53+
Two ways to use `docker_shell`
454

55+
1. Simply invoke it from the ORFS location.
56+
2. Copy the script into your source folder. This would allow you
57+
to build and publish a Docker image to a private Docker repository
58+
and lock the ORFS version to the version of your source code. This
59+
gives you a way to deploy updates of ORFS
60+
easily, publish a new Docker image, modify the copy of `docker_shell`
61+
and create a pull request to possibly test your upgrade on your private
62+
build serves.

flow/util/README.md

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

flow/util/docker_shell

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ set -ex
44
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
55

66
WORKSPACE=$(pwd)
7+
YOSYS_CMD=${YOSYS_CMD:-/OpenROAD-flow-scripts/tools/install/yosys/bin/yosys}
8+
OPENROAD_EXE=${OPENROAD_EXE:-/OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad}
9+
KLAYOUT_CMD=${KLAYOUT_CMD:-/usr/bin/klayout}
710

811
XSOCK=/tmp/.X11-unix
912
XAUTH=/tmp/.docker.xauth
@@ -27,13 +30,15 @@ docker run -u $(id -u ${USER}):$(id -g ${USER}) \
2730
-e XAUTHORITY=$XAUTH \
2831
-e FLOW_HOME=/OpenROAD-flow-scripts/flow/ \
2932
-e MAKEFILES=/OpenROAD-flow-scripts/flow/Makefile \
30-
-v $WORKSPACE:`pwd` \
33+
-e YOSYS_CMD=$YOSYS_CMD \
34+
-e OPENROAD_EXE=$OPENROAD_EXE \
35+
-e KLAYOUT_CMD=$KLAYOUT_CMD \
36+
-v $WORKSPACE:/OpenROAD-flow-scripts/flow \
3137
--network host \
3238
$DOCKER_INTERACTIVE \
3339
${OR_IMAGE:-openroad/flow-ubuntu22.04-builder:latest} \
3440
bash -c "set -ex
3541
mkdir /tmp/xdg-run
36-
. ./env.sh
37-
cd $WORKSPACE
42+
cd /OpenROAD-flow-scripts/flow
3843
$ARGUMENTS
3944
"

0 commit comments

Comments
 (0)