Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
|
3 years ago | |
---|---|---|
.. | ||
app | 2 years ago | |
build/k8s | 2 years ago | |
config | 2 years ago | |
lib | 2 years ago | |
plugins | 3 years ago | |
test/app | 3 years ago | |
.autod.conf.js | 4 years ago | |
.dockerignore | 3 years ago | |
.drone.yml | 3 years ago | |
.eslintignore | 4 years ago | |
.eslintrc | 4 years ago | |
.gitignore | 2 years ago | |
.travis.yml | 2 years ago | |
Dockerfile | 3 years ago | |
LICENSE | 3 years ago | |
README.md | 2 years ago | |
README.zh-CN.md | 2 years ago | |
agent.js | 3 years ago | |
app.js | 3 years ago | |
appveyor.yml | 4 years ago | |
index.js | 3 years ago | |
package-lock.json | 2 years ago | |
package.json | 2 years ago |
REST Server exposes a set of interface that allows you to manage jobs.
It is a Node.js API service base on Egg.js for cluster that deliver client requests to different upstream services,
You can see egg docs for more detail.
To run REST Server on system, a Node.js 10.15+ runtime is required, with npm installed.
|-- rest-server
|-- app
|-- controller -- used to parse the input from user, return the corresponding results after processing
|-- controllerSchema -- used to valid parameters for the input from user
|-- error -- used to define the error code
|-- extend -- used for extensions of the framework
|-- middleware -- uesd for middleware
|-- model -- used for data model by sequelizejs or other dao
|-- routes -- used to define specific routing
|-- schedule -- used to store some schduled tasks
|-- service -- used for business logic layer, optional, recommend to use
|-- tpl -- some file template for response output
|-- route.js -- used to configure URL routing rules,
|-- config
|-- config.default.js -- the default config
|-- config.local.js -- the development config
|-- config.prod.js -- the deploy config
|-- config.unitest.js -- the unitest config
|-- plugin.js -- used to configure the plugins that need to be loaded
|-- run -- runtime context configuration
|-- test -- unit test logic
|-- util -- common helper function
|-- agent.js -- used to customize the initialization agent at startup
|-- app.js -- used to customize the initialization works at startup
|-- package.json
To start a REST Server service, the following services should be ready and correctly configured.
If REST Server is need to be deployed as a standalone service in local machine, you need modify the configuration information in that config/config.local.js, and Then:
$ npm i
$ npm run dev
$ open http://localhost:9185/
# API document
$ open http://localhost:9185/public/apidoc
If REST Server is need to be deployed as a standalone service in production, some configuration items are retrieved from system environment variables in that config/config.prod.js, you need to set it up in the system environment:
EGG_SERVER_ENV
: set to prod
NODE_ENV
: set to production
K8S_API_SERVER
: the apiservice address of kubernetes cluster.K8S_CONFIG
: the path of kubeconfig, like: /home/XXX/.kube
IMAGE_FACTORY_URI
: the address of obtopus/image-factory-shield.IMAGE_FRAMEWORKBARRIER
: set to frameworkcontroller/frameworkbarrier
MYSQL_HOST
: The mysql address of obtopus/rest-server-storage.MYSQL_PORT
: The mysql port of obtopus/rest-server-storage.MYSQL_USER
: The mysql username of obtopus/rest-server-storage.MYSQL_PWD
: The mysql passowrd of obtopus/rest-server-storage.DOCKER_REGISTRY_ADDR
: the address of Docker Registry,like harbor server.DOCKER_USER
: the username of Docker Registry,like harbor server.DOCKER_PASSWORD
: the password of Docker Registry,like harbor server.ENABLED_API_DOC
: YES
or NO
.Here you need to build the project into a docker image:
$ docker build -f Dockerfile -t ${image name} .
And starting requires setting environment variables:
$ docker run -p 8195:8195 -e EGG_SERVER_ENV=prod ... -d ${image name}
If you need to run in k8s, configure it in the k8s manifest configuration file.
Modify the configuration in the file ./charts/rest-server/value.yaml
as required
// installing
helm install octopus ./charts/rest-server
After successful publication, access can be made through http://${ip}/rest-server/
REST Server is a stateless service, so it could be upgraded without any extra operation.
REST Server is a stateless service, so it could be extends for high availability without any extra operation.
@Deprecated 此仓库已弃用,请移步至 https://git.openi.org.cn/OpenI/octopus.
启智章鱼项目(OPENI-OCTOPUS)是一个集群管理和资源调度系统,支持在GPU集群中运行AI任务作业(比如深度学习任务作业)。平台提供了一系列接口,能够支持主流的深度学习框架。
JavaScript Go SVG Python JSX other