ml-metadata-go-server

command module
v0.0.0-...-35e449e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

README

ml-metadata-go-server

A go based server that implements a gRPC interface for ml_metadata library. It adds other features on top of the functionality offered by the gRPC interface.

Pre-requisites:

go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
  • python 3.9

Building

Run the following command to build the server binary:

make build

The generated binary uses spf13 cmdline args. More information on using the server can be obtained by running the command:

./ml-metadata-go-server --help

Creating/Migrating Server DB

The server uses a local SQLite DB file (metadata.sqlite.db by default), which can be configured using the -d cmdline option. The following command creates the DB:

./ml-metadata-go-server migrate
Loading metadata library

Run the following command to load a metadata library:

./ml-metadata-go-server migrate -m config/metadata-library

Note that currently no duplicate detection is done as the implementation is a WIP proof of concept. Running this command multiple times will create duplicate metadata types. To clear the DB simply delete the SQLite DB file metadata.sqlite.db.

Running Server

Run the following command to start the server:

make run/server &
Running Python ml-metadata test client

Before running the test client, install the required Python libraries (using a python venv, if using one) using the command:

pip install ml_metadata grpcio

Run the following command to run the ml-metadata Python test client:

make run/client
Running GraphQL Playground

This project includes support for a GraphiQL playground, which supports interactive query design. It can be reached by opening the following URL in a web browser:

http://localhost:8080/

Where, 8080 is the default port that the server listens on. This port can be changed with the -p option.

Clean

Run the following command to clean the DB file, generated gRPC and GraphQL models, etc.:

make clean

Documentation

Overview

Copyright © 2023 Dhiraj Bokde dhirajsb@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
model
db
library
Install go-enum by `go get install github.com/searKing/golang/tools/go-enum`
Install go-enum by `go get install github.com/searKing/golang/tools/go-enum`

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL