Skip to content

Commit 868f2e6

Browse files
committed
Rebasing properly
Signed-off-by: Aloys Baillet <aloys.baillet+github@gmail.com>
1 parent 063938f commit 868f2e6

8 files changed

Lines changed: 33 additions & 59 deletions

File tree

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools", "wheel"]
3+
build-backend = "setuptools.build_meta:__legacy__"

python/aswfdocker/cli/aswfdocker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def images():
262262
"""Lists all known CI images in this format: IMAGEGROUP/IMAGE:VERSION
263263
"""
264264
for image_type in (constants.ImageType.CI_IMAGE, constants.ImageType.RT_IMAGE):
265-
for group, images in constants.GROUPS[image_type].items():
265+
for group, images in index.Index().groups[image_type].items():
266266
for image in images:
267267
image_name = utils.get_image_name(image_type, image)
268268
for version in index.Index().iter_versions(image_type, image):
@@ -403,7 +403,7 @@ def dockergen(context, image_name, check):
403403
"""
404404
if image_name == "all":
405405
images = []
406-
for gimages in index.Index().groups[constants.ImageType.IMAGE].values():
406+
for gimages in index.Index().groups[constants.ImageType.CI_IMAGE].values():
407407
images.extend(gimages)
408408
else:
409409
images = [image_name]

python/aswfdocker/data/ci-image-readme.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ for further information, and participate in the discussion on the
1717

1818
[Docker Image Source](https://github.com/AcademySoftwareFoundation/aswf-docker/blob/master/ci-{{ name }}/Dockerfile)
1919

20-
{% for version in index.iter_versions(constants.ImageType.IMAGE, name) -%}
20+
{% for version in index.iter_versions(constants.ImageType.CI_IMAGE, name) -%}
2121
## [aswf/ci-{{name}}:{{version}}](https://hub.docker.com/r/aswf/ci-{{name}}/tags?page=1&name={{version}})
2222

2323
Contains:

python/aswfdocker/data/versions.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,20 @@ ci-images:
443443
- "2020-clang7.9"
444444
- "2021-clang10.5"
445445

446+
rt-images:
447+
base:
448+
- "2019.0"
449+
- "2020.0"
450+
- "2021.0"
451+
vfxall:
452+
- "2019.0"
453+
- "2020.0"
454+
- "2021.0"
455+
vfxall-jupyter:
456+
- "2019.0"
457+
- "2020.0"
458+
- "2021.0"
459+
446460
groups:
447461
package:
448462
common:
@@ -476,7 +490,7 @@ groups:
476490
- partio
477491
- ptex
478492
- usd
479-
image:
493+
ci-image:
480494
common:
481495
- common
482496
base:
@@ -493,6 +507,13 @@ groups:
493507
- osl
494508
- openvdb
495509
- vfxall
510+
rt-image:
511+
base:
512+
- base
513+
vfx:
514+
- vfxall
515+
- vfxall-jupyter
516+
496517

497518
package_data:
498519
python:

python/aswfdocker/index.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ def __init__(self):
2626
with path.open() as f:
2727
self._versions = yaml.load(f, Loader=yaml.FullLoader)
2828
self.groups = {
29-
constants.ImageType.IMAGE: self._versions["groups"]["image"],
29+
constants.ImageType.CI_IMAGE: self._versions["groups"]["ci-image"],
30+
constants.ImageType.RT_IMAGE: self._versions["groups"]["rt-image"],
3031
constants.ImageType.PACKAGE: self._versions["groups"]["package"],
3132
}
3233
self._version_infos = {}

python/aswfdocker/tests/test_builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ def test_image_base_2019clang_dict(self):
8585
groupinfo.GroupInfo(
8686
names=["vfx3"],
8787
versions=["2019-clang9"],
88-
type_=constants.ImageType.IMAGE,
88+
type_=constants.ImageType.CI_IMAGE,
8989
targets=["openvdb"],
9090
),
9191
)
9292
openvdb_version = list(
93-
index.Index().iter_versions(constants.ImageType.IMAGE, "openvdb")
93+
index.Index().iter_versions(constants.ImageType.CI_IMAGE, "openvdb")
9494
)[4]
9595
self.assertEqual(
9696
b.make_bake_dict(),

python/aswfdocker/tests/test_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_get_versions(self):
2323
self.assertGreater(len(ciimages), 1)
2424
self.assertEqual(ciimages[0], "common")
2525
rtimages = list(self.index.iter_images(constants.ImageType.RT_IMAGE))
26-
self.assertGreater(len(rtimages), 1)
26+
self.assertGreater(len(rtimages), 0)
2727
self.assertEqual(rtimages[0], "base")
2828
versions = list(
2929
self.index.iter_versions(constants.ImageType.CI_IMAGE, ciimages[0])

python/aswfdocker/utils.py

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,6 @@ def get_image_spec(name: str):
118118
return org, image_type, image, version
119119

120120

121-
<<<<<<< HEAD
122-
def get_group_from_image(image_type: constants.ImageType, image: str):
123-
for group, images in constants.GROUPS[image_type].items():
124-
for img in images:
125-
if img == image:
126-
return group
127-
raise RuntimeError(f"Cannot find group for image {image}")
128-
129-
130-
<<<<<<< HEAD
131121
def get_image_pull_count(docker_org, image):
132122
url = f"https://hub.docker.com/v2/repositories/{docker_org}/{image}"
133123
try:
@@ -156,52 +146,12 @@ def get_image_sizes(docker_org, image):
156146
return sizes
157147

158148

159-
def iter_all_images():
160-
for org in (constants.TESTING_DOCKER_ORG, constants.PUBLISH_DOCKER_ORG):
161-
for image_type in (
162-
constants.ImageType.PACKAGE,
163-
constants.ImageType.CI_IMAGE,
164-
constants.ImageType.RT_IMAGE,
165-
):
166-
for _, images in constants.GROUPS[image_type].items():
167-
for image in images:
168-
yield org, image_type, image
169-
170-
171149
def get_dockerhub_token(username, password):
172150
body = {"username": username, "password": password}
173151
response = requests.post("https://hub.docker.com/v2/users/login", json=body)
174152
return response.json()["token"]
175153

176154

177-
def get_image_pull_count(docker_org, image):
178-
url = f"https://hub.docker.com/v2/repositories/{docker_org}/{image}"
179-
try:
180-
d = json.loads(urllib.request.urlopen(url).read())
181-
return d["pull_count"]
182-
except urllib.error.HTTPError:
183-
logger.debug("Failed to load data from URL %r", url)
184-
return 0
185-
186-
187-
def get_image_sizes(docker_org, image):
188-
sizes = {}
189-
url = f"https://hub.docker.com/v2/repositories/{docker_org}/{image}/tags/"
190-
try:
191-
d = json.loads(urllib.request.urlopen(url).read())
192-
except urllib.error.HTTPError:
193-
logger.debug("Failed to load data from URL %r", url)
194-
return sizes
195-
digests = set()
196-
for tag in d["results"]:
197-
digest = tag["images"][0]["digest"]
198-
if digest in digests:
199-
continue
200-
digests.add(digest)
201-
sizes[tag["name"]] = tag["full_size"]
202-
return sizes
203-
204-
205155
def iter_all_images():
206156
for org in (constants.TESTING_DOCKER_ORG, constants.PUBLISH_DOCKER_ORG):
207157
for image_type in (
@@ -212,4 +162,3 @@ def iter_all_images():
212162
for _, images in constants.GROUPS[image_type].items():
213163
for image in images:
214164
yield org, image_type, image
215-
>>>>>>> Added dockerstats command

0 commit comments

Comments
 (0)