-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
107 lines (91 loc) · 3.64 KB
/
Dockerfile
File metadata and controls
107 lines (91 loc) · 3.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#! to execute:
# install docker buildx if not installed
# docker buildx build --target final --output type=local,dest=./output .
FROM ubuntu:22.04 AS builder
# Install essential packages
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
openjdk-11-jdk \
python3 \
vim \
python3-pip \
git \
wget \
unzip \
maven \
cmake \
build-essential \
libgl1-mesa-glx \
libgl1-mesa-dri \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Set JAVA_HOME
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
ENV PATH=$JAVA_HOME/bin:$PATH
# Install pipenv globally
RUN pip3 install --upgrade pip && pip3 install pipenv mako types-requests types-python-dateutil
# Install GraphicsFuzzs
WORKDIR /opt
RUN git clone https://github.com/ArberSephirotheca/graphicsfuzz.git && \
cd graphicsfuzz && \
git submodule update --init && \
mvn package -e -DskipTests=true
# COPY . /opt/graphicsfuzz
# RUN cd graphicsfuzz && \
# git submodule update --init && \
# mvn package -e -DskipTests=true
# WORKDIR /opt
# COPY ./glslang /opt/glslang
# RUN cd glslang && \
# ./update_glslang_sources.py && \
# mkdir -p build && \
# cd build && \
# cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$(pwd)/install" .. && \
# make -j4 install
# RUN cp /opt/glslang/build/install/bin/* /opt/graphicsfuzz/graphicsfuzz/target/graphicsfuzz/bin/Linux
ENV PATH="/opt/graphicsfuzz/graphicsfuzz/target/graphicsfuzz/bin/Linux:${PATH}"
ENV PATH="/opt/graphicsfuzz/graphicsfuzz/target/graphicsfuzz/python/drivers:${PATH}"
ARG HOST_UID
ARG HOST_GID
FROM builder AS generate
WORKDIR /opt/graphicsfuzz/temp
COPY references /opt/graphicsfuzz/temp/references
COPY donors /opt/graphicsfuzz/temp/donors
RUN groupadd -g ${HOST_GID} hostgroup \
&& useradd -u ${HOST_UID} -g hostgroup host \
&& chown -R host:hostgroup /opt/graphicsfuzz/temp
USER host
ENTRYPOINT ["glsl-generate"]
CMD ["--seed","42","--vulkan","./references","./donors","10000","syn","/opt/graphicsfuzz/temp/output"]
ARG HOST_UID
ARG HOST_GID
FROM builder AS generate-core
WORKDIR /opt/graphicsfuzz/temp
COPY references_core /opt/graphicsfuzz/temp/references
COPY donors /opt/graphicsfuzz/temp/donors
RUN groupadd -g ${HOST_GID} hostgroup \
&& useradd -u ${HOST_UID} -g hostgroup host \
&& chown -R host:hostgroup /opt/graphicsfuzz/temp
USER host
ENTRYPOINT ["glsl-generate"]
CMD ["--seed","42","--vulkan","./references","./donors","10000","syn","/opt/graphicsfuzz/temp/output"]
FROM builder AS reduce
WORKDIR /opt
COPY failed_variants/ /opt/reduce/
COPY failed_variants/ /opt/reduce/
COPY test_amber/run_glsl_reduce.py /opt/run_glsl_reduce.py
RUN cp -r /opt/graphicsfuzz/graphicsfuzz/src/main/scripts/examples/glsl-reduce-walkthrough /opt/reduce/examples
ENV PATH="/opt/reduce:${PATH}"
RUN python3 run_glsl_reduce.py
# RUN glsl-reduce /opt/reduce/reduce.json interestingness_test --output reduction_results
FROM builder AS reduce-single
WORKDIR /opt
COPY all_tests/syn_lock_step_release/variant_005.comp /opt/reduce/reduce.comp
COPY all_tests/syn_lock_step_release/variant_005.json /opt/reduce/reduce.json
ENV PATH="/opt/reduce:${PATH}"
RUN mkdir -p /opt/reduction_results
RUN cp -r /opt/graphicsfuzz/graphicsfuzz/src/main/scripts/examples/glsl-reduce-walkthrough /opt/reduce/examples
RUN glsl-reduce /opt/reduce/reduce.json /opt/reduce/examples/interestingness_test.py --preserve-semantics --output reduction_results > /opt/reduction_results/redreduction.log 2>&1
FROM scratch AS reduce-final
COPY --from=reduce /opt/reduction_results reduction_results
FROM scratch AS reduce-final-single
COPY --from=reduce-single /opt/reduction_results reduction_results_single