Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rucio-scripting
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container 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
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ASTRON SDC
ESCAPE WP2
rucio-scripting
Commits
ac8c1296
Commit
ac8c1296
authored
4 years ago
by
Yan Grange
Browse files
Options
Downloads
Patches
Plain Diff
Added last steps
parent
80e0b332
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
add_files_to_obs.sh
+6
-0
6 additions, 0 deletions
add_files_to_obs.sh
add_obs_to_container.sh
+6
-0
6 additions, 0 deletions
add_obs_to_container.sh
create_movescript.py
+2
-4
2 additions, 4 deletions
create_movescript.py
register_movedfiles.py
+8
-3
8 additions, 3 deletions
register_movedfiles.py
with
22 additions
and
7 deletions
add_files_to_obs.sh
0 → 100644
+
6
−
0
View file @
ac8c1296
# first par is name of dataset, second one is file with list of filenames in it
rucio add-dataset lofar:
$1
for
fname
in
`
cat
$2
`
do
rucio attach lofar:
$1
fname
done
This diff is collapsed.
Click to expand it.
add_obs_to_container.sh
0 → 100644
+
6
−
0
View file @
ac8c1296
# first par is container name, second par a list of obs for the container
rucio add-container lofar:
$1
for
oname
in
`
cat
$2
`
do
rucio attach lofar:
$1
oname
done
This diff is collapsed.
Click to expand it.
create_movescript.py
+
2
−
4
View file @
ac8c1296
...
@@ -17,7 +17,7 @@ def data_parser(filedata, scope='lofar'):
...
@@ -17,7 +17,7 @@ def data_parser(filedata, scope='lofar'):
name
=
os
.
path
.
basename
(
pth
)
name
=
os
.
path
.
basename
(
pth
)
checkline
=
filedata
[
idx
+
6
]
checkline
=
filedata
[
idx
+
6
]
checksum
=
checkline
.
split
(
"
:
"
)[
1
].
strip
()
checksum
=
checkline
.
split
(
"
:
"
)[
1
].
strip
()
datafiles
.
append
({
'
name
'
:
name
,
'
bytes
'
:
nbytes
,
'
adler32
'
:
checksum
,
'
meta
'
:
meta
})
datafiles
.
append
({
'
scope
'
:
scope
,
'
name
'
:
name
,
'
bytes
'
:
nbytes
,
'
adler32
'
:
checksum
,
'
meta
'
:
meta
})
filepaths
.
append
(
pth
)
filepaths
.
append
(
pth
)
return
filepaths
,
datafiles
return
filepaths
,
datafiles
...
@@ -34,16 +34,14 @@ srm_root_host = "srm://srm.grid.sara.nl"
...
@@ -34,16 +34,14 @@ srm_root_host = "srm://srm.grid.sara.nl"
rucio_rse_rootdir
=
"
srm://srm.grid.sara.nl/pnfs/grid.sara.nl/data/escape/disk/rucio/sara_dcache
"
rucio_rse_rootdir
=
"
srm://srm.grid.sara.nl/pnfs/grid.sara.nl/data/escape/disk/rucio/sara_dcache
"
rdt
=
protocol
.
RSEDeterministicTranslation
()
rdt
=
protocol
.
RSEDeterministicTranslation
()
move_commands
=
list
()
move_commands
=
list
()
topaths
=
list
()
for
frompath
in
filepaths
:
for
frompath
in
filepaths
:
fname
=
os
.
path
.
basename
(
frompath
)
fname
=
os
.
path
.
basename
(
frompath
)
tosubpath
=
rdt
.
path
(
scope
,
fname
)
tosubpath
=
rdt
.
path
(
scope
,
fname
)
from_address
=
"
/
"
.
join
([
srm_root_host
,
frompath
])
from_address
=
"
/
"
.
join
([
srm_root_host
,
frompath
])
to_address
=
"
/
"
.
join
([
rucio_rse_rootdir
,
tosubpath
])
to_address
=
"
/
"
.
join
([
rucio_rse_rootdir
,
tosubpath
])
topaths
.
append
(
tosubpath
[
len
(
scope
)
+
1
:])
# strip off scope and slash
move_commands
.
append
(
"
srmmv {src} {tgt}
\n
"
.
format
(
src
=
from_address
,
tgt
=
to_address
))
move_commands
.
append
(
"
srmmv {src} {tgt}
\n
"
.
format
(
src
=
from_address
,
tgt
=
to_address
))
with
open
(
"
data_movescript.sh
"
,
'
w
'
)
as
dms
:
with
open
(
"
data_movescript.sh
"
,
'
w
'
)
as
dms
:
dms
.
writelines
(
move_commands
)
dms
.
writelines
(
move_commands
)
with
open
(
"
datapaths.pck
"
,
"
wb
"
)
as
path_pickle
:
with
open
(
"
datapaths.pck
"
,
"
wb
"
)
as
path_pickle
:
pickle
.
dump
(
topaths
,
path_pickle
)
pickle
.
dump
(
filelist_data
,
path_pickle
)
This diff is collapsed.
Click to expand it.
register_movedfiles.py
+
8
−
3
View file @
ac8c1296
...
@@ -4,9 +4,14 @@ import cPickle as pickle
...
@@ -4,9 +4,14 @@ import cPickle as pickle
# step 4: Add replicas for files using rucio.client.replicaclient the ReplicaClient class (add_replicas)
# step 4: Add replicas for files using rucio.client.replicaclient the ReplicaClient class (add_replicas)
with
open
(
"
datapaths.pck
"
,
"
rb
"
)
as
pathfile
:
with
open
(
"
datapaths.pck
"
,
"
rb
"
)
as
pathfile
:
data_paths
=
pickle
.
load
(
pathfile
)
file_details
=
pickle
.
load
(
pathfile
)
print
(
data_paths
[
2
])
rcl
=
replicaclient
.
ReplicaClient
()
RSE
=
"
SARA-DCACHE
"
rcl
.
add_replicas
(
RSE
,
file_details
):
# ideally we should catch issues here as well...
# step 4: Add dataset for each observation, add the files to the dataset
# step 5: Add container and add the cal/tgt to the container together
# step 5: Add container and add the cal/tgt to the container together
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