Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CTA
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tigran Mkrtchyan
CTA
Commits
3489cb09
Commit
3489cb09
authored
2 years ago
by
Miguel Barros
Browse files
Options
Downloads
Patches
Plain Diff
Add support for eosSpace resolution in disk instance space freeSpaceQueryURL
parent
3537949e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
continuousintegration/orchestration/tests/repack_systemtest.sh
+3
-3
3 additions, 3 deletions
...nuousintegration/orchestration/tests/repack_systemtest.sh
disk/DiskSystem.cpp
+10
-2
10 additions, 2 deletions
disk/DiskSystem.cpp
disk/DiskSystemTest.cpp
+2
-2
2 additions, 2 deletions
disk/DiskSystemTest.cpp
with
15 additions
and
7 deletions
continuousintegration/orchestration/tests/repack_systemtest.sh
+
3
−
3
View file @
3489cb09
...
...
@@ -148,9 +148,9 @@ if [ ! -z $BACKPRESSURE_TEST ]; then
echo
"Backpressure test: setting too high free space requirements"
# This should be idempotent as we will be called several times
if
[[
$(
admin_cta
--json
ds
ls
| jq
'.[] | select(.name=="repackBuffer") | .name'
)
!=
'"repackBuffer"'
]]
;
then
admin_cta di add
-n
repackDiskInstance
-m
toto
admin_cta dis add
-n
repackDiskInstanceSpace
--di
repackDiskInstance
-u
"eos:
${
EOSINSTANCE
}
:default"
-i
5
-m
toto
admin_cta ds add
-n
repackBuffer
--di
repackDiskInstance
--dis
repackDiskInstanceSpace
-r
"root://
${
EOSINSTANCE
}
/
${
REPACK_BUFFER_BASEDIR
}
"
-f
111222333444555
-s
20
-m
toto
admin_cta di add
-n
${
EOSINSTANCE
}
-m
toto
admin_cta dis add
-n
repackDiskInstanceSpace
--di
${
EOSINSTANCE
}
-u
"eosSpace
:default"
-i
5
-m
toto
admin_cta ds add
-n
repackBuffer
--di
${
EOSINSTANCE
}
--dis
repackDiskInstanceSpace
-r
"root://
${
EOSINSTANCE
}
/
${
REPACK_BUFFER_BASEDIR
}
"
-f
111222333444555
-s
20
-m
toto
else
echo
"Disk system repackBuffer alread defined. Ensuring too high free space requirements."
admin_cta ds ch
-n
repackBuffer
-f
111222333444555
...
...
This diff is collapsed.
Click to expand it.
disk/DiskSystem.cpp
+
10
−
2
View file @
3489cb09
...
...
@@ -77,6 +77,14 @@ std::string DiskSystemList::getFetchEosFreeSpaceScript() const{
// DiskSystemFreeSpaceList::fetchFileSystemFreeSpace()
//------------------------------------------------------------------------------
void
DiskSystemFreeSpaceList
::
fetchDiskSystemFreeSpace
(
const
std
::
set
<
std
::
string
>&
diskSystems
,
log
::
LogContext
&
lc
)
{
auto
getDiskSystemFreeSpaceQueryURL
=
[](
DiskSystem
ds
)
{
auto
dsURL
=
ds
.
diskInstanceSpace
.
freeSpaceQueryURL
;
// Replace URLS starting in eosSpace with eos:{diskInstanceName}
if
(
dsURL
.
rfind
(
"eosSpace"
,
0
)
==
0
)
{
dsURL
=
"eos:"
+
ds
.
diskInstanceSpace
.
diskInstance
+
dsURL
.
substr
(
8
);
}
return
dsURL
;
};
// The real deal: go fetch the file system's free space.
cta
::
utils
::
Regex
eosDiskSystem
(
"^eos:(.*):(.*)$"
);
// For testing purposes
...
...
@@ -88,7 +96,7 @@ void DiskSystemFreeSpaceList::fetchDiskSystemFreeSpace(const std::set<std::strin
try
{
std
::
vector
<
std
::
string
>
regexResult
;
auto
&
currentDiskSystem
=
m_systemList
.
at
(
ds
);
regexResult
=
eosDiskSystem
.
exec
(
curren
tDiskSystem
.
diskInstanceSpace
.
freeSpaceQueryURL
);
regexResult
=
eosDiskSystem
.
exec
(
ge
tDiskSystem
FreeSpaceQueryURL
(
currentDiskSystem
)
);
if
(
regexResult
.
size
())
{
//Script, then EOS free space query
if
(
!
m_systemList
.
getFetchEosFreeSpaceScript
().
empty
()){
...
...
@@ -108,7 +116,7 @@ void DiskSystemFreeSpaceList::fetchDiskSystemFreeSpace(const std::set<std::strin
freeSpace
=
fetchEosFreeSpace
(
regexResult
.
at
(
1
),
regexResult
.
at
(
2
),
lc
);
goto
found
;
}
regexResult
=
constantFreeSpaceDiskSystem
.
exec
(
m_systemList
.
at
(
ds
).
diskInstanceSpace
.
freeSpaceQueryURL
);
regexResult
=
constantFreeSpaceDiskSystem
.
exec
(
getDiskSystemFreeSpaceQueryURL
(
m_systemList
.
at
(
ds
))
);
if
(
regexResult
.
size
())
{
freeSpace
=
fetchConstantFreeSpace
(
regexResult
.
at
(
1
),
lc
);
goto
found
;
...
...
This diff is collapsed.
Click to expand it.
disk/DiskSystemTest.cpp
+
2
−
2
View file @
3489cb09
...
...
@@ -94,12 +94,12 @@ namespace unitTests {
void
insertDiskSystemDefault
()
{
auto
&
catalogue
=
getCatalogue
();
// create disk instance
std
::
string
diskInstanceName
=
"
DiskInstanceNameDefault
"
;
std
::
string
diskInstanceName
=
"
ctaeos
"
;
std
::
string
diskInstanceComment
=
"Comment"
;
catalogue
.
createDiskInstance
(
m_cliId
,
diskInstanceName
,
diskInstanceComment
);
// create disk instance space
std
::
string
diskInstanceSpaceName
=
"DiskInstanceSpaceDefault"
;
std
::
string
freeSpaceQueryURL
=
"eos
:ctaeos
:default"
;
std
::
string
freeSpaceQueryURL
=
"eos
Space
:default"
;
uint64_t
refrestInterval
=
1
;
std
::
string
diskInstanceSpaceComment
=
"Comment"
;
catalogue
.
createDiskInstanceSpace
(
m_cliId
,
diskInstanceSpaceName
,
diskInstanceName
,
freeSpaceQueryURL
,
refrestInterval
,
diskInstanceSpaceComment
);
...
...
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