Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reference-repository
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab upgrade completed. Current version is 17.11.3.
Show more breadcrumbs
grid5000
reference-repository
Commits
894eb0d2
Verified
Commit
894eb0d2
authored
11 months ago
by
Philippe Virouleau
Browse files
Options
Downloads
Patches
Plain Diff
refapi: add a global json file for RE
parent
c85613d7
No related branches found
No related tags found
1 merge request
!728
Generate access rules data in reference repository
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/refrepo/gen/reference-api.rb
+21
-10
21 additions, 10 deletions
lib/refrepo/gen/reference-api.rb
with
21 additions
and
10 deletions
lib/refrepo/gen/reference-api.rb
+
21
−
10
View file @
894eb0d2
...
@@ -172,15 +172,26 @@ def generate_reference_api
...
@@ -172,15 +172,26 @@ def generate_reference_api
)
)
#
# Generate the all-in-one json with just enough information for resources-explorer.
# Write the all-in-one json file
all_in_one_hash
=
{
#
"sites"
=>
global_hash
[
"sites"
].
to_h
do
|
site_uid
,
site
|
[
site_uid
,
{
# rename entry for the all-in-on json file
"uid"
=>
site_uid
,
global_hash
[
"sites"
].
each
do
|
_site_uid
,
site
|
"clusters"
=>
site
[
"clusters"
].
to_h
do
|
cluster_uid
,
cluster
|
site
[
"network_equipments"
]
=
site
.
delete
(
"networks"
)
[
cluster_uid
,
{
end
"uid"
=>
cluster_uid
,
"queues"
=>
cluster
[
"queues"
],
"nodes"
=>
cluster
[
"nodes"
].
to_h
do
|
node_uid
,
node
|
[
node_uid
,
node
.
select
{
|
key
|
%w[uid nodeset gpu_devices processor architecture]
.
include?
(
key
)
}]
end
}]
end
}]
end
}
# Write global json file - Disable this for now, see https://www.grid5000.fr/w/TechTeam:CT-220
# Write the global json file.
#write_json(grid_path.join(File.expand_path("../../#{global_hash['uid']}-all.json", File.dirname(__FILE__))), global_hash)
# Writing the file at the root of the repository makes the full refrepo show
# up when GET-ing "/" in g5k-api, which we don't want; arbitrarily put it in accesses.
write_json
(
Pathname
.
new
(
refapi_path
).
join
(
"accesses"
,
"refrepo.json"
),
all_in_one_hash
)
end
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