Giter Site home page Giter Site logo

New release about ormb HOT 9 CLOSED

gbolmier avatar gbolmier commented on June 14, 2024
New release

from ormb.

Comments (9)

gaocegege avatar gaocegege commented on June 14, 2024 1

SGTM

from ormb.

gaocegege avatar gaocegege commented on June 14, 2024 1

SGTM. Will do it soon.

from ormb.

gbolmier avatar gbolmier commented on June 14, 2024

Seems like the ormb-publish run failed, no binaries assets where published.

from ormb.

gaocegege avatar gaocegege commented on June 14, 2024

Yeah it is caused by the wrong go version I think. I will try to fix it.

from ormb.

gbolmier avatar gbolmier commented on June 14, 2024

Tested the new release, works like a charm! Thank you @gaocegege, would it be possible to also make a new release of the python sdk to pypi too?

from ormb.

gbolmier avatar gbolmier commented on June 14, 2024

On my side, I re-implemented the ormb.api.py module to use subprocess.run instead of subprocess.Popen so that we can propagate shell's stderr to python. I also added exceptions handling with custom exceptions. This is what it looks like for the login command:

class ORMBLoginError(Exception):
    def __init__(self, registry_name: str, username: str, stderr: str) -> None:
        msg = f"Login to {registry_name} as '{username}' failed with stderr:\n{stderr}"
        super().__init__(msg)


def login(
    hostname: str,
    username: str,
    password: str,
    registry_name: str,
) -> subprocess.CompletedProcess:
    """
    Logs in an image registry by running ORMB CLI `login` command in a subprocess.

    Args:
        hostname: Remote registry to authenticate to.
        username: Username to authenticate with.
        password: Password to authenticate with.
        registry_name: Name of the registry for error logs.

    Returns:
        The completed process.

    Raises:
        ORMBLoginError: ORMB login command process exited with a non-zero exit code.
    """
    args = [
        BIN_PATHNAME,
        "login",
        hostname,
        "--username",
        username,
        "--password-stdin",
        "--insecure",
        "False",
    ]

    try:
        return subprocess.run(
            args=args,
            capture_output=True,
            check=True,
            input=password,
            text=True,
        )
    except subprocess.CalledProcessError as e:
        raise _cli_api_exceptions.ORMBLoginError(
            registry_name=registry_name,
            username=username,
            stderr=e.stderr,
        )

If you want I could create a PR this weekend to enhance the api.py module before you make the release.

from ormb.

gaocegege avatar gaocegege commented on June 14, 2024

If you want I could create a PR this weekend to enhance the api.py module before you make the release.

I think it works for me! Thanks for the PR!

from ormb.

gaocegege avatar gaocegege commented on June 14, 2024

https://pypi.org/project/ormb/0.1.0/

from ormb.

gbolmier avatar gbolmier commented on June 14, 2024

Thx @gaocegege! Tested locally 🚀

from ormb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.