Skip to content

Commit f472fa1

Browse files
committed
feat: restore docker image based on PIP package
1 parent 6608447 commit f472fa1

File tree

5 files changed

+160
-12
lines changed

5 files changed

+160
-12
lines changed

.github/workflows/Dockerfile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
FROM rockylinux:8 AS build
2+
RUN dnf groupinstall -y "Development Tools"
3+
RUN dnf install -y flex bison
4+
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
5+
ENV PATH="/root/.cargo/bin:${PATH}"
6+
RUN dnf install -y openssl-devel pkgconfig
7+
RUN cargo install quaigh
8+
9+
RUN dnf --enablerepo=powertools install -y gperf
10+
RUN mkdir -p /iverilog
11+
WORKDIR /iverilog_build
12+
RUN curl -L https://github.com/steveicarus/iverilog/archive/ea26587b5ef485f2ca82a3e4364e58ec3307240f.tar.gz | \
13+
tar -xzvC . --strip-components=1 && \
14+
sh autoconf.sh && \
15+
./configure --prefix=/iverilog && \
16+
make -j$(nproc) && \
17+
make install
18+
19+
RUN dnf install -y readline-devel tcl-devel libffi-devel gcc-toolset-14
20+
RUN mkdir -p /yosys
21+
WORKDIR /yosys_build
22+
ENV CC=/opt/rh/gcc-toolset-14/root/usr/bin/gcc \
23+
CPP=/opt/rh/gcc-toolset-14/root/usr/bin/cpp \
24+
CXX=/opt/rh/gcc-toolset-14/root/usr/bin/g++ \
25+
PATH=/opt/rh/gcc-toolset-14/root/usr/bin:$PATH \
26+
LD_LIBRARY_PATH=/opt/rh/gcc-toolset-14/root/usr/lib64:/opt/rh/gcc-toolset-14/root/usr/lib:/opt/rh/gcc-toolset-14/root/usr/lib64/dyninst:/opt/rh/gcc-toolset-14/root/usr/lib/dyninst:/opt/rh/gcc-toolset-14/root/usr/lib64:/opt/rh/gcc-toolset-14/root/usr/lib
27+
RUN curl -L https://github.com/YosysHQ/yosys/releases/download/v0.53/yosys.tar.gz | tar -xzC . && \
28+
make -j$(nproc) PREFIX=/yosys && \
29+
make -j$(nproc) PREFIX=/yosys install
30+
31+
# ---
32+
FROM rockylinux:8
33+
34+
RUN dnf install -v -y python38 curl openssl tcl libffi readline
35+
36+
COPY --from=build /root/.cargo/bin/quaigh /usr/bin/quaigh
37+
COPY --from=build /iverilog /iverilog
38+
COPY --from=build /yosys /yosys
39+
40+
ARG FAULT_VERSION
41+
RUN python3 -m pip install --upgrade pip &&\
42+
python3 -m pip install --upgrade "fault-dft==$FAULT_VERSION" pytest
43+
44+
WORKDIR /src
45+
RUN curl -L https://github.com/AUCOHL/Fault/archive/refs/tags/$FAULT_VERSION.tar.gz | \
46+
tar -xzvC . --strip-components 1
47+
48+
ENV FAULT_IVERILOG=/iverilog/bin/iverilog
49+
ENV FAULT_IVL_BASE=/iverilog/lib/ivl
50+
ENV PATH="/yosys/bin:/iverilog/bin:${PATH}"
51+
52+
# Sanity Checks
53+
RUN PYTEST_FAULT_BIN=fault pytest -v
54+
55+
WORKDIR /

.github/workflows/docker.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build Docker Images
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "*"
8+
9+
jobs:
10+
build_docker_images:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [
15+
{
16+
name: "Ubuntu 22.04",
17+
family: "linux",
18+
runner: "ubuntu-22.04",
19+
archs: "x86_64",
20+
},
21+
{
22+
name: "Ubuntu 22.04",
23+
family: "linux",
24+
runner: "ubuntu-22.04-arm",
25+
archs: "aarch64",
26+
}
27+
]
28+
name: Build Docker Image | ${{ matrix.os.name }} | ${{ matrix.os.archs }}
29+
runs-on: ${{ matrix.os.runner }}
30+
permissions:
31+
packages: write
32+
contents: read
33+
steps:
34+
- uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
37+
submodules: true
38+
persist-credentials: false
39+
- name: Get version
40+
run: |
41+
echo "FAULT_VERSION=$(perl -ne 'print $1 if /let VERSION = "([^"]+)"/' Sources/Fault/Entries/main.swift)" >> $GITHUB_ENV
42+
- name: Set up Docker
43+
uses: docker/setup-docker-action@v4
44+
- run: docker build -t ghcr.io/aucohl/fault:$FAULT_VERSION ./.github/workflows --build-arg "FAULT_VERSION=$FAULT_VERSION"
45+
- name: Log in to GHCR
46+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
47+
- run: docker push ghcr.io/aucohl/fault:$FAULT_VERSION
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: Nix
22
# Events that trigger workflow
33
on:
44
push:
@@ -8,11 +8,11 @@ on:
88

99
jobs:
1010
test:
11-
name: Test/Nix
12-
runs-on: macos-14
11+
name: Build and Test with Nix
12+
runs-on: macos-14 # fastest
1313
steps:
1414
- name: Check out Git repository
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616
- uses: DeterminateSystems/nix-installer-action@main
1717
with:
1818
extra-conf: |

.github/workflows/wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
- name: Check out Git repository
114114
uses: actions/checkout@v4
115115
with:
116-
fetch-depth: 0
116+
fetch-depth: 0 # grab tags
117117
- uses: actions/download-artifact@v4
118118
with:
119119
path: "."

docs/Source/installation.md

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,62 @@
22

33
In order to use Fault, you have three options:
44

5-
- Using Nix (macOS, Linux)
65
- Using the Docker Image (Windows, macOS, Linux)
6+
- Using Nix (macOS, Linux)
77
- Bring-your-own-dependencies (macOS, Linux)
88

9+
## Using the Docker Image
10+
11+
Docker is software working at the OS level that allows small environments called
12+
"containers" to be run at-will.
13+
14+
It works on Windows, macOS and Linux, where for the first two, a Linux virtual
15+
machine is used.
16+
17+
For instructions on how to install Docker, check
18+
[Docker's website](https://docs.docker.com/install/).
19+
20+
### Getting the Fault Docker image
21+
22+
After installing Docker, run the following command in your terminal of choice:
23+
24+
```sh
25+
docker pull ghcr.io/aucohl/fault:latest
26+
```
27+
28+
You can then run Fault commands using that image. For example, to run
29+
`fault --version`:
30+
31+
```sh
32+
docker run -ti --rm ghcr.io/aucohl/fault:latest fault --version
33+
```
34+
35+
This should print something like `0.9.4`.
36+
37+
If you see that, you have successfully set the Fault environment up on your
38+
machine.
39+
40+
To use the current folder inside the Docker container, you need to add these
41+
options to the command:
42+
43+
```sh
44+
-v </path/to/folder>:</path/to/folder> -w </path/to/folder>
45+
```
46+
47+
Obviously, replacing `</path/to/folder>` with your current path. For example, if
48+
your current folder is `/Users/me/Code`, your options would be
49+
`-v /Users/me/Code:/Users/me/Code -w /Users/me/Code`.
50+
51+
```{tip}
52+
You can add as many `-v`s as you want to mount multiple directories.
53+
```
54+
55+
This makes the final command:
56+
57+
```sh
58+
docker run -ti -v </path/to/folder>:</path/to/folder> -w </path/to/folder> --rm ghcr.io/aucohl/fault:latest fault --version
59+
```
60+
961
## Using Nix
1062

1163
Nix is a declarative utility that takes a unique approach to package management
@@ -18,12 +70,6 @@ Afterwards, to make the `fault` command (and the requisite `nl2bench` tool for
1870
using alternative ATPGs) available in PATH, you can simply invoke
1971
`nix profile install github:AUCOHL/Fault`.
2072

21-
## Docker
22-
23-
We no longer provide Docker images ourselves. We intend to work with
24-
[IIC-OSIC-TOOLS](https://github.com/iic-jku/IIC-OSIC-TOOLS) to make Fault
25-
available via Docker and will update this document when we do.
26-
2773
## Bring-your-own-dependencies
2874

2975
Fault requires a number of dependencies that you may elect to install manually.

0 commit comments

Comments
 (0)