Skip to content

Commit 6e1b833

Browse files
committed
Improve infrastructure (docker, requirements, coverage, gitignore)
1 parent b04d4aa commit 6e1b833

6 files changed

+258
-11
lines changed

.dockerignore

+153
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# Tests output
2+
test/pocr_data/**/actual_*
3+
4+
# Temp pytest-cov config
5+
.temp_coveragerc
6+
7+
# Temp RAM usage file
8+
temp_ram_usage.txt
9+
10+
# Local files
11+
.playground
12+
13+
# Byte-compiled / optimized / DLL files
14+
__pycache__/
15+
*.py[cod]
16+
*$py.class
17+
18+
# C extensions
19+
*.so
20+
21+
# Distribution / packaging
22+
.Python
23+
build/
24+
develop-eggs/
25+
dist/
26+
downloads/
27+
eggs/
28+
.eggs/
29+
lib/
30+
lib64/
31+
parts/
32+
sdist/
33+
var/
34+
wheels/
35+
share/python-wheels/
36+
*.egg-info/
37+
.installed.cfg
38+
*.egg
39+
MANIFEST
40+
41+
# PyInstaller
42+
# Usually these files are written by a python script from a template
43+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
44+
*.manifest
45+
*.spec
46+
47+
# Installer logs
48+
pip-log.txt
49+
pip-delete-this-directory.txt
50+
51+
# Unit test / coverage reports
52+
htmlcov/
53+
.tox/
54+
.nox/
55+
.coverage
56+
.coverage.*
57+
.cache
58+
nosetests.xml
59+
coverage.xml
60+
*.cover
61+
*.py,cover
62+
.hypothesis/
63+
.pytest_cache/
64+
cover/
65+
66+
# Translations
67+
*.mo
68+
*.pot
69+
70+
# Django stuff:
71+
*.log
72+
local_settings.py
73+
db.sqlite3
74+
db.sqlite3-journal
75+
76+
# Flask stuff:
77+
instance/
78+
.webassets-cache
79+
80+
# Scrapy stuff:
81+
.scrapy
82+
83+
# Sphinx documentation
84+
docs/_build/
85+
86+
# PyBuilder
87+
.pybuilder/
88+
target/
89+
90+
# Jupyter Notebook
91+
.ipynb_checkpoints
92+
93+
# IPython
94+
profile_default/
95+
ipython_config.py
96+
97+
# pyenv
98+
# For a library or package, you might want to ignore these files since the code is
99+
# intended to run in multiple environments; otherwise, check them in:
100+
# .python-version
101+
102+
# pipenv
103+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
104+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
105+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
106+
# install all needed dependencies.
107+
#Pipfile.lock
108+
109+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
110+
__pypackages__/
111+
112+
# Celery stuff
113+
celerybeat-schedule
114+
celerybeat.pid
115+
116+
# SageMath parsed files
117+
*.sage.py
118+
119+
# Environments
120+
.env
121+
.venv
122+
env/
123+
venv/
124+
ENV/
125+
env.bak/
126+
venv.bak/
127+
128+
# Spyder project settings
129+
.spyderproject
130+
.spyproject
131+
132+
# Rope project settings
133+
.ropeproject
134+
135+
# mkdocs documentation
136+
/site
137+
138+
# mypy
139+
.mypy_cache/
140+
.dmypy.json
141+
dmypy.json
142+
143+
# Pyre type checker
144+
.pyre/
145+
146+
# pytype static type analyzer
147+
.pytype/
148+
149+
# Cython debug symbols
150+
cython_debug/
151+
152+
#IDE
153+
.idea/

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ test/pocr_data/**/actual_*
44
# Temp pytest-cov config
55
.temp_coveragerc
66

7+
# Temp RAM usage file
8+
temp_ram_usage.txt
9+
10+
# Local files
11+
.playground/**
12+
data
13+
714
# Byte-compiled / optimized / DLL files
815
__pycache__/
916
*.py[cod]

Dockerfile

+18-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1-
FROM graphblas/pygraphblas-minimal:v4.2.2
1+
FROM python:3.9-slim as builder
22

3-
ADD . /CFPQ_PyAlgo
3+
# Avoid prompts from apt
4+
ENV DEBIAN_FRONTEND=noninteractive
45

5-
WORKDIR /CFPQ_PyAlgo
6-
RUN git submodule init
7-
RUN git submodule update
6+
WORKDIR /app
87

9-
WORKDIR /CFPQ_PyAlgo/deps/CFPQ_Data
10-
RUN python3 setup.py install
8+
COPY requirements.txt /app/
9+
COPY deps/CFPQ_Data /app/deps/CFPQ_Data
1110

12-
WORKDIR /CFPQ_PyAlgo
11+
RUN pip3 install pygraphblas==5.1.8.0
1312
RUN pip3 install -r requirements.txt
13+
RUN cd deps/CFPQ_Data && python3 setup.py install
14+
15+
FROM python:3.9-slim
16+
17+
RUN apt update
18+
RUN apt install time
19+
20+
COPY --from=builder /usr/local /usr/local
21+
22+
WORKDIR /app
23+
COPY . /app

Dockerfile-all-tools

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Download base image here: https://figshare.com/ndownloader/files/42214812
2+
FROM pearl-ase23:v1
3+
ENV PEARL_DIR=/root/eval
4+
5+
# Common utilities
6+
RUN apt-get update && apt-get install -y git sed time bsdmainutils vim
7+
8+
# POCR dependencies
9+
RUN apt-get update && apt-get install -y \
10+
cmake \
11+
gcc \
12+
g++ \
13+
libtinfo-dev \
14+
libz-dev \
15+
zip \
16+
wget \
17+
npm
18+
19+
# Gigascale dependencies
20+
RUN apt-get update && apt-get install -y openjdk-17-jdk ant python2
21+
22+
# Graspan dependencies
23+
RUN apt-get update && apt-get install -y \
24+
build-essential \
25+
wget \
26+
make \
27+
g++ \
28+
libboost-all-dev \
29+
git
30+
RUN wget -qO- https://sourceforge.net/projects/boost/files/boost/1.62.0/boost_1_62_0.tar.gz | tar xvz -C /usr/local
31+
ENV BOOST_ROOT=/usr/local/boost_1_62_0
32+
ENV LD_LIBRARY_PATH=$BOOST_ROOT/stage/lib:$LD_LIBRARY_PATH
33+
34+
## POCR dependency, that needs to be built from sources
35+
RUN git clone https://github.com/kisslune/SVF.git /SVF \
36+
&& cd /SVF \
37+
&& /bin/bash -c "source ./build.sh" \
38+
&& echo 'pushd /SVF > /dev/null && source setup.sh && popd > /dev/null' >> /root/.bashrc
39+
ENV SVF_DIR=/SVF
40+
41+
# POCR (general-purpose CFL-r tool)
42+
RUN git clone https://github.com/kisslune/POCR.git /POCR \
43+
&& cd /POCR \
44+
&& /bin/bash -c "source ./../SVF/setup.sh && source ./build.sh" \
45+
&& echo 'pushd /POCR > /dev/null && source setup.sh && popd > /dev/null' >> /root/.bashrc
46+
ENV POCR_DIR=/POCR
47+
48+
# Gigascale (specialized CFL-r tools)
49+
RUN git clone https://bitbucket.org/jensdietrich/gigascale-pointsto-oopsla2015.git /gigascale
50+
RUN sed -i 's/python /python2 /g' /gigascale/run.sh
51+
RUN sed -i 's/-d64 //g' /gigascale/run.sh
52+
ENV JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
53+
ENV GIGASCALE_DIR=/gigascale
54+
55+
# Graspan (general-purpose CFL-r tool)
56+
RUN git clone https://github.com/Graspan/Graspan-C.git /graspan
57+
RUN sed -i 's|/home/aftab/Downloads/boost_1_62_installed|'$BOOST_ROOT'|g' /graspan/src/makefile
58+
RUN sed -i 's|/home/aftab/Downloads/boost_1_62_installed|'$BOOST_ROOT'|g' /graspan/src/run
59+
RUN cd /graspan/src && make
60+
ENV GRASPAN_DIR=/graspan
61+
62+
# CFPQ_PyAlgo dependencies
63+
RUN apt-get update && apt-get install -y \
64+
software-properties-common \
65+
&& add-apt-repository ppa:deadsnakes/ppa \
66+
&& apt-get update \
67+
&& apt-get install -y python3.9 python3.9-distutils python3.9-dev python3-pip
68+
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
69+
RUN python3 -m pip install --upgrade pip
70+
71+
# CFPQ_PyAlgo (this tool)
72+
COPY requirements.txt /py_algo/requirements.txt
73+
COPY deps/CFPQ_Data /py_algo/deps/CFPQ_Data
74+
RUN pip3 install pygraphblas==5.1.8.0
75+
RUN cd /py_algo && pip3 install -r requirements.txt
76+
RUN cd /py_algo/deps/CFPQ_Data && python3 setup.py install
77+
COPY . /py_algo

collect_diff_coverage.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ echo "Collecting coverage for files modified after commit:"
1616
git --no-pager log -n 1 $MERGE_BASE_COMMIT
1717

1818
echo
19-
MODIFIED_FILES=$(git diff --name-only $MERGE_BASE_COMMIT | grep '.py$' | grep -v '^test')
19+
MODIFIED_FILES=$(git diff --name-only $MERGE_BASE_COMMIT | grep '.py$' | grep '^src')
2020
echo "Changed Python files:"
2121
echo $MODIFIED_FILES
2222

requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
tqdm
2-
pytest
1+
tqdm==4.62.2
2+
pytest==8.0.1
33
pytest-benchmark
44
pytest-cov
55
cfpq_data==1.0.2

0 commit comments

Comments
 (0)