Exemplo n.º 1
0
 def test_image_base_2019_dict(self):
     b = builder.Builder(
         self.build_info,
         groupinfo.GroupInfo(
             names=["base"],
             versions=["2019"],
             type_=constants.ImageType.IMAGE,
             targets=[],
         ),
     )
     base_version = list(
         index.Index().iter_versions(constants.ImageType.IMAGE, "base")
     )[1]
     baked = b.make_bake_dict()
     self.assertEqual(
         baked["target"]["ci-base-2019"]["tags"],
         [
             f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:2019",
             f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:{base_version}",
             f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:latest",
         ],
     )
     self.assertEqual(
         baked["target"]["ci-base-2019"]["args"]["ASWF_VERSION"], base_version
     )
Exemplo n.º 2
0
 def test_package_baseqt_2019_dict(self):
     b = builder.Builder(
         self.build_info,
         groupinfo.GroupInfo(
             names=["base2"],
             versions=["2019"],
             type_=constants.ImageType.PACKAGE,
             targets=[],
         ),
     )
     qt_version = list(
         index.Index().iter_versions(constants.ImageType.PACKAGE, "qt")
     )[1]
     baked = b.make_bake_dict()
     self.assertEqual(
         baked["target"]["ci-package-qt-2019"]["tags"],
         [
             f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-package-qt:2019",
             f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-package-qt:{qt_version}",
             f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-package-qt:latest",
             f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-package-qt:2019-5.12.6",
         ],
     )
     self.assertEqual(
         baked["target"]["ci-package-qt-2019"]["args"]["ASWF_VERSION"], qt_version
     )
     self.assertEqual(
         baked["target"]["ci-package-qt-2019"]["dockerfile"],
         "packages/base2/Dockerfile",
     )
Exemplo n.º 3
0
def get_group_info(build_info, ci_image_type, groups, versions, full_name,
                   targets):
    idx = index.Index()
    if full_name:
        org, image_type, target, version = full_name
        versions = [version]
        targets = [target]
        try:
            groups = [idx.get_group_from_image(image_type, target)]
        except RuntimeError as e:
            raise click.BadOptionUsage(option_name="--full-name",
                                       message=e.args[0])
        build_info.set_org(org)
    else:
        if ci_image_type is None:
            image_type = constants.ImageType.IMAGE
        else:
            image_type = constants.ImageType[ci_image_type]
        if not groups and targets:
            groups = [idx.get_group_from_image(image_type, targets[0])]
    group_info = groupinfo.GroupInfo(
        type_=image_type,
        names=groups,
        versions=versions,
        targets=targets,
    )
    return group_info
Exemplo n.º 4
0
    def test_package_baseqt_2019_dict(self):
        r = releaser.Releaser(
            self.build_info,
            groupinfo.GroupInfo(
                names=["base1"],
                versions=["2019"],
                type_=constants.ImageType.PACKAGE,
                targets=["boost"],
            ),
            sha=utils.get_current_sha(),
        )
        r.gh.repo.create_git_tag_and_release = mock.MagicMock()

        class U:
            name = "testuser"
            email = "*****@*****.**"

        r.gh.github.get_user = mock.MagicMock(return_value=U())

        r.gather()
        r.release(dry_run=False)
        boost_version = list(index.Index().iter_versions(
            constants.ImageType.PACKAGE, "boost"))[1]
        r.gh.repo.create_git_tag_and_release.assert_called_once_with(
            tag=f"aswflocaltesting/ci-package-boost/{boost_version}",
            draft=False,
            object=utils.get_current_sha(),
            prerelease=False,
            release_message=
            f"Inspect released Docker image here: https://hub.docker.com/r/aswflocaltesting/ci-package-boost/tags?name={boost_version}",
            release_name=f"aswflocaltesting/ci-package-boost:{boost_version}",
            tag_message=f"aswflocaltesting/ci-package-boost:{boost_version}",
            type="commit",
            tagger=mock.ANY,
        )
Exemplo n.º 5
0
 def test_package_baseqt_2019_dict(self):
     b = builder.Builder(
         self.build_info,
         groupinfo.GroupInfo(
             names=["base2"],
             versions=["2019"],
             type_=constants.ImageType.PACKAGE,
             targets=[],
         ),
     )
     qt_version = list(index.Index().iter_versions(
         constants.ImageType.PACKAGE, "qt"))[1]
     self.assertEqual(
         b.make_bake_dict(),
         {
             "group": {
                 "default": {
                     "targets": ["ci-package-qt-2019"]
                 }
             },
             "target": {
                 "ci-package-qt-2019": {
                     "context":
                     ".",
                     "dockerfile":
                     "packages/Dockerfile",
                     "args": {
                         "ASWF_ORG": "aswflocaltesting",
                         "ASWF_PKG_ORG": "aswftesting",
                         "ASWF_VERSION": qt_version,
                         "CI_COMMON_VERSION": "1",
                         "DTS_VERSION": "6",
                         "PYTHON_VERSION": "2.7",
                         "VFXPLATFORM_VERSION": "2019",
                     },
                     "labels": {
                         "org.opencontainers.image.created":
                         constants.DEV_BUILD_DATE,
                         "org.opencontainers.image.revision":
                         constants.DEV_BUILD_DATE,
                     },
                     "tags": [
                         f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-package-qt:2019",
                         f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-package-qt:{qt_version}",
                         f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-package-qt:latest",
                     ],
                     "target":
                     "ci-package-qt",
                     "output": ["type=docker"],
                 }
             },
         },
     )
Exemplo n.º 6
0
 def test_image_base_2019clang_dict(self):
     b = builder.Builder(
         self.build_info,
         groupinfo.GroupInfo(
             names=["vfx3"],
             versions=["2019-clang9"],
             type_=constants.ImageType.IMAGE,
             targets=["openvdb"],
         ),
     )
     openvdb_version = list(
         index.Index().iter_versions(constants.ImageType.IMAGE, "openvdb")
     )[4]
     self.assertEqual(
         b.make_bake_dict(),
         {
             "group": {"default": {"targets": ["ci-openvdb-2019-clang9"]}},
             "target": {
                 "ci-openvdb-2019-clang9": {
                     "context": ".",
                     "dockerfile": "ci-openvdb/Dockerfile",
                     "args": {
                         "ASWF_ALEMBIC_VERSION": "1.7.11",
                         "ASWF_ORG": "aswflocaltesting",
                         "ASWF_PKG_ORG": "aswftesting",
                         "ASWF_VERSION": openvdb_version,
                         "ASWF_BLOSC_VERSION": "1.5.0",
                         "ASWF_BOOST_VERSION": "1.66.0",
                         "ASWF_CCACHE_VERSION": "4.0",
                         "CI_COMMON_VERSION": "1",
                         "ASWF_CLANG_MAJOR_VERSION": "9",
                         "ASWF_CLANG_VERSION": "9.0.1",
                         "ASWF_CMAKE_VERSION": "3.12.4",
                         "ASWF_CPPUNIT_VERSION": "1.14.0",
                         "ASWF_CUDA_VERSION": "10.2",
                         "ASWF_DTS_VERSION": "6",
                         "ASWF_GLEW_VERSION": "2.1.0",
                         "ASWF_GLFW_VERSION": "3.1.2",
                         "ASWF_HDF5_VERSION": "1.8.21",
                         "ASWF_LOG4CPLUS_VERSION": "1.1.2",
                         "ASWF_NINJA_VERSION": "1.10.1",
                         "ASWF_NUMPY_VERSION": "1.14",
                         "ASWF_OCIO_CONFIGS_VERSION": "1.0_r2",
                         "ASWF_OCIO_VERSION": "1.1.0",
                         "ASWF_OIIO_VERSION": "2.0.8",
                         "ASWF_OPENEXR_VERSION": "2.3.0",
                         "ASWF_OPENSUBDIV_VERSION": "3_3_3",
                         "ASWF_OPENVDB_VERSION": "6.2.1",
                         "ASWF_OSL_VERSION": "1.10.9",
                         "ASWF_OTIO_VERSION": "0.12.1",
                         "ASWF_PARTIO_VERSION": "1.10.1",
                         "ASWF_PTEX_VERSION": "2.1.33",
                         "ASWF_PYBIND11_VERSION": "2.6.2",
                         "ASWF_PYSIDE_VERSION": "5.12.6",
                         "ASWF_PYTHON_VERSION": "2.7.15",
                         "ASWF_PYTHON_MAJOR_MINOR_VERSION": "2.7",
                         "ASWF_QT_VERSION": "5.12.6",
                         "ASWF_SONAR_VERSION": "4.5.0.2216",
                         "ASWF_TBB_VERSION": "2018",
                         "ASWF_USD_VERSION": "19.11",
                         "ASWF_VFXPLATFORM_VERSION": "2019",
                     },
                     "labels": {
                         "org.opencontainers.image.created": constants.DEV_BUILD_DATE,
                         "org.opencontainers.image.revision": constants.DEV_BUILD_DATE,
                     },
                     "tags": [
                         f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-openvdb:2019-clang9",
                         f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-openvdb:{openvdb_version}",
                     ],
                     "output": ["type=docker"],
                 }
             },
         },
     )
Exemplo n.º 7
0
 def test_image_base_2019_2020_dict(self):
     b = builder.Builder(
         self.build_info,
         groupinfo.GroupInfo(
             names=["base"],
             versions=["2019", "2020"],
             type_=constants.ImageType.IMAGE,
             targets=[],
         ),
     )
     base_versions = list(index.Index().iter_versions(
         constants.ImageType.IMAGE, "base"))
     self.assertEqual(
         b.make_bake_dict(),
         {
             "group": {
                 "default": {
                     "targets": ["ci-base-2019", "ci-base-2020"]
                 }
             },
             "target": {
                 "ci-base-2020": {
                     "context":
                     ".",
                     "dockerfile":
                     "ci-base/Dockerfile",
                     "args": {
                         "ASWF_ORG": "aswflocaltesting",
                         "ASWF_PKG_ORG": "aswftesting",
                         "ASWF_VERSION": base_versions[2],
                         "CI_COMMON_VERSION": "1",
                         "DTS_VERSION": "6",
                         "PYTHON_VERSION": "3.7",
                         "VFXPLATFORM_VERSION": "2020",
                     },
                     "labels": {
                         "org.opencontainers.image.created":
                         constants.DEV_BUILD_DATE,
                         "org.opencontainers.image.revision":
                         constants.DEV_BUILD_DATE,
                     },
                     "tags": [
                         f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:2020",
                         f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:{base_versions[2]}",
                         f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:preview",
                     ],
                     "output": ["type=docker"],
                 },
                 "ci-base-2019": {
                     "context":
                     ".",
                     "dockerfile":
                     "ci-base/Dockerfile",
                     "args": {
                         "ASWF_ORG": "aswflocaltesting",
                         "ASWF_PKG_ORG": "aswftesting",
                         "ASWF_VERSION": base_versions[1],
                         "CI_COMMON_VERSION": "1",
                         "DTS_VERSION": "6",
                         "PYTHON_VERSION": "2.7",
                         "VFXPLATFORM_VERSION": "2019",
                     },
                     "labels": {
                         "org.opencontainers.image.created":
                         constants.DEV_BUILD_DATE,
                         "org.opencontainers.image.revision":
                         constants.DEV_BUILD_DATE,
                     },
                     "tags": [
                         f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:2019",
                         f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:{base_versions[1]}",
                         f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:latest",
                     ],
                     "output": ["type=docker"],
                 },
             },
         },
     )