GitHub user nickwallen opened a pull request:
https://github.com/apache/metron/pull/868
METRON-1351 Create Installable Packages for Ubuntu Trusty
### Changes
This PR allows us to create DEB packages to simplify the installation of
Metron on a DEB-based platform like Ubuntu. I tried to follow as closely as
possible the current mechanism that we use for building RPM packages.
I added an additional profile `build-debs` that allows us to build the DEBs.
```
mvn clean package -Pbuild-debs
```
There is also a fairly complete README.md that explains how the process
works.
### Testing
1. Build the DEBs.
```
make clean package -DskipTests
cd metron-deployment
mvn clean package -Pbuild-debs -Pbuild-rpms
```
1. Take a look at the DEBs that were built.
```
$ find ./ -name "*.deb"
.//packaging/docker/deb-docker/target/metron-management_0.4.2.deb
.//packaging/docker/deb-docker/target/metron-alerts_0.4.2.deb
.//packaging/docker/deb-docker/target/metron-rest_0.4.2.deb
.//packaging/docker/deb-docker/target/metron-maas-service_0.4.2.deb
.//packaging/docker/deb-docker/target/metron-common_0.4.2.deb
.//packaging/docker/deb-docker/target/metron-enrichment_0.4.2.deb
.//packaging/docker/deb-docker/target/metron-data-management_0.4.2.deb
.//packaging/docker/deb-docker/target/metron-parsers_0.4.2.deb
.//packaging/docker/deb-docker/target/metron-profiler_0.4.2.deb
.//packaging/docker/deb-docker/target/metron-config_0.4.2.deb
.//packaging/docker/deb-docker/target/metron-elasticsearch_0.4.2.deb
.//packaging/docker/deb-docker/target/metron-solr_0.4.2.deb
.//packaging/docker/deb-docker/target/metron-indexing_0.4.2.deb
.//packaging/docker/deb-docker/target/metron-pcap-backend_0.4.2.deb
```
1. Install the DEBs.
```
cd packaging/docker/deb-docker
docker build -t deb-docker .
docker run -it -v `pwd`:/root deb-docker:latest /bin/bash
dpkg -i target/*.deb
```
1. Capture the contents of what is installed by all of the DEBs. Capture
the output of running `tree` so that you can compare it to what the RPMs
install.
I have attached the output of what I get when doing this to this PR;
[ubuntu.txt](https://github.com/apache/metron/files/1560505/ubuntu.txt).
```
apt-get install tree
tree /usr/metron/0.4.2
```
```
root@4307d666c904:~# tree /usr/metron/0.4.2/
/usr/metron/0.4.2/
|-- bin
| |-- Whois_CSV_to_JSON.py
| |-- flatfile_loader.sh
| |-- geo_enrichment_load.sh
| |-- latency_summarizer.sh
| |-- maas_deploy.sh
| |-- maas_service.sh
| |-- metron-alerts-ui
| |-- metron-management-ui
| |-- metron-rest.sh
| |-- pcap_inspector.sh
| |-- pcap_query.sh
| |-- pcap_zeppelin_run.sh
| |-- prune_elasticsearch_indices.sh
| |-- prune_hdfs_files.sh
| |-- start_elasticsearch_topology.sh
| |-- start_enrichment_topology.sh
| |-- start_parser_topology.sh
| |-- start_pcap_topology.sh
| |-- start_profiler_topology.sh
| |-- start_solr_topology.sh
| |-- stellar
| |-- threatintel_bulk_prune.sh
| |-- threatintel_taxii_load.sh
| `-- zk_load_configs.sh
|-- config
| |-- elasticsearch.properties
| |-- enrichment.properties
...
221 directories, 1962 files
```
1. Take a look at the RPMs that were built previously.
```
cd ../rpm-docker
$ find ./ -name "*.rpm"
.//RPMS/noarch/metron-profiler-0.4.2-201712141550.noarch.rpm
.//RPMS/noarch/metron-maas-service-0.4.2-201712141550.noarch.rpm
.//RPMS/noarch/metron-rest-0.4.2-201712141550.noarch.rpm
.//RPMS/noarch/metron-config-0.4.2-201712141550.noarch.rpm
.//RPMS/noarch/metron-enrichment-0.4.2-201712141550.noarch.rpm
.//RPMS/noarch/metron-pcap-0.4.2-201712141550.noarch.rpm
.//RPMS/noarch/metron-elasticsearch-0.4.2-201712141550.noarch.rpm
.//RPMS/noarch/metron-indexing-0.4.2-201712141550.noarch.rpm
.//RPMS/noarch/metron-data-management-0.4.2-201712141550.noarch.rpm
.//RPMS/noarch/metron-common-0.4.2-201712141550.noarch.rpm
.//RPMS/noarch/metron-metron-management-0.4.2-201712141550.noarch.rpm
.//RPMS/noarch/metron-alerts-0.4.2-201712141550.noarch.rpm
.//RPMS/noarch/metron-solr-0.4.2-201712141550.noarch.rpm
.//RPMS/noarch/metron-parsers-0.4.2-201712141550.noarch.rpm
.//SRPMS/metron-0.4.2-201712141550.src.rpm
```
1. Install the RPMs.
```
docker build -t rpm-docker .
docker run -it -v `pwd`:/root rpm-docker:latest /bin/bash
rpm -ivh RPMS/noarch/metron-*.rpm
```
1. Capture the contents of what is installed by all of the RPMs. Capture
the output of running `tree`. I have attached the output of what I get when
doing this.
```
yum install tree -y
tree /usr/metron/0.4.2
```
I have attached the output of what I get when doing this to this PR;
[centos.txt](https://github.com/apache/metron/files/1560504/centos.txt)).
1. Now I compare the two. In my testing, I have found that there is one
extra directory on the Ubuntu/DEB side of the house;
`/usr/metron/0.4.2/web/expressjs/etc`. This is just an empty directory that I
believe gets stripped out when the RPMs are packaged.
```
$ diff debs.txt rpms.txt
1c1
< /usr/metron/0.4.2/
---
> /usr/metron/0.4.2
140d139
< | |-- etc
2186c2185
< 221 directories, 1962 files
---
> 220 directories, 1962 files
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/nickwallen/metron METRON-1351
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/metron/pull/868.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #868
----
commit 778cff2050769f89556182ad2eb2ed50bc9146c8
Author: Nick Allen <[email protected]>
Date: 2017-12-13T23:27:59Z
METRON-1351 Create Installable Packages for Ubuntu Trusty
----
---