Skip to content

Commit

Permalink
Better install script, consistently used in the Dockerfile and in the…
Browse files Browse the repository at this point in the history
… travis-ci configuration
  • Loading branch information
fchauvel committed Mar 29, 2019
1 parent ce754b6 commit feef399
Show file tree
Hide file tree
Showing 5 changed files with 267 additions and 141 deletions.
29 changes: 29 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Project specific
modules

# Jekyll
**/_site
**/Gemfile.lock

# Github files
**/.git
**/.github
.gitignore

# Python files
**/.py*
**/*.pyc
**/*.egg-info
.coverage

# Travis-ci
.travis.yml

# Emacs
**/*~
**/\#*
**/.\#*

# Other
**/.DS_Store
**/*.log
13 changes: 4 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,13 @@ services:
- docker

before_install:
- sudo apt-get update
- sudo apt-get install -y libstdc++6
- sudo apt-get install -y libgomp1

- pip install codecov coverage

install:
# Install the Z3 solver
# Install CAMP and its dependencies
- python -c 'import sys; print(sys.path)'
- bash install.sh --only-z3 --python-library /opt/python/2.7.15/lib/python2.7
- sudo bash install.sh --camp-from-sources --camp-with-tests --install-z3 --z3-python-bindings /opt/python/2.7.15/lib/python2.7

# Install CAMP and its dependencies
- pip install codecov coverage
- pip install .[test]

script:
- green -qrf -vv tests
Expand Down
45 changes: 14 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,21 @@
FROM debian:8.11-slim
#
# CAMP
#
# Copyright (C) 2017 -- 2019 SINTEF Digital
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
#

LABEL maintainer "[email protected]"

RUN apt-get update && \
apt-get install -y --no-install-recommends \
libgomp1=4.9.2-10+deb8u2 \
python2.7-dev=2.7.9-2+deb8u2 \
python-pip=1.5.6-5 \
wget=1.16-1+deb8u5 \
unzip=6.0-16+deb8u3 \
git=1:2.1.4-2.1+deb8u7 \
&& \
apt-get install -y --no-install-recommends --reinstall \
python-pkg-resources=5.5.1-1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
FROM debian:9-slim

WORKDIR /root
RUN wget -q https://github.com/Z3Prover/z3/releases/download/z3-4.7.1/z3-4.7.1-x64-debian-8.10.zip && \
unzip z3-4.7.1-x64-debian-8.10.zip && \
mv z3-4.7.1-x64-debian-8.10 unzipped && \
mkdir -p /usr/lib/python2.7/z3/lib && \
cp unzipped/bin/z3 /usr/lib/python2.7/z3/lib/ && \
cp unzipped/bin/lib* /usr/lib/python2.7/z3/lib/ && \
cp -rf unzipped/bin/python/z3 /usr/lib/python2.7/ && \
ln -s /usr/lib/python2.7/z3/lib/z3 /usr/bin/z3 && \
rm -rf unzipped
LABEL maintainer "[email protected]"

RUN env && python -c 'import z3; print(z3.get_version_string())'

WORKDIR /camp
COPY . /camp

RUN easy_install -U pip
RUN pip install -U setuptools
RUN pip --version
RUN pip install .
# Install Z3
RUN bash install.sh --install-z3 --install-docker --camp-from-sources

33 changes: 21 additions & 12 deletions docs/pages/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ execute as follows:

```bash
$ \curl -L https://github.com/STAMP-project/camp/raw/master/install.sh \
| sudo bash -s -- --python-library /usr/lib/python2.7
| sudo bash -s -- --install-z3 --z3-python-bindings /usr/lib/python2.7
```

This script installs both the Z3 solver and CAMP. It accepts the
Expand All @@ -36,17 +36,26 @@ following arguuments:
```console
Usage: sh install.sh [options...]
Options:
-c, --camp-version STRING Select a specific version of CAMP from Github.
Can be a branch name (e.g., 'master'), a tag, or
a commit hash. Default is 'master'.
-l, --z3-platform STRING Install Z3 for a specific version of linux.
Default is 'x64-debian-8.10'.
-o, --only-z3 Does not install CAMP, but only the Z3 solver.
Default is 'false'.
-p, --python-library DIR Set the installation directory for the Z3 Python
bindings. Default is '/usr/lib/python2.7'.
-z, --z3-version STRING Set the version of the Z3 solver to install.
Default is 4.7.1.
-c, --camp-version STRING Select a specific version of CAMP from Github.
Can be a branch name (e.g., 'master'), a tag, or
a commit hash. Default is 'master'.
-d, --install-docker Install Docker.io (CE version). By default,
Docker will not be installed.
-l, --z3-platform STRING Install Z3 for a specific version of linux.
Default is 'x64-debian-8.10'.
-g, --debug Debugging mode: display all commands and log
output in a file. Disabled by default.
-i, --install-z3 Install Z3 if not already available. By default,
Z3 will notbe installed.
-p, --z3-python-bindings DIR Set the installation directory for the Z3 Python
bindings. Default is '/usr/lib/python2.7'.
-s, --camp-from-sources Install CAMP for sources expected to be in
the working directory. By default, CAMP is
downloaded from Github.
-t, --camp-with-tests Install CAMP with its test dependencies. By
default, these are not installed.
-z, --z3-version STRING Set the version of the Z3 solver to install.
Default is '4.7.1'.
```

Here, we specified where the Z3 Python bindings must be installed.
Expand Down
Loading

0 comments on commit feef399

Please sign in to comment.