Skip to content

Agent software for Serving/Training Custom Image on ABEJA Platform

Notifications You must be signed in to change notification settings

abeja-inc/abeja-platform-model-proxy

Repository files navigation

abeja-platform-model-proxy

SAMPv2 Proxy

Development

Prerequisite

You need Go 1.17 or later. You should set environment variable GOPATH, and add $GOPATH/bin to PATH. (If you don't set GOPATH, Go use $HOME/go as $GOPATH)

Getting started

Setup python runtime

$ git clone git@github.com:abeja-inc/abeja-platform-model-proxy.git
$ cd abeja-platform-model-proxy

# install tools
$ go install golang.org/x/tools/cmd/goimports@latest
$ go install github.com/rakyll/statik@latest

# build samp-v2 runner
$ make build


# Install python runtime
$ pip install abejaruntime==1.1.0

# Put python handler
$ vim main.py

# Run samp-v2 with python runtime without downloading model source
./abeja-runner service run

# Send test request
$ curl localhost:5000

main.py

import http

def handler(request, context):

    # some inference process...

    content = {
        'transaction_id': 1234567890,
        'category_id': 10,
        'predictions': [],
    }
    return {
        'status_code': http.HTTPStatus.OK,
        'content_type': 'application/json; charset=utf8',
        'content': content
    }

Formatting

Using goimports. And use -local option.

$ goimports -local github.com/abeja-inc main.go

Lint

Using GolangCI-Lint.

$ make lint

Build (Old)

$ make build

Build

$ docker compose run --rm builder

Run Tests

$ make test

# includes extra test (will take time)
$ make test-all

Release (Old)

Use git-flow.

Synchronize master and develop branch.

$ git checkout master
$ git pull --rebase origin master
$ git checkout develop
$ git pull --rebase origin develop

Create release branch and prepare for release.

$ git flow release start X.X.X
# update to new version
$ vim CHANGELOG.md
$ vim version/version.go
$ git add CHANGELOG.md version/version.go
$ git commit -m "bump version"

Release.

$ git flow release finish X.X.X
$ git push origin develop
$ git push origin X.X.X
$ git push origin master

Pushing the tag to Github will automatically release the binary to Github Releases.

Release

Currently released manually

  1. tag as release
  2. create a release
  3. upload the built abeja-runner to asetts

Contribution

Feel free to ask the team directly about the best way to contribute!

gitflow branching model is used, if you have a feature you want to contribute create a feature/FEATURE-NAME branch from the "develop" branch, and issue a Pull-Request to have your feature integrated.

About

Agent software for Serving/Training Custom Image on ABEJA Platform

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages