Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
limerainne committed Dec 1, 2017
0 parents commit 528f2c6
Show file tree
Hide file tree
Showing 7 changed files with 307 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./package/
70 changes: 70 additions & 0 deletions Dockerfile_Cadence_NC
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
FROM ubuntu:14.04 AS installer
ARG repo_sed=s#://archive.ubuntu.com#://kr.archive.ubuntu.com#g

# Java 6+ might be required to run the installer
RUN sed -i -e '${repo_sed}' /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends openjdk-6-jre \
&& rm -rf /var/lib/apt/lists/*

# information of the tool to be installed in this image
# TODO how to deduplicate below arguments declaration
ARG base_dir=/usr/cadence
ARG tool=INCISIVE
ARG version=15

ARG installer_dir=InstallScape


# copy installer and installation package temporarily
COPY package/${installer_dir} /tmp/installer/
COPY package/${tool}${version} /tmp/package/

# batch install target package
RUN mkdir -p ${base_dir}/ \
&& /tmp/installer/iscape/bin/iscape.sh -batch majorAction=InstallFromArchive \
archiveDirectory=/tmp/package/ installDirectory=${base_dir}/${tool}${version} \
&& rm -rf /tmp/package/ \
&& rm -rf /tmp/installer/


# NOTE using multi-stage image build; avoid installer package from included in the final image
FROM ubuntu:14.04
ARG repo_sed=s#://archive.ubuntu.com#://kr.archive.ubuntu.com#g

# Java 6+ might be required to run actual software
RUN sed -i -e '${repo_sed}' /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends openjdk-6-jre \
&& rm -rf /var/lib/apt/lists/*

# install required library to run Cadence tool and X11 library to show GUI
RUN sed -i -e '${repo_sed}' /etc/apt/sources.list \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
libxtst6:i386 libxext6:i386 libxi6:i386 ksh csh \
&& apt-get install -y --no-install-recommends xorg \
&& rm -rf /var/lib/apt/lists/*
# TODO find much lighter package rather than xorg; 'x11-apps' is not applicable

# copy actual tool to be run in this image
ARG base_dir=/usr/cadence
ARG tool=INCISIVE
ARG version=15

ARG default_command=nclaunch # or irun

# just copy installed package from intermediate image
COPY --from=installer ${base_dir}/ ${base_dir}/

# set path to the tool executable
ENV PATH ${base_dir}/${tool}${version}/tools/bin:$PATH

# let 64-bit binary to be executed
ENV CDS_AUTO_64BIT "ALL"


# set path to the tool executable
CMD "${default_command}"

65 changes: 65 additions & 0 deletions Dockerfile_Synopsys_DC
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
FROM ubuntu:14.04 AS installer
ARG repo_sed=s#://archive.ubuntu.com#://kr.archive.ubuntu.com#g

# 'cshell' is required to run the installer
RUN sed -i -e '${repo_sed}' /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends csh \
&& rm -rf /var/lib/apt/lists/*

# information of the tool to be installed in this image
# TODO how to deduplicate below arguments declaration
ARG base_dir=/usr/synopsys
ARG tool=syn
ARG version=L-2016.03-SP5-5

ARG installer_version=v3.2


# copy installer and installation package temporarily
COPY package/installer_${installer_version} /tmp/installer/
COPY package/${tool}_v${version} /tmp/package/

# batch install target package
RUN mkdir -p ${base_dir} \
&& /tmp/installer/SynopsysInstaller_${installer_version}.run -dir ${base_dir}/installer_${installer_version} \
&& echo 'yes' | USER=docker ${base_dir}/installer_${installer_version}/batch_installer -install_as_root -source /tmp/package/ -target ${base_dir}/ -allprods \
&& rm -rf /tmp/package/ \
&& rm -rf /tmp/installer/ \
&& rm -rf ${base_dir}/installer_${installer_version}


# NOTE using multi-stage image build; avoid installer package from included in the final image
FROM ubuntu:14.04
ARG repo_sed=s#://archive.ubuntu.com#://kr.archive.ubuntu.com#g

# install required library to run Synopsys tool and X11 library to show GUI
RUN sed -i -e '${repo_sed}' /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
csh libxss1 libsm6 libice6 libxft2 libjpeg62 libtiff5 libmng2 libpng12-0 \
&& apt-get install -y --no-install-recommends xorg \
&& rm -rf /var/lib/apt/lists/*
# TODO find much lighter package rather than xorg; 'x11-apps' is not applicable

# WORKAROUND link outdated library filename required from Synopsys tools
# WORKAROUND set default shell as Bash to avoid error from script included in the tool
RUN ln -s /usr/lib/x86_64-linux-gnu/libtiff.so.5 /usr/lib/x86_64-linux-gnu/libtiff.so.3 \
&& ln -s /usr/lib/x86_64-linux-gnu/libmng.so.2 /usr/lib/x86_64-linux-gnu/libmng.so.1 \
&& update-alternatives --install /bin/sh sh /bin/bash 20

# copy actual tool to be run in this image
ARG base_dir=/usr/synopsys
ARG tool=syn
ARG version=L-2016.03-SP5-5


# just copy installed package from intermediate image
COPY --from=installer ${base_dir}/ ${base_dir}/

# set path to the tool executable
ENV PATH ${base_dir}/${tool}/${version}/bin:$PATH

# default command when running this image
CMD "dc_shell"

67 changes: 67 additions & 0 deletions Dockerfile_Synopsys_ICC
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
FROM ubuntu:14.04 AS installer
ARG repo_sed=s#://archive.ubuntu.com#://kr.archive.ubuntu.com#g

# 'cshell' is required to run the installer
RUN sed -i -e '${repo_sed}' /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends csh \
&& rm -rf /var/lib/apt/lists/*

# information of the tool to be installed in this image
# TODO how to deduplicate below arguments declaration
ARG base_dir=/usr/synopsys
ARG tool=icc
ARG version=L-2016.03-SP5-2

ARG installer_version=v3.2


# copy installer and installation package temporarily
COPY package/installer_${installer_version} /tmp/installer/
COPY package/${tool}_v${version} /tmp/package/

# batch install target package
RUN mkdir -p ${base_dir} \
&& /tmp/installer/SynopsysInstaller_${installer_version}.run -dir ${base_dir}/installer_${installer_version} \
&& echo 'yes' | USER=docker ${base_dir}/installer_${installer_version}/batch_installer -install_as_root -source /tmp/package/ -target ${base_dir}/ -allprods \
&& rm -rf /tmp/package/ \
&& rm -rf /tmp/installer/ \
&& rm -rf ${base_dir}/installer_${installer_version}


# NOTE using multi-stage image build; avoid installer package from included in the final image
FROM ubuntu:14.04
ARG repo_sed=s#://archive.ubuntu.com#://kr.archive.ubuntu.com#g

# install required library to run Synopsys tool and X11 library to show GUI
RUN sed -i -e '${repo_sed}' /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
csh libxss1 libsm6 libice6 libxft2 libjpeg62 libtiff5 libmng2 libpng12-0 \
&& apt-get install -y --no-install-recommends xorg \
&& rm -rf /var/lib/apt/lists/*
# TODO find much lighter package rather than xorg; 'x11-apps' is not applicable

# WORKAROUND link outdated library filename required from Synopsys tools
# WORKAROUND set default shell as Bash to avoid error from script included in the tool
RUN ln -s /usr/lib/x86_64-linux-gnu/libtiff.so.5 /usr/lib/x86_64-linux-gnu/libtiff.so.3 \
&& ln -s /usr/lib/x86_64-linux-gnu/libmng.so.2 /usr/lib/x86_64-linux-gnu/libmng.so.1 \
&& update-alternatives --install /bin/sh sh /bin/bash 20

# copy actual tool to be run in this image
ARG base_dir=/usr/synopsys
ARG tool=icc
ARG version=L-2016.03-SP5-2

ARG default_command=icc_shell


# just copy installed package from intermediate image
COPY --from=installer ${base_dir}/ ${base_dir}/

# set path to the tool executable
ENV PATH ${base_dir}/${tool}/${version}/bin:$PATH

# default command when running this image
CMD "${default_command}"

62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# [WIP] Dockerize scripts for commercial EDA tools

I don't think dockerizing EDA tools is somewhat useful, but here is the `Dockerfile`s for dockerizing popular EDA tools!

## CAVEAT
- I failed to achieve X11 forwarding. In other words, with this image you cannot open GUI windows.
- Using Ubuntu (14.04) as a base image, the size of generated images is larger than desired.
- Did not test uploading to "private" docker registry.
- (you should not upload image containing commeiclal tool to public docker registry, of course ;-) )
- Intermediate image does not removed automatically. You have to remove by yourself for now.

## Prerequisites
- Docker 17.05+ (this script utilizes multi-stage build feature)
- Installer and installation package of the tool you want to dockerize
- This repository consists of just `Dockerfile`s, not actual images or installer packages

## Generating an image

- First, clone this repository to your workstation.
- Copy (or bind mount) installer and installation package to the subdirectory
- Refer to shell scripts for bind-mounting installation files from other path
- Execute below command to create an image.
`$ sudo docker build -t <image_name>:<version> -f <Dockerfile> .`
`e.g. $ sudo docker build -t synopsys_dc:X-2020.4 -f Dockerfile_Synopsys_DC .`
- Remove intermediate image created during building an image.
```bash
$ sudo docker images # find a tag of the intermediate image
$ sudo docker rmi <image_tag_you_want_to_remove>
```

- Example container launching command
- You should pass environment variable regarding your license server
```bash
$ sudo docker run --rm -it -e LM_LICENSE_FILE="<port>@<license_server>" \
-env="DISPLAY" \
<image_name> [<command>]
```

## Vendor specific regardings

### Synopsys

- Requires following jobs to be run within Ubuntu (14.04) environment
```bash
$ sudo apt install csh libxss1 libsm6 libice6 libxft2 libjpeg62 libtiff5 libmng2 libpng12-0
# WORKAROUND link old library filenames with newer version
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libtiff.so.5 /usr/lib/x86_64-linux-gnu/libtiff.so.3
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libmng.so.2 /usr/lib/x86_64-linux-gnu/libmng.so.1
```

### Cadence

- Requires following packages
```bash
$ sudo apt install openjdk-6-jre # for installer
$ sudo dpkg --add-architecture i386
$ sudo apt libxtst6:i386 libxext6:i386 libxi6:i386 ksh csh \
```

- define below envvar to execute 64-bit binary
`$ export CDS_AUTO_64BIT=ALL`

31 changes: 31 additions & 0 deletions create_mount_bind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

# NOTE define below envvars for specific tool and its vendor!

## example for Synopsys
INSTALLER_DIR=installer_v3.2

TOOL_NAME=syn
TOOL_VER=vL-2016.03-SP5-5
# NOTICE for first 'v' in tool version string
## end of for Synopsys

## or for Cadence
#INSTALLER_DIR=InstallScape
#
#TOOL_NAME=INCISIVE
#TOOL_VER=15
## end of for Cadence

PACKAGE_ROOT=/export/installer/


# create mount point for installer / actual tool package directory
mkdir -p package/${INSTALLER_DIR}
mkdir -p package/${TOOL_NAME}_${TOOL_VER}

# WORKAROUND use bind mount to get installer without copying files
sudo mount --bind ${PACKAGE_ROOT}/${INSTALLER_DIR} package/${INSTALLER_DIR}
sudo mount --bind ${PACKAGE_ROOT}/${TOOL_NAME}_${TOOL_VER} package/${TOOL_NAME}_${TOOL_VER}

# after creating images, be sure to unmount above directories!
11 changes: 11 additions & 0 deletions unmount_bind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

for d in $(ls package)
do
echo package/$d;
sudo umount package/$d;
rmdir package/$d;
done

rmdir package

0 comments on commit 528f2c6

Please sign in to comment.