Thread
#ask-the-community
    seunggs

    seunggs

    3 months ago
    Is there a REST API for the flytectl commands by any chance? (e.g. is there an API endpoint you can hit to run something like
    flytectl create project
    instead of running it as a CLI command?)
    k

    katrina

    3 months ago
    yup! we're using grpc-gateway so that all grpc endpoints are accessible over http. in fact, the http endpoints are what flyteconsole uses. the service definition is here
    seunggs

    seunggs

    3 months ago
    Oooh ok - will check this out. Thank you!
    Hi @Ketan (kumare3) Just looking into the docs on this and can’t seem to find
    flytectl register
    commands as APIs here?
    k

    katrina

    2 months ago
    hey @seunggs under the hood the command actually calls the CreateWorkflow and CreateTask endpoints
    seunggs

    seunggs

    2 months ago
    Oh so these endpoints create and register with remote cluster?
    @katrina
    So does that mean it both serializes and registers workflows/tasks?
    Ketan (kumare3)

    Ketan (kumare3)

    2 months ago
    Yup
    k

    katrina

    2 months ago
    it meaning flytectl? The endpoints only accept the serialized protos
    Ketan (kumare3)

    Ketan (kumare3)

    2 months ago
    Checkout the code
    seunggs

    seunggs

    2 months ago
    @katrina I mean the endpoints - but ok, looks like you have to serialize first and then the endpoint just registers. @Ketan (kumare3) will browse the code here as well. Thank you both for your quick response!
    @katrina Sorry one more question regarding serialization - is there a way to do this programmatically or is the only way to serialize using
    pyflyte
    CLI?
    k

    katrina

    2 months ago
    it has to be pyflyte cli b/c it's native to the sdk and doesn't really make sense to do server-side
    seunggs

    seunggs

    2 months ago
    OK got it thank you!
    @katrina Is there a documentation for pyflyte you can point to? I can’t seem to find it anywhere in the api reference?
    In the docs for example, there’s this command:
    pyflyte --pkgs flyte.workflows package --image <registry/repo:version>
    - what is
    flyte.workflows
    here? And right after that, there’s
    flytectl register files --project flytesnacks --domain development --archive flyte-package.tgz --version v1
    Where is the
    flyte-package.tgz
    coming from?
    Ketan (kumare3)

    Ketan (kumare3)

    2 months ago
    Flyte.workflows is the python package under the source root
    This implies the python package to use to find all workflows to register
    seunggs

    seunggs

    2 months ago
    Hmm - but there is no python packaged called
    flyte
    , is there? Isn’t it
    flytekit
    ? Sorry if I’m misunderstanding what you mean by python package
    Ketan (kumare3)

    Ketan (kumare3)

    2 months ago
    In the example there is
    If not don't use it
    Use only your python package