EOX GitLab Instance
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ESA
PRISM
VS
Commits
7ff11021
Commit
7ff11021
authored
4 years ago
by
Fabian Schindler
Browse files
Options
Downloads
Patches
Plain Diff
Fixes for prepocessing daemon
parent
05e7ff7d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
preprocessor/preprocessor/cli.py
+13
-2
13 additions, 2 deletions
preprocessor/preprocessor/cli.py
preprocessor/preprocessor/preprocess.py
+6
-4
6 additions, 4 deletions
preprocessor/preprocessor/preprocess.py
with
19 additions
and
6 deletions
preprocessor/preprocessor/cli.py
+
13
−
2
View file @
7ff11021
...
@@ -6,6 +6,7 @@ import yaml
...
@@ -6,6 +6,7 @@ import yaml
import
jsonschema
import
jsonschema
from
.preprocess
import
preprocess_file
from
.preprocess
import
preprocess_file
from
.daemon
import
run_daemon
def
setup_logging
(
debug
=
False
):
def
setup_logging
(
debug
=
False
):
...
@@ -44,8 +45,18 @@ def cli():
...
@@ -44,8 +45,18 @@ def cli():
@cli.command
(
help
=
'
Run the preprocess daemon, attaching to a Redis queue
'
)
@cli.command
(
help
=
'
Run the preprocess daemon, attaching to a Redis queue
'
)
def
daemon
(
ctx
):
@click.option
(
'
--config-file
'
,
type
=
click
.
File
(
'
r
'
))
click
.
echo
(
ctx
[
'
CONFIG
'
])
@click.option
(
'
--use-dir
'
,
type
=
str
)
# TODO: check dir
@click.option
(
'
--validate/--no-validate
'
,
default
=
False
)
@click.option
(
'
--host
'
,
type
=
str
)
@click.option
(
'
--port
'
,
type
=
int
)
@click.option
(
'
--listen-queue
'
,
type
=
str
)
@click.option
(
'
--write-queue
'
,
type
=
str
)
def
daemon
(
config_file
=
None
,
use_dir
=
None
,
validate
=
False
,
host
=
None
,
port
=
None
,
listen_queue
=
None
,
write_queue
=
None
):
config
=
yaml
.
load
(
config_file
)
if
validate
:
validate_config
(
config
)
run_daemon
(
config
,
host
,
port
,
listen_queue
,
write_queue
)
@cli.command
(
help
=
'
Run a single, one-off preprocessing
'
)
@cli.command
(
help
=
'
Run a single, one-off preprocessing
'
)
...
...
This diff is collapsed.
Click to expand it.
preprocessor/preprocessor/preprocess.py
+
6
−
4
View file @
7ff11021
...
@@ -246,7 +246,9 @@ def preprocess_file(config: dict, file_path: os.PathLike, use_dir: os.PathLike=N
...
@@ -246,7 +246,9 @@ def preprocess_file(config: dict, file_path: os.PathLike, use_dir: os.PathLike=N
%
(
upload_timer
.
elapsed
)
%
(
upload_timer
.
elapsed
)
)
)
logger
.
info
(
logger
.
info
(
'
Finished preprocessing of %s after %f seconds.
'
'
Finished preprocessing of %s after %f seconds.
'
%
(
file_path
,
preprocess_timer
.
elapsed
)
%
(
file_path
,
preprocess_timer
.
elapsed
)
)
)
return
upload_filenames
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment