Skip to content
/ api Public
forked from rax845163/api

API, config and standard vocabulary definitions for Alameda project

License

Notifications You must be signed in to change notification settings

mamafun/api

 
 

Repository files navigation

api

This repository defines interfaces for Alameda to access data sources and store its generated predictions and recommendations. The backend that implements these interfaces is the datahub component of Alameda. See Alameda architecture design for more details.

How to compile

We provide two ways to compile proto files: within docker environment and without docker environment.

Compile within docker environment

Run the following script to compile proto files with docker

./compile_proto_using_docker.sh

The generated code will be located in the same folder as the .proto files.

Compile without docker environment

Prerequisition

  1. Install Python3
  2. Install pip3
sudo apt-get -y install python3-pip
  1. Install Go
  2. Install protoc-gen-go
go get -u github.com/golang/protobuf/protoc-gen-go
  1. Install protoc
  2. Install the packages for generating python code
pip3 install -r requirements.txt

Compile

After above steps, run the following script to compile proto files with protoc

./compile_proto.sh

The generated code will be located in the same folder as the .proto files.

How to use

Coding with golang

Add the following import declarations in your .go files when using the Alameda API gRPC calls.

import "github.com/containers-ai/api/alameda_api/v1alpha1/ai_service"
import "github.com/containers-ai/api/alameda_api/v1alpha1/operator"

Coding with python

Install alameda-api packages by

pip install git+https://github.com/containers-ai/api.git

Then you can use Alameda API gRPC calls in your .py files by

from alameda_api.v1alpha1.ai_service import ai_service_pb2, ai_service_pb2_grpc
from alameda_api.v1alpha1.operator import server_pb2, server_pb2_grpc

About

API, config and standard vocabulary definitions for Alameda project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 89.5%
  • HTML 9.9%
  • Shell 0.6%