mind-sever 搭建环境 readme

modelfoundry-server

install deps

swag

We need swag to generate

go install github.com/swaggo/swag/cmd/swag@latest

docker

follow the docs

compose

follow the docs

local-dev

Before starting:

  1. install docker compose
  2. generate your github token

Then you can start a local dev environment by:

GH_USER=yourname GH_TOKEN=yourtoken bash -ex scripts/init-env.sh

This command will launch a server listen on 127.0.0.1:8888

update swagger docs

switch into root dir of the project

swag init --parseDependency --parseInternal --instanceName rest -o api -t Organization,User,Model,ModelRestful,Space,SpaceRestful,SpaceAppRestful,BranchRestful,ActivityRestful

swag init --parseDependency --parseInternal --instanceName web -o api -t Organization,User,Session,Model,ModelWeb,Space,SpaceWeb,SpaceAppWeb,CodeRepo,ActivityWeb,SearchWeb,ComputilityWeb,Other

swag init --parseDependency --parseInternal --instanceName internal -o api -t SessionInternal,UserInternal,SpaceInternal,ModelInternal,Permission,SpaceApp,ActivityInternal,ComputilityInternal,CodeRepoInternal

update copyright comment

copyright_comment="/*
Copyright (c) Huawei Technologies Co., Ltd. 2023-2024. All rights reserved
*/"
for file in $ROOTDIR/api/*.go
do
    echo -e "$copyright_comment\n\n$(cat $file)" > $file
done

run end to end test

GH_USER=yourname GH_TOKEN=yourtoken bash -ex scripts/init-env.sh && bash scripts/openapi.sh
cd tests/e2e
go test -v ./...
posted @ 2024-06-05 21:13  易先讯  阅读(2)  评论(0编辑  收藏  举报