dvc-gitactions icon indicating copy to clipboard operation
dvc-gitactions copied to clipboard

create deployment space with default params

Open jsaed opened this issue 3 years ago • 2 comments

https://github.com/mlops-guide/dvc-gitactions/blob/d2c018a5598ccba5fa41f94f42ceb25fd8785ebb/.infra/datapak_manage.py#L110

        if action == "create":
            infos = terraform_output()

            if len(args) == 2:
                space_name = args[1]
                space = create_deployment_space(
                    client,
                    infos["cos_crn"],
                    infos["wml_name"],
                    infos["wml_crn"],
                    space_name,
                )

            elif len(args) > 2:
                space_name = args[1]
                description = args[2]
                space = create_deployment_space(
                    client,
                    infos["cos_crn"],
                    infos["wml_name"],
                    infos["wml_crn"],
                    space_name,
                    description,
                )

            space = create_deployment_space(
                client,
                infos["cos_crn"],
                infos["wml_name"],
                infos["wml_crn"]
            )
            pprint(space)

jsaed avatar Jan 31 '22 09:01 jsaed

Hello @jsaed, thank for your contribution. I this case, when len(ars) >= 2 create_deployment_space would run twice.

if action == "create":
            infos = terraform_output()

            if len(args) == 2:
                # Space Name only
                space_name = args[1]
                space = create_deployment_space(
                    client,
                    infos["cos_crn"],
                    infos["wml_name"],
                    infos["wml_crn"],
                    space_name,
                )

            elif len(args) > 2:
                # Space Name and Description
                space_name = args[1]
                description = args[2]
                space = create_deployment_space(
                    client,
                    infos["cos_crn"],
                    infos["wml_name"],
                    infos["wml_crn"],
                    space_name,
                    description,
                )
           elif (len(ars)) < 2:
              # Default params
              space = create_deployment_space(
                  client,
                  infos["cos_crn"],
                  infos["wml_name"],
                  infos["wml_crn"]
              )
            pprint(space)

arthurolga avatar Jan 31 '22 13:01 arthurolga

thanks @arthurolga - ok looks good please add

jsaed avatar Jan 31 '22 13:01 jsaed