Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dm-docs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
hammonds
dm-docs
Commits
8e7531b1
Commit
8e7531b1
authored
9 years ago
by
sveseli
Browse files
Options
Downloads
Patches
Plain Diff
allow arbitrary key-value pairs to be passed to daq service and to processing plugins
parent
e674de62
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
src/python/dm/common/processing/plugins/fileProcessor.py
+3
-3
3 additions, 3 deletions
src/python/dm/common/processing/plugins/fileProcessor.py
src/python/dm/common/processing/plugins/fileTransferPlugin.py
+8
-4
8 additions, 4 deletions
...python/dm/common/processing/plugins/fileTransferPlugin.py
with
11 additions
and
7 deletions
src/python/dm/common/processing/plugins/fileProcessor.py
+
3
−
3
View file @
8e7531b1
...
...
@@ -10,7 +10,7 @@ class FileProcessor:
self
.
configDict
=
{}
@abc.abstractmethod
def
processFile
(
self
,
file
Path
,
daqPath
,
experiment
):
def
processFile
(
self
,
file
Info
):
return
NotImplemented
def
configure
(
self
):
...
...
@@ -27,11 +27,11 @@ class FileProcessor:
self
.
configDict
[
'
numberOfRetries
'
]
=
nRetries
def
getNumberOfRetries
(
self
):
self
.
configDict
.
get
(
'
numberOfRetries
'
,
self
.
DEFAULT_NUMBER_OF_RETRIES
)
return
self
.
configDict
.
get
(
'
numberOfRetries
'
,
self
.
DEFAULT_NUMBER_OF_RETRIES
)
def
setRetryWaitPeriodInSeconds
(
self
,
waitPeriod
):
self
.
configDict
[
'
retryWaitPeriodInSeconds
'
]
=
waitPeriod
def
getRetryWaitPeriodInSeconds
(
self
):
self
.
configDict
.
get
(
'
retryWaitPeriodInSeconds
'
,
DEFAULT_RETRY_WAIT_PERIOD_IN_SECONDS
)
return
self
.
configDict
.
get
(
'
retryWaitPeriodInSeconds
'
,
self
.
DEFAULT_RETRY_WAIT_PERIOD_IN_SECONDS
)
This diff is collapsed.
Click to expand it.
src/python/dm/common/processing/plugins/fileTransferPlugin.py
+
8
−
4
View file @
8e7531b1
...
...
@@ -19,13 +19,17 @@ class FileTransferPlugin(FileProcessor):
self
.
command
=
command
self
.
subprocess
=
None
def
processFile
(
self
,
filePath
,
daqPath
,
experiment
):
def
processFile
(
self
,
fileInfo
):
filePath
=
fileInfo
.
get
(
'
filePath
'
)
dataDirectory
=
fileInfo
.
get
(
'
dataDirectory
'
)
experiment
=
fileInfo
.
get
(
'
experiment
'
)
storageHost
=
experiment
.
get
(
'
storageHost
'
)
storageDirectory
=
experiment
.
get
(
'
storageDirectory
'
)
dest
=
'
%s:%s
'
%
(
storageHost
,
storageDirectory
)
# Use relative path with respect to da
q
directory as a source
os
.
chdir
(
da
qPath
)
src
=
os
.
path
.
relpath
(
filePath
,
da
qPath
)
# Use relative path with respect to da
ta
directory as a source
os
.
chdir
(
da
taDirectory
)
src
=
os
.
path
.
relpath
(
filePath
,
da
taDirectory
)
self
.
start
(
src
,
dest
)
def
getFullCommand
(
self
,
src
,
dest
):
...
...
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