An open API service indexing awesome lists of open source software.

https://github.com/flyteorg/flytetools

Miscellaneous tools for Flyte contributors
https://github.com/flyteorg/flytetools

flyte testing-tools

Last synced: 11 months ago
JSON representation

Miscellaneous tools for Flyte contributors

Awesome Lists containing this project

README

          

=============
Flyte Tools
=============

This repository contains miscellaneous tools for Flyte contributors.

Tools
#######

Swagger Client Code Generator
*******************************

Because Flyte IDL takes advantage of the grpc-gateway project, the proto file generated by the Swagger gRPC generator is mostly Swagger/OpenAPI compliant. That is, we can run a code generator on top of the OpenAPI spec that's produced. See the file in ``gen/pb-go/flyteidl/service/admin.swagger.json``.

However, in generating HTTP clients from the publicly available Docker images, we found two issues. The Dockerfile in the ``swagger-codegen-cli`` directory fixes these and the final image is used in the `flyteidl generate script `__)
#. Use version 2.4.0 to solve the pointer struct fields.

To create the image ::

cd swagger-codegen-cli
make docker_build

The ``Dockerfile`` will

* Re-build ``swagger-codegen-cli.jar`` with the `fixed go template `__ using Maven ``mvn clean package``.

* Follows the pattern in the original `CLI `_ to create one with our changes.

Currently, the default host is ``localhost`` for both the clients and the version is ``1.0.0``.

The GO client can be tested creating a main file, like

.. code-block:: go

cfg := flyteadmin.NewConfiguration()
cfg.BasePath += ":30081" // default localhost.
client := flyteadmin.NewAPIClient(cfg)

// e.g. This calls the list projects endpoint.
projects, _, err := client.AdminServiceApi.ListProjects(context.Background())