Files
kserve/tools/tf2openapi/DEVELOPER_GUIDE.md
Christian KadnerandGitHub 5a35acfaf8 Add script to identify broken links (#2423)
* chore: Add script to identify broken links

* Find all Markdown files in the project
* Extract all Markdown-style links and plain URLs
* Create unique list of simplified URLs
* Use local files to check relative links, use cached
  HTTP requests for links going outside the project
* Run HTTP requests in parallel
* Retry GitHub rate-limited URLs after one minute
* Report broken links with source file and line number

Signed-off-by: Christian Kadner <[email protected]>

* Add check-doc-links target to Makefile

Signed-off-by: Christian Kadner <[email protected]>

* Fix broken links

Signed-off-by: Christian Kadner <[email protected]>

* lint

Signed-off-by: Christian Kadner <[email protected]>

* Refine URL exclusions

Signed-off-by: Christian Kadner <[email protected]>

* Fix a few more broken links

Signed-off-by: Christian Kadner <[email protected]>

* Revert unintended link change

Signed-off-by: Christian Kadner <[email protected]>

* Revert unintended link changes

Signed-off-by: Christian Kadner <[email protected]>

* Run codegen

Signed-off-by: Christian Kadner <[email protected]>

Signed-off-by: Christian Kadner <[email protected]>
2022-09-18 18:14:28 -07:00

1.7 KiB

Development

This doc explains how to setup your developer environment to contribute to Tf2OpenAPI.

Prerequisites

Install requirements

  1. go: Tf2OpenAPI is written in Go.
  2. git: For source control.
  3. dep: For managing external Go dependencies.
  4. protoc: For compiling protobufs.
  5. protoc-gen-go: For using protobufs with Go.

Setup your environment

To start your environment you'll need to set these environment variables (we recommend adding them to your .bashrc):

  1. GOPATH: If you don't have one, simply pick a directory (e.g. $HOME/go) and add export GOPATH=...
  2. $GOPATH/bin on PATH: This is so that tooling installed via go get will work properly. For example, this allows protoc to use protoc-gen-go.

Potential Issues and Solutions

  • When extending Tf2OpenAPI to support future versions of TensorFlow (> 1.13.1), you may encounter a seemingly circular dependency in the compiled protos and/or the Go tool may complain that there are multiple Go packages in one directory. It's possible that certain TensorFlow protos aren't compiled correctly because they lack the field option go_package. File an issue in the TensorFlow repository to add that field.
  • To make dependencies persist without importing them (e.g. TensorFlow when only using the protos), add them as required to the Gopkg.toml.
required = ["github.com/foo/bar/..] # this must be a package/subpackage containing Go code

See how TensorFlow is added as a dependency in Gopkg.toml in the top level for an example.