File tree 8 files changed +76
-6
lines changed
8 files changed +76
-6
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ python:
16
16
# - "nightly" # currently points to 3.7-dev
17
17
# command to install dependencies
18
18
install :
19
- - pip install .
19
+ - pip install --upgrade pip
20
+ - pip install --no-cache-dir .
20
21
# - pip install -r requirements.txt
21
22
# command to run tests
22
23
before_script :
Original file line number Diff line number Diff line change
1
+ FROM python:3.6-slim-buster
2
+
3
+ RUN apt-get update \
4
+ && apt-get -y install python-skimage git
5
+
6
+ WORKDIR /app
7
+
8
+ RUN pip install --no-cache-dir numpy
9
+ COPY requirements.txt ./
10
+ RUN pip install --no-cache-dir -r requirements.txt
11
+ COPY . .
12
+
13
+ RUN pip install --no-cache-dir .
14
+
15
+ CMD [ "py-image-dedup" , "daemon" ]
Original file line number Diff line number Diff line change
1
+ version : ' 3.7'
2
+
3
+ services :
4
+ elasticsearch :
5
+ image : docker.elastic.co/elasticsearch/elasticsearch:7.3.2
6
+ ports :
7
+ - " 9200:9200"
8
+ - " 9300:9300"
9
+ environment :
10
+ - discovery.type=single-node
11
+ networks :
12
+ - docker-elk
13
+ restart : on-failure
14
+ py-image-dedup :
15
+ build : .
16
+ environment :
17
+ # change configuration to your liking
18
+ - PY_IMAGE_DEDUP_DRY_RUN=False
19
+ - PY_IMAGE_DEDUP_ANALYSIS_SOURCE_DIRECTORIES=/mnt/source/
20
+ - PY_IMAGE_DEDUP_ANALYSIS_RECURSIVE=True
21
+ - PY_IMAGE_DEDUP_ANALYSIS_ACROSS_DIRS=True
22
+ - PY_IMAGE_DEDUP_ANALYSIS_FILE_EXTENSIONS=.png,.jpg,.jpeg
23
+ - PY_IMAGE_DEDUP_ANALYSIS_THREADS=8
24
+ - PY_IMAGE_DEDUP_ANALYSIS_USE_EXIF_DATA=True
25
+ - PY_IMAGE_DEDUP_DEDUPLICATION_DUPLICATES_TARGET_DIRECTORY=/mnt/duplicates/
26
+ - PY_IMAGE_DEDUP_ELASTICSEARCH_AUTO_CREATE_INDEX=True
27
+ - PY_IMAGE_DEDUP_ELASTICSEARCH_HOST=elasticsearch
28
+ - PY_IMAGE_DEDUP_ELASTICSEARCH_MAX_DISTANCE=0.1
29
+ - PY_IMAGE_DEDUP_REMOVE_EMPTY_FOLDERS=False
30
+ volumes :
31
+ # change this to your local source directory
32
+ - /mnt/sdb2/Sample:/mnt/source
33
+ # change this to your local duplicates directory
34
+ - /mnt/sdb2/py-image-dedup_duplicates:/mnt/duplicates
35
+ links :
36
+ - elasticsearch
37
+ networks :
38
+ - docker-elk
39
+ depends_on :
40
+ - elasticsearch
41
+ restart : on-failure
42
+ networks :
43
+ docker-elk :
44
+ driver : bridge
Original file line number Diff line number Diff line change 24
24
25
25
26
26
@click .group (context_settings = CONTEXT_SETTINGS )
27
+ @click .version_option ()
27
28
def cli ():
28
29
pass
29
30
Original file line number Diff line number Diff line change 1
1
from datetime import timedelta
2
2
3
- from container_app_conf import ConfigBase , EnvSource , YamlSource
3
+ from container_app_conf import ConfigBase
4
4
from container_app_conf .entry .bool import BoolConfigEntry
5
5
from container_app_conf .entry .file import DirectoryConfigEntry
6
6
from container_app_conf .entry .float import FloatConfigEntry
7
7
from container_app_conf .entry .int import IntConfigEntry
8
8
from container_app_conf .entry .list import ListConfigEntry
9
9
from container_app_conf .entry .string import StringConfigEntry
10
10
from container_app_conf .entry .timedelta import TimeDeltaConfigEntry
11
+ from container_app_conf .source .env_source import EnvSource
12
+ from container_app_conf .source .yaml_source import YamlSource
11
13
12
14
NODE_MAIN = "py_image_dedup"
13
15
Original file line number Diff line number Diff line change 1
1
import logging
2
+ import time
2
3
3
4
import requests
4
5
from elasticsearch import Elasticsearch
@@ -40,8 +41,12 @@ def __init__(self,
40
41
self .host = self .DEFAULT_DATABASE_HOST if host is None else host
41
42
self .port = self .DEFAULT_DATABASE_PORT if port is None else port
42
43
44
+ detected_version = None
45
+ while detected_version is None :
46
+ time .sleep (2 )
47
+ detected_version = self ._detect_db_version ()
48
+
43
49
self ._el_version = el_version
44
- detected_version = self ._detect_db_version ()
45
50
if self ._el_version is not None and detected_version is not None and self ._el_version != detected_version :
46
51
raise AssertionError (
47
52
"Detected database version ({}) does not match expected version ({})" .format (detected_version ,
@@ -76,6 +81,7 @@ def __init__(self,
76
81
{'host' : self .host , 'port' : self .port }
77
82
]
78
83
),
84
+ el_version = self ._el_version ,
79
85
index = self ._el_index ,
80
86
doc_type = self ._el_doctype ,
81
87
distance_cutoff = max_dist
Original file line number Diff line number Diff line change 1
1
setuptools
2
- container-app-conf >= 3.0.0
2
+ pip >= 19.2.3
3
+ container-app-conf >= 3.0.2
3
4
requests
4
5
scipy
5
6
numpy
6
- image_match
7
+ image_match @ git+https://github.com/markusressel/[email protected] #egg=image_match
7
8
elasticsearch >= 6
8
9
tabulate
9
10
tqdm
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ def read_requirements_file(file_name: str):
73
73
tests_require = test_requirements (),
74
74
entry_points = {
75
75
'console_scripts' : [
76
- 'py-image-dedup= py_image_dedup.cli.Main :cli'
76
+ 'py-image-dedup = py_image_dedup.cli:cli'
77
77
]
78
78
}
79
79
)
You can’t perform that action at this time.
0 commit comments