Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rosetta
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
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
ExaCT
Rosetta
Commits
8ae7de19
Commit
8ae7de19
authored
4 months ago
by
Stefano Alberto Russo
Browse files
Options
Downloads
Patches
Plain Diff
Improved container versions and arch ordering
parent
1ce58139
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
services/webapp/code/rosetta/core_app/views.py
+25
-10
25 additions, 10 deletions
services/webapp/code/rosetta/core_app/views.py
with
25 additions
and
10 deletions
services/webapp/code/rosetta/core_app/views.py
+
25
−
10
View file @
8ae7de19
...
@@ -814,7 +814,7 @@ def software(request):
...
@@ -814,7 +814,7 @@ def software(request):
return
render
(
request
,
'
error.html
'
,
{
'
data
'
:
data
})
return
render
(
request
,
'
error.html
'
,
{
'
data
'
:
data
})
else
:
else
:
# D
d
o we have to operate on a container family?
# Do we have to operate on a container family?
if
container_family_id
:
if
container_family_id
:
# Get back name, registry and image from contsainer url
# Get back name, registry and image from contsainer url
...
@@ -836,7 +836,7 @@ def software(request):
...
@@ -836,7 +836,7 @@ def software(request):
platform_containers
=
Container
.
objects
.
filter
(
user
=
None
)
platform_containers
=
Container
.
objects
.
filter
(
user
=
None
)
# Ok,
n
ilter by owner
# Ok,
f
ilter by owner
if
search_owner
!=
'
All
'
:
if
search_owner
!=
'
All
'
:
if
search_owner
==
'
User
'
:
if
search_owner
==
'
User
'
:
platform_containers
=
[]
platform_containers
=
[]
...
@@ -875,10 +875,25 @@ def software(request):
...
@@ -875,10 +875,25 @@ def software(request):
self
.
container_by_tags_by_arch
[
container
.
image_arch
]
=
{}
self
.
container_by_tags_by_arch
[
container
.
image_arch
]
=
{}
self
.
container_by_tags_by_arch
[
container
.
image_arch
][
container
.
image_tag
]
=
container
self
.
container_by_tags_by_arch
[
container
.
image_arch
][
container
.
image_tag
]
=
container
# Lastly, add the container to the "all tags"
#if None not in self.container_by_tags_by_arch:
def
finalize
(
self
,
desc
=
True
):
# self.container_by_tags_by_arch[None]={}
#self.container_by_tags_by_arch[None][container.image_tag] = container
# Order versions
for
arch
in
self
.
container_by_tags_by_arch
:
latest
=
self
.
container_by_tags_by_arch
[
arch
].
pop
(
'
latest
'
,
None
)
container_by_tags_ordered
=
dict
(
sorted
(
self
.
container_by_tags_by_arch
[
arch
].
items
(),
reverse
=
desc
))
if
latest
:
if
desc
:
self
.
container_by_tags_by_arch
[
arch
]
=
{
'
latest
'
:
latest
}
self
.
container_by_tags_by_arch
[
arch
].
update
(
container_by_tags_ordered
)
else
:
self
.
container_by_tags_by_arch
[
arch
]
=
container_by_tags_ordered
self
.
container_by_tags_by_arch
[
arch
].
update
({
'
latest
'
:
latest
})
else
:
self
.
container_by_tags_by_arch
[
arch
]
=
container_by_tags_ordered
# Order archs
self
.
container_by_tags_by_arch
=
dict
(
sorted
(
self
.
container_by_tags_by_arch
.
items
(),
reverse
=
False
))
@
property
@
property
...
@@ -893,11 +908,11 @@ def software(request):
...
@@ -893,11 +908,11 @@ def software(request):
if
container
.
family_id
not
in
data
[
'
container_families
'
]:
if
container
.
family_id
not
in
data
[
'
container_families
'
]:
data
[
'
container_families
'
][
container
.
family_id
]
=
ContainerFamily
(
container
.
family_id
,
container
.
name
,
container
.
registry
,
container
.
image_name
)
data
[
'
container_families
'
][
container
.
family_id
]
=
ContainerFamily
(
container
.
family_id
,
container
.
name
,
container
.
registry
,
container
.
image_name
)
data
[
'
container_families
'
][
container
.
family_id
].
add
(
container
)
data
[
'
container_families
'
][
container
.
family_id
].
add
(
container
)
# Finalize the families
# Finalize the families
#for container.family_id in data['container_families']:
for
container_family_id
in
data
[
'
container_families
'
]:
# if len(data['container_families'][container.family_id].all_archs) == 1:
data
[
'
container_families
'
][
container_family_id
].
finalize
()
# if data['container_families'][container.family_id].all_archs[0] != None:
# data['container_families'][container.family_id].container_by_tags_by_arch.pop(None)
return
render
(
request
,
'
software.html
'
,
{
'
data
'
:
data
})
return
render
(
request
,
'
software.html
'
,
{
'
data
'
:
data
})
...
...
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