forked from inference-gateway/inference-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
118 lines (103 loc) · 4.63 KB
/
Copy pathTaskfile.yml
File metadata and controls
118 lines (103 loc) · 4.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
---
version: "3"
tasks:
default:
desc: "Show available tasks"
cmds:
- task --list
mcp-schema-download:
desc: "Download the latest MCP schema and convert to YAML"
cmds:
- curl -o mcp/mcp-schema.json https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/refs/heads/main/schema/draft/schema.json
- |
echo "Converting JSON schema to YAML format"
NODE_PATH=/usr/lib/node_modules node -e "
const fs = require('fs');
const yaml = require('js-yaml');
const json = JSON.parse(fs.readFileSync('mcp/mcp-schema.json', 'utf8'));
fs.writeFileSync('mcp/mcp-schema.yaml', yaml.dump(json, {lineWidth: -1}));
"
a2a-schema-download:
desc: "Download the latest A2A schema and convert to YAML"
cmds:
- curl -o a2a/a2a-schema.json https://raw.githubusercontent.com/google-a2a/A2A/main/specification/json/a2a.json
- |
echo "Converting A2A JSON schema to YAML format"
NODE_PATH=/usr/lib/node_modules node -e "
const fs = require('fs');
const yaml = require('js-yaml');
const json = JSON.parse(fs.readFileSync('a2a/a2a-schema.json', 'utf8'));
fs.writeFileSync('a2a/a2a-schema.yaml', yaml.dump(json, {lineWidth: -1}));
"
install:generator:
desc: "Install the generator tool"
cmds:
- go install github.com/inference-gateway/tools/cmd/generator@v0.1.1
generate:
desc: "Generate the gateway from OpenAPI Spec"
deps:
- install:generator
cmds:
- go run cmd/generate/main.go -type ProvidersClientConfig -output providers/client.go
# TODO - migrate to an existing tool that generate the types from OpenAPI spec schemas
# - go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest --package=providers --generate types -o providers/common_types.go openapi.yaml
- go run cmd/generate/main.go -type ProvidersCommonTypes -output providers/common_types.go
# - go run cmd/generate/main.go -type Providers -output providers
- go run cmd/generate/main.go -type Config -output config/config.go
- go run cmd/generate/main.go -type MD -output Configurations.md
- go run cmd/generate/main.go -type HelmSecret -output charts/inference-gateway/templates/secrets-defaults.yaml
- go run cmd/generate/main.go -type HelmConfigMap -output charts/inference-gateway/templates/configmap-defaults.yaml
- go run cmd/generate/main.go -type HelmValues -output charts/inference-gateway/values.yaml
- go run cmd/generate/main.go -type Env -output examples/docker-compose/basic/.env.example
- go run cmd/generate/main.go -type Env -output examples/docker-compose/hybrid/.env.example
- go run cmd/generate/main.go -type Env -output examples/docker-compose/tools/.env.example
- go run cmd/generate/main.go -type Env -output examples/docker-compose/ui/.env.backend.example
- go run cmd/generate/main.go -type Env -output examples/docker-compose/authentication/.env.example
- go run cmd/generate/main.go -type Env -output examples/docker-compose/mcp/.env.example
- go run cmd/generate/main.go -type Env -output examples/docker-compose/a2a/.env.example
- generator -generator jsonrpc -package a2a a2a/a2a-schema.yaml a2a/generated_types.go
- generator -generator jsonrpc -package mcp mcp/mcp-schema.yaml mcp/generated_types.go
- go generate ./providers/... ./api/... ./otel/... ./logger/... ./mcp/... ./a2a/...
tidy:
desc: "Tidy the gateway"
cmds:
- find . -name 'go.mod' -execdir go mod tidy \;
build:
desc: "Build the gateway"
cmds:
- go build -o bin/inference-gateway cmd/gateway/main.go
build:container:
desc: "Build the gateway container"
cmds:
- docker build -t inference-gateway .
run:
desc: "Run the gateway"
cmds:
- go run cmd/gateway/main.go
lint:
desc: "Run Go static analysis and linting"
cmds:
- golangci-lint run
openapi-lint:
desc: "Lint OpenAPI spec"
cmds:
- spectral lint --verbose openapi.yaml
test:
desc: "Run tests"
cmds:
- go test -v ./...
benchmark:
desc: "Run benchmarks"
cmds:
- go test -bench=. -run=^$ -benchmem -benchtime=100x -count=20 ./tests/...
package:
desc: "Package the gateway"
cmds:
- docker build -t inference-gateway .
release-dry-run:
desc: "Run a dry-run of both semantic-release and goreleaser"
cmds:
- echo "Running semantic-release dry run..."
- semantic-release --dry-run
- echo "Running goreleaser dry run..."
- goreleaser release --config .goreleaser.yaml --clean --snapshot --verbose