https://flyte.org logo
#ask-the-community
Title
# ask-the-community
s

seunggs

06/23/2022, 10:23 PM
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

06/23/2022, 10:29 PM
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
s

seunggs

06/23/2022, 10:30 PM
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

07/08/2022, 4:23 PM
hey @seunggs under the hood the command actually calls the CreateWorkflow and CreateTask endpoints
s

seunggs

07/08/2022, 4:23 PM
Oh so these endpoints create and register with remote cluster?
@katrina
So does that mean it both serializes and registers workflows/tasks?
k

Ketan (kumare3)

07/08/2022, 4:31 PM
Yup
k

katrina

07/08/2022, 4:31 PM
it meaning flytectl? The endpoints only accept the serialized protos
👍 1
k

Ketan (kumare3)

07/08/2022, 4:32 PM
Checkout the code
👍 1
s

seunggs

07/08/2022, 4:33 PM
@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!
🙏 1
@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

07/08/2022, 7:33 PM
it has to be pyflyte cli b/c it's native to the sdk and doesn't really make sense to do server-side
s

seunggs

07/08/2022, 9:56 PM
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?
k

Ketan (kumare3)

07/13/2022, 4:21 AM
Flyte.workflows is the python package under the source root
This implies the python package to use to find all workflows to register
s

seunggs

07/13/2022, 4:24 AM
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
k

Ketan (kumare3)

07/13/2022, 6:06 AM
In the example there is
If not don't use it
Use only your python package
27 Views