Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
RDMS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
researchdata
RDMS
Commits
c62047d3
Commit
c62047d3
authored
2 months ago
by
Anusha Ranganathan
Browse files
Options
Downloads
Patches
Plain Diff
Gather hidden files and fix rake task
parent
344d0cb2
No related branches found
Branches containing commit
No related tags found
1 merge request
!359
Gather hidden files and fix rake task
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hyrax/app/services/verify_crc_dataset_import.rb
+13
-7
13 additions, 7 deletions
hyrax/app/services/verify_crc_dataset_import.rb
hyrax/lib/tasks/verify_crc_1280_import.rake
+8
-7
8 additions, 7 deletions
hyrax/lib/tasks/verify_crc_1280_import.rake
with
21 additions
and
14 deletions
hyrax/app/services/verify_crc_dataset_import.rb
+
13
−
7
View file @
c62047d3
require
'json'
require
'csv'
require
'find'
class
VerifyCRCDatasetImport
extend
ComplexHelper
...
...
@@ -66,11 +67,11 @@ class VerifyCRCDatasetImport
msg
=
"Error: Import entry
#{
entry_id
}
not found"
return
false
,
msg
,
paths_compared
,
nil
end
paths_compared
[
source_identifier
:
entry
.
identifier
]
paths_compared
[
:
source_identifier
]
=
entry
.
identifier
# Check import id
if
import_id
!=
entry
.
importerexporter_id
msg
=
"Error: Importer id
#{
import_id
}
does not match id associated with entry
#{
entry_id
}
"
msg
=
"Error: Importer id
#{
import_id
}
does not match id associated with entry
#{
entry
.
importerexporter
_id
}
"
return
false
,
msg
,
paths_compared
,
nil
end
...
...
@@ -124,11 +125,16 @@ class VerifyCRCDatasetImport
# Get files to compare
# -- Get list of files from import directory
input_list
=
Dir
.
glob
(
File
.
join
(
import_path
,
'**'
,
'*'
)).
reject
{
|
fn
|
File
.
directory?
(
fn
)
}.
reject
{
|
fn
|
self
.
restricted_file_names?
(
fn
.
split
(
'/'
)[
-
1
])}.
map
{
|
fn
|
fn
.
sub
(
import_path
,
''
)}.
sort
# -- Get list of files from import directory including hidden files
input_list
=
[]
::
Find
.
find
(
import_path
)
do
|
fp
|
unless
FileTest
.
directory?
(
fp
)
unless
self
.
restricted_file_names?
(
fp
.
split
(
'/'
)[
-
1
])
input_list
<<
fp
.
sub
(
import_path
,
''
)
end
end
end
input_list
.
sort
# ---- downcase folder name
sanitised_input_list
=
{}
input_list
.
each
do
|
fp
|
...
...
This diff is collapsed.
Click to expand it.
hyrax/lib/tasks/verify_crc_1280_import.rake
+
8
−
7
View file @
c62047d3
...
...
@@ -2,17 +2,18 @@ require 'json'
namespace
:rdms
do
namespace
:crc_1280_import
do
desc
'Verify
CRC1280 import or verify CRC1280 import of an experimen
t. This will compare the files in the file path with the objects in the S3 bucket
"]
'
task
:
"
verify_import
"
,
[
:import_id
]
=>
:environment
do
|
task
,
args
|
puts
"Verifying import
#{
args
.
import_id
}
"
import_status
,
report_paths
=
VerifyCRCDatasetImport
.
verify_import
(
args
.
import_id
)
desc
'Verify
all experiments in CRC1280 impor
t. This will compare the files in the file path with the objects in the S3 bucket'
task
:verify_import
,
[
:import_id
]
=>
:environment
do
|
task
,
args
|
puts
"Verifying import
#{
args
.
import_id
.
to_i
}
"
import_status
,
report_paths
=
VerifyCRCDatasetImport
.
verify_import
(
args
.
import_id
.
to_i
)
puts
"import status :
#{
import_status
}
"
puts
"Detailed reports are available at:"
puts
JSON
.
pretty_generate
(
report_paths
)
end
task
:"verify_experiment"
,
[
:import_id
,
:entry_id
]
=>
:environment
do
|
task
,
args
|
puts
"Verifying import
#{
args
.
import_id
}
"
experiment_status
,
report_path
=
VerifyCRCDatasetImport
.
verify_experiment_and_report
(
args
.
import_id
,
args
.
entry_id
)
desc
'Verify experiment in CRC1280 import. This will compare the files in the file path with the objects in the S3 bucket'
task
:verify_experiment
,
[
:import_id
,
:entry_id
]
=>
:environment
do
|
task
,
args
|
puts
"Verifying experiment
#{
args
.
entry_id
.
to_i
}
in import
#{
args
.
import_id
.
to_i
}
"
experiment_status
,
report_path
=
VerifyCRCDatasetImport
.
verify_experiment_and_report
(
args
.
import_id
.
to_i
,
args
.
entry_id
.
to_i
)
puts
"Experiment import status :
#{
experiment_status
}
"
puts
"Detailed reports is available at:
#{
report_path
}
"
end
...
...
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