Skip to content

Commit 004d251

Browse files
authored
Merge pull request #84 from ldbc/build-docker-in-travis
Build Docker image on Travis #83
2 parents f722dbb + f598777 commit 004d251

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

.travis.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@ jdk:
33
- openjdk8
44
python:
55
- '2.7'
6+
env:
7+
global:
8+
- GH_REF=github.com/ldbc/ldbc_snb_datagen.git
9+
- secure: UG0OiJIFnm9mlQvV62cRwZzRFclw1Tu1QTFTUvEVcyskFV7fvIZjVZ1ozvIs8arfVulHXnijWYOr4X76HqB4bEMCpuk47nTk6zA+8omC+IVML1C8Mq0yT7L0k9iCShPOylAtvTqUMtrgewYXINqsQQxunqwWsIoeIdFh3wC+Km+0k2/NlxGlsCj4ajP1reGcYxj9b51mjskAC4EueJn0mgd7uFS3C92hJEaFovKUykpnVx9Vx54ssm2QkTtijdGiEUtps8b93dQQ0wQ/KShTQ6HiHr60Z0pt5PGThVT7EeO9RSHEJjIGhK+UKEf6ab0yxWjQxoIGjXEE19orVA+hLiHq9nnAQK293Y6+J6Qc6s+HI2PTrymI3kQGi3KcTN/K9ukW2wfulxX4R/nTFAtWJK4MMmMBahC+t2dSeKDKbq0yzFfFaSgFPLfDcfe/aQ/YBWFDhbvAqWmguMTcwreNeZMvMNLDdRCY3uXMOjqVEhxbJItbyhXCYTnPgdDDKcaJO2GaOadSzZdomwFhqpKjOca9ynVes1NX1Q+jv9E1862l9D8gkWGiMekMW2IhaVZTQvp1V77TCJ+az4jJVmTPdMAjiQvyisKFzC39xYUix11fYuZOTKQjPB1r4CUwVTTS649n6VwGukE0OdnzEFqbMHql6iV4ODQlHEO+syNbAOM=
10+
services:
11+
- docker
12+
before_install:
13+
- docker build . --tag ldbc/datagen
614
install: true
715
script:
8-
- mvn test | grep "^\\[" | tee mvn.log
9-
# test if the output of the mvn command contained an "[INFO] BUILD SUCCESS" entry
10-
- grep 'BUILD SUCCESS' mvn.log
11-
# generate SF1 data set
12-
- wget -q http://archive.apache.org/dist/hadoop/core/hadoop-2.6.0/hadoop-2.6.0.tar.gz
13-
- tar xf hadoop-2.6.0.tar.gz
14-
- export HADOOP_CLIENT_OPTS="-Xmx2G"
15-
- export HADOOP_HOME=`pwd`/hadoop-2.6.0
16-
- export LDBC_SNB_DATAGEN_HOME=`pwd`
17-
- ./run.sh
16+
- docker run --rm --mount type=bind,source="$(pwd)/",target="/opt/ldbc_snb_datagen/out" --mount type=bind,source="$(pwd)/params.ini",target="/opt/ldbc_snb_datagen/params.ini" ldbc/datagen
1817
- mkdir out
1918
- cp -r substitution_parameters out/
2019
notifications:

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
FROM openjdk:8-jdk-alpine
1+
FROM openjdk:8-jdk-stretch
22

33
# Download hadoop
44
WORKDIR /opt
5-
RUN apk add bash curl maven python
5+
RUN apt-get update
6+
RUN apt-get install -y bash curl maven python
67
RUN curl -L 'http://archive.apache.org/dist/hadoop/core/hadoop-2.6.0/hadoop-2.6.0.tar.gz' | tar -xz
8+
RUN curl -L 'https://julialang-s3.julialang.org/bin/linux/x64/1.2/julia-1.2.0-linux-x86_64.tar.gz' | tar -xz
79

810
# Copy the project
911
COPY . /opt/ldbc_snb_datagen
@@ -14,4 +16,5 @@ RUN rm params*.ini
1416
RUN mvn -DskipTests clean assembly:assembly
1517

1618
ENV HADOOP_CLIENT_OPTS '-Xmx8G'
19+
ENV PATH "/opt/julia-1.2.0/bin:${PATH}"
1720
CMD /opt/ldbc_snb_datagen/docker_run.sh

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ To configure the amount of memory available, set the `HADOOP_CLIENT_OPTS` variab
5757

5858
In order to run the container, a `params.ini` file is required. For reference, please see the `params*.ini` files in the repository. The file will be mounted in the container by the `--mount type=bind,source="$(pwd)/params.ini,target="/opt/ldbc_snb_datagen/params.ini"` option. If required, the source path can be set to a different path.
5959

60-
The container outputs its results in the `/opt/ldbc_snb_datagen/out/` directory which contains two sub-directories, `social_network/` and `subsitution_parameters`. In order to save the results of the generation, a directory must be mounted in the container from the host. The driver requires the results be in the datagen repository directory.
60+
The container outputs its results in the `/opt/ldbc_snb_datagen/out/` directory which contains two sub-directories, `social_network/` and `subsitution_parameters`. In order to save the results of the generation, a directory must be mounted in the container from the host. The driver requires the results be in the datagen repository directory. To generate the data, run the following command which includes changing the owner (`chown`) of the Docker-mounted volumes:
6161

6262
```bash
63-
docker run --rm --mount type=bind,source="$(pwd)/",target="/opt/ldbc_snb_datagen/out" --mount type=bind,source="$(pwd)/params.ini",target="/opt/ldbc_snb_datagen/params.ini" ldbc/datagen
63+
docker run --rm --mount type=bind,source="$(pwd)/",target="/opt/ldbc_snb_datagen/out" --mount type=bind,source="$(pwd)/params.ini",target="/opt/ldbc_snb_datagen/params.ini" ldbc/datagen && \
64+
sudo chown -R $USER:$USER social_network/ substitution_parameters/
6465
```
6566

6667
If you need to raise the memory limit, use the `-e HADOOP_CLIENT_OPTS="-Xmx..."` parameter to override the default value (`-Xmx8G`).

0 commit comments

Comments
 (0)