Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
cc8b551
Generate FSCrawler docker images
toto1310 Sep 27, 2019
bd3b54a
Use apt command and Specify libs version
toto1310 Sep 30, 2019
07e19f1
Skip the executions for IT
toto1310 Sep 30, 2019
ce84005
Add a parameter to skip to build docker images.
toto1310 Oct 1, 2019
261b202
Add a new section about docker in getting_started
toto1310 Oct 6, 2019
b40bd93
Generate FSCrawler docker images
toto1310 Sep 27, 2019
425877e
Use apt command and Specify libs version
toto1310 Sep 30, 2019
bb64a77
Skip the executions for IT
toto1310 Sep 30, 2019
e0467cc
Add a parameter to skip to build docker images.
toto1310 Oct 1, 2019
bda976b
Add a new section about docker in getting_started
toto1310 Oct 6, 2019
694f5ef
Merge branch 'docker-2.7' of https://github.com/toto1310/fscrawler_de…
toto1310 Feb 10, 2020
9ebf3d4
Specify minor version to avoid OS version upgrade.
toto1310 Feb 11, 2020
ae6c226
Generate FSCrawler docker images
toto1310 Sep 27, 2019
0062321
Use apt command and Specify libs version
toto1310 Sep 30, 2019
c6edf10
Skip the executions for IT
toto1310 Sep 30, 2019
9252aa4
Add a parameter to skip to build docker images.
toto1310 Oct 1, 2019
fa62ba9
Add a new section about docker in getting_started
toto1310 Oct 6, 2019
42e611a
Generate FSCrawler docker images
toto1310 Sep 27, 2019
aa01afc
Use apt command and Specify libs version
toto1310 Sep 30, 2019
535f82d
Skip the executions for IT
toto1310 Sep 30, 2019
8d8c7f8
Add a parameter to skip to build docker images.
toto1310 Oct 1, 2019
f8b0493
Specify minor version to avoid OS version upgrade.
toto1310 Feb 11, 2020
047bd42
Merge branch 'docker-2.7' of https://github.com/toto1310/fscrawler in…
toto1310 Feb 11, 2020
215fdae
Merge branch 'docker-2.7' of https://github.com/toto1310/fscrawler in…
dadoonet Mar 10, 2020
af91b8a
Add documentation, fix the release process for Docker images
dadoonet Mar 10, 2020
c465b04
Add more documentation
dadoonet Mar 11, 2020
5ffab0d
Move doc from tips to installation guide
dadoonet Mar 12, 2020
955f0d1
Merge branch 'master' into toto1310-docker-2.7
dadoonet Mar 19, 2020
cbfd77d
Move docker documentation in the installation guide
dadoonet Apr 2, 2020
3c5f100
Merge branch 'master' into toto1310-docker-2.7
dadoonet Apr 11, 2020
b2c0a78
Merge pull request #1 from dadoonet/toto1310-docker-2.7
toto1310 May 22, 2020
4a388fb
Merge branch 'master' into docker-2.7
dadoonet Dec 23, 2020
29c747e
Fix typo
dadoonet Dec 23, 2020
1df150b
Let's try to use openjdk 15
dadoonet Dec 23, 2020
e501e34
Update image name
dadoonet Dec 23, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions distribution/es6/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
<artifactId>fscrawler-es6</artifactId>
<name>FSCrawler ZIP Distribution for Elasticsearch 6.x</name>

<properties>
<module.name>es6</module.name>
</properties>

<dependencies>
<dependency>
<groupId>fr.pilato.elasticsearch.crawler</groupId>
Expand All @@ -25,6 +29,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down
11 changes: 11 additions & 0 deletions distribution/es7/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
<artifactId>fscrawler-es7</artifactId>
<name>FSCrawler ZIP Distribution for Elasticsearch 7.x</name>

<properties>
<module.name>es7</module.name>

<docker.eng.tags.0>latest</docker.eng.tags.0>
<docker.eng.tags.1>${project.version}</docker.eng.tags.1>
</properties>

<dependencies>
<dependency>
<groupId>fr.pilato.elasticsearch.crawler</groupId>
Expand All @@ -25,6 +32,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down
114 changes: 114 additions & 0 deletions distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,54 @@
<module>es6</module>
</modules>

<properties>
<tesseract.version>3.04.*</tesseract.version>

<!-- Global configuration parameters for docker -->
<!-- By default, build docker images on each modules. -->
<docker.skip>${env.DOCKER_SKIP}</docker.skip>
<docker.verbose>build</docker.verbose>
<docker.username>dadoonet</docker.username>
<!-- The following assumes that each submodule will be overwritten. -->
<module.name>es7</module.name>

<!-- Docker Image Definitions -->
<!-- no install tesseract-ocr and data files for any languages -->
<docker.nolang.alias>${project.artifactId}-nolang</docker.nolang.alias>
<docker.nolang.name>${docker.username}/fscrawler:${project.version}-${module.name}-nolang</docker.nolang.name>
<docker.nolang.cacheFrom>${docker.nolang.name}</docker.nolang.cacheFrom>
<docker.nolang.dockerFile>${project.basedir}/../src/main/docker/Dockerfile</docker.nolang.dockerFile>
<docker.nolang.assembly.descriptor>${project.basedir}/../src/main/assembly/assembly.xml</docker.nolang.assembly.descriptor>
<docker.nolang.assembly.mode>tgz</docker.nolang.assembly.mode>

<!-- install tesseract-ocr and data files for English -->
<docker.eng.alias>${project.artifactId}-eng</docker.eng.alias>
<docker.eng.name>${docker.username}/fscrawler:${project.version}-${module.name}-eng</docker.eng.name>
<docker.eng.cacheFrom>${docker.eng.name}</docker.eng.cacheFrom>
<docker.eng.dockerFile>${docker.nolang.dockerFile}</docker.eng.dockerFile>
<docker.eng.assembly.descriptor>${docker.nolang.assembly.descriptor}</docker.eng.assembly.descriptor>
<docker.eng.assembly.mode>${docker.nolang.assembly.mode}</docker.eng.assembly.mode>
<docker.eng.args.langsPkg>tesseract-ocr=${tesseract.version} tesseract-ocr-eng=${tesseract.version}</docker.eng.args.langsPkg>

<!-- install tesseract-ocr and data files for French -->
<docker.fra.alias>${project.artifactId}-fra</docker.fra.alias>
<docker.fra.name>${docker.username}/fscrawler:${project.version}-${module.name}-fra</docker.fra.name>
<docker.fra.cacheFrom>${docker.fra.name}</docker.fra.cacheFrom>
<docker.fra.dockerFile>${docker.nolang.dockerFile}</docker.fra.dockerFile>
<docker.fra.assembly.descriptor>${docker.nolang.assembly.descriptor}</docker.fra.assembly.descriptor>
<docker.fra.assembly.mode>${docker.nolang.assembly.mode}</docker.fra.assembly.mode>
<docker.fra.args.langsPkg>tesseract-ocr=${tesseract.version} tesseract-ocr-fra=${tesseract.version}</docker.fra.args.langsPkg>

<!-- install tesseract-ocr and data files for Japanese -->
<docker.jpn.alias>${project.artifactId}-jpn</docker.jpn.alias>
<docker.jpn.name>${docker.username}/fscrawler:${project.version}-${module.name}-jpn</docker.jpn.name>
<docker.jpn.cacheFrom>${docker.jpn.name}</docker.jpn.cacheFrom>
<docker.jpn.dockerFile>${docker.nolang.dockerFile}</docker.jpn.dockerFile>
<docker.jpn.assembly.descriptor>${docker.nolang.assembly.descriptor}</docker.jpn.assembly.descriptor>
<docker.jpn.assembly.mode>${docker.nolang.assembly.mode}</docker.jpn.assembly.mode>
<docker.jpn.args.langsPkg>tesseract-ocr=${tesseract.version} tesseract-ocr-jpn=${tesseract.version}</docker.jpn.args.langsPkg>
</properties>

<dependencies>
<dependency>
<groupId>fr.pilato.elasticsearch.crawler</groupId>
Expand Down Expand Up @@ -109,6 +157,72 @@
</execution>
</executions>
</plugin>
<!-- Generate the docker images (run during package step) -->
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<authConfig>
<push>
<username>${docker.push.username}</username>
<password>${docker.push.password}</password>
</push>
</authConfig>
<!-- Disable configuration for IT -->
<images combine.self="override">
<image>
<external>
<type>properties</type>
<prefix>docker.nolang</prefix>
</external>
</image>
<image>
<external>
<type>properties</type>
<prefix>docker.eng</prefix>
</external>
</image>
<image>
<external>
<type>properties</type>
<prefix>docker.fra</prefix>
</external>
</image>
<image>
<external>
<type>properties</type>
<prefix>docker.jpn</prefix>
</external>
</image>
</images>
</configuration>
<executions>
<execution>
<id>docker-build</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<id>docker-push</id>
<phase>deploy</phase>
<goals>
<goal>push</goal>
</goals>
</execution>
<execution>
<!-- There is no integration test so we can skip that execution -->
<id>start-elasticsearch</id>
<phase>none</phase>
</execution>
<execution>
<!-- There is no integration test so we can skip that execution -->
<id>stop-elasticsearch</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
16 changes: 16 additions & 0 deletions distribution/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM openjdk:15.0.1

ARG langsPkg
RUN set -ex \
&& apt update \
&& apt install -y --no-install-recommends \
"gettext-base=0.19.*" \
${langsPkg} \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*

COPY maven /usr/share/fscrawler
RUN set -ex \
&& ln -sn /usr/share/fscrawler/bin/fscrawler /usr/bin/

WORKDIR /usr/share/fscrawler
21 changes: 21 additions & 0 deletions docs/source/dev/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,24 @@ If you want to skip the check, you can run with ``-Dossindex.fail=false``::

mvn clean install -Dossindex.fail=false

DockerHub publication
^^^^^^^^^^^^^^^^^^^^^

To publish the latest build to `DockerHub <https://hub.docker.com/r/dadoonet/fscrawler/>`_ you can manually
call ``docker:push`` maven task and provide credentials ``docker.push.username`` and ``docker.push.password``::

mvn -f distribution/pom.xml docker:push \
-Ddocker.push.username=yourdockerhubaccount \
-Ddocker.push.password=yourverysecuredpassword

Otherwise, if you call the maven ``deploy`` phase, it will be done automatically.
Note that it will still require that you provide the credentials ``docker.push.username`` and ``docker.push.password``::

mvn deploy \
-Ddocker.push.username=yourdockerhubaccount \
-Ddocker.push.password=yourverysecuredpassword

You can also provide the settings as environment variables:

* ``env.DOCKER_USERNAME`` or ``DOCKER_USERNAME``
* ``env.DOCKER_PASSWORD`` or ``DOCKER_PASSWORD``
3 changes: 3 additions & 0 deletions docs/source/dev/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ the tests while building the release.

Only developers with write rights to the sonatype repository under ``fr.pilato`` space
can perform the release.

Only developers with write rights to the `DockerHub repository <https://hub.docker.com/r/dadoonet/fscrawler/>`_
can push the Docker images.
144 changes: 144 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,150 @@ The distribution contains:
├── ... All needed jars


Using docker
------------

Pull the Docker image:

.. code:: sh

docker pull dadoonet/fscrawler

Let say your documents are located in ``~/tmp`` dir and you want to store your fscrawler jobs in ``~/.fscrawler``.
You can run FSCrawler with:

.. code:: sh

docker run -it --rm -v ~/.fscrawler:/root/.fscrawler -v ~/tmp:/tmp/es:ro dadoonet/fscrawler fscrawler job_name

On the first run, if the job does not exist yet in ``~/.fscrawler``, FSCrawler will ask you if you want to create it:

::

10:16:53,880 INFO [f.p.e.c.f.c.BootstrapChecks] Memory [Free/Total=Percent]: HEAP [67.3mb/876.5mb=7.69%], RAM [2.1gb/3.8gb=55.43%], Swap [1023.9mb/1023.9mb=100.0%].
10:16:53,899 WARN [f.p.e.c.f.c.FsCrawlerCli] job [job_name] does not exist
10:16:53,900 INFO [f.p.e.c.f.c.FsCrawlerCli] Do you want to create it (Y/N)?
y
10:16:56,745 INFO [f.p.e.c.f.c.FsCrawlerCli] Settings have been created in [/root/.fscrawler/job_name/_settings.yaml]. Please review and edit before relaunch

.. note::

The configuration file is actually stored on your machine in ``~/.fscrawler/job_name/_settings.yaml``.
Remember to change the URL of your elasticsearch instance as the container won't be able to see it
running under the default ``127.0.0.1``. You will need to use the actual IP address of the host.


Using docker compose
--------------------

In this section, the following directory layout is assumed:

.. code-block:: none

.
├── config
│ └── job
│ └── _settings.yaml
├── data
│ └── <your files>
└── docker-compose.yml

For example, to connect to a docker container named ``elasticsearch``, modify your ``_settings.yaml``.

.. code:: yaml

name: "test"
elasticsearch:
nodes:
- url: "http://elasticsearch:9200"

And, prepare the following ``docker-compose.yml``.

.. code:: yaml

version: '2.2'
services:
# FSCrawler
fscrawler:
image: dadoonet/fscrawler
container_name: fscrawler
volumes:
- ${PWD}/config:/root/.fscrawler
- ${PWD}/data:/tmp/es
networks:
- esnet
command: fscrawler job_name

# Elasticsearch Cluster
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.3.2
container_name: elasticsearch
environment:
- node.name=elasticsearch
- discovery.seed_hosts=elasticsearch2
- cluster.initial_master_nodes=elasticsearch,elasticsearch2
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- esdata01:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- esnet
elasticsearch2:
image: docker.elastic.co/elasticsearch/elasticsearch:7.3.2
container_name: elasticsearch2
environment:
- node.name=elasticsearch2
- discovery.seed_hosts=elasticsearch
- cluster.initial_master_nodes=elasticsearch,elasticsearch2
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- esdata02:/usr/share/elasticsearch/data
networks:
- esnet

volumes:
esdata01:
driver: local
esdata02:
driver: local

networks:
esnet:

Then, you can run Elasticsearch.

.. code:: sh

docker-compose up -d elasticsearch
docker-compose logs -f elasticsearch

Wait for elasticsearch to be started:

::



After starting Elasticsearch, you can run FSCrawler.

.. code:: sh

docker-compose up fscrawler



Running as a Service on Windows
-------------------------------

Expand Down
1 change: 1 addition & 0 deletions docs/source/user/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,4 @@ If you would like to ignore some folders to be scanned, just add a ``.fscrawleri
The folder content and all sub folders will be ignored.

For more information, read :ref:`includes_excludes`.

6 changes: 0 additions & 6 deletions docs/source/user/tips.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ machine <https://wiki.apache.org/hadoop/MountableHDFS>`__ and run FS
crawler on this mount point. You can also read details about `HDFS NFS
Gateway <http://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsNfsGateway.html>`__.

Using docker
------------

To use FSCrawler with `docker <https://www.docker.com/>`__, check
`docker-fscrawler <https://github.com/shadiakiki1986/docker-fscrawler>`__
recipe.

Using docker-compose
--------------------
Expand Down
Loading