Is there a REST API for the flytectl commands by a...
# ask-the-community
s
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
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
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
hey @seunggs under the hood the command actually calls the CreateWorkflow and CreateTask endpoints
s
Oh so these endpoints create and register with remote cluster?
@katrina
So does that mean it both serializes and registers workflows/tasks?
k
Yup
k
it meaning flytectl? The endpoints only accept the serialized protos
👍 1
k
Checkout the code
👍 1
s
@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
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
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
Flyte.workflows is the python package under the source root
This implies the python package to use to find all workflows to register
s
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
In the example there is
If not don't use it
Use only your python package
162 Views