mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-06-23 04:10:25 +00:00
@@ -1,12 +1,12 @@
|
||||
BUILD_DIR = build
|
||||
SERVICES = agent
|
||||
SERVICES = cli
|
||||
CGO_ENABLED ?= 0
|
||||
GOARCH ?= amd64
|
||||
VERSION ?= $(shell git describe --abbrev=0 --tags)
|
||||
COMMIT ?= $(shell git rev-parse HEAD)
|
||||
TIME ?= $(shell date +%F_%T)
|
||||
CLI_SOURCE = ./cmd/cli/main.go
|
||||
AGENT_CLI_PATH = ${BUILD_DIR}/agent-cli
|
||||
CLI_BIN = ${BUILD_DIR}/cli
|
||||
|
||||
define compile_service
|
||||
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) \
|
||||
@@ -22,16 +22,8 @@ endef
|
||||
$(SERVICES):
|
||||
$(call compile_service,$(@))
|
||||
|
||||
agent-cli: $(CLI_SOURCE)
|
||||
CGO_ENABLED=$(CGO_ENABLED) GOARCH=$(GOARCH) \
|
||||
go build -mod=vendor -ldflags "-s -w \
|
||||
-X 'github.com/ultravioletrs/cocos/internal/http.BuildTime=$(TIME)' \
|
||||
-X 'github.com/ultravioletrs/cocos/internal/http.Version=$(VERSION)' \
|
||||
-X 'github.com/ultravioletrs/cocos/internal/http.Commit=$(COMMIT)'" \
|
||||
-o ${AGENT_CLI_PATH} $(CLI_SOURCE)
|
||||
|
||||
install: agent-cli
|
||||
cp ${AGENT_CLI_PATH} ~/.local/bin
|
||||
install-cli: cli
|
||||
cp ${CLI_BIN} ~/.local/bin
|
||||
|
||||
QCOW2_PATH = ~/go/src/github.com/ultravioletrs/manager/cmd/manager/img/boot.img
|
||||
|
||||
@@ -59,5 +51,3 @@ copy-agent-rc-sh:
|
||||
|
||||
protoc:
|
||||
protoc -I. --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative agent/agent.proto
|
||||
|
||||
|
||||
|
||||
+6
-48
@@ -1,13 +1,13 @@
|
||||
# Agent CLI
|
||||
|
||||
This repository contains the command-line interface (CLI) tool for interacting with the UltraVioletrs Agent service. The CLI allows you to perform various tasks such as running computations, uploading algorithms and datasets, and retrieving results.
|
||||
This repository contains the command-line interface (CLI) tool for interacting with the Agent service. The CLI allows you to perform various tasks such as running computations, uploading algorithms and datasets, and retrieving results.
|
||||
|
||||
## Build
|
||||
|
||||
From the project root:
|
||||
|
||||
```bash
|
||||
make agent-cli
|
||||
make cli
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -17,7 +17,7 @@ make agent-cli
|
||||
To run a computation, use the following command:
|
||||
|
||||
```bash
|
||||
./build/agent-cli run --computation '{"name": "my-computation"}'
|
||||
./build/cocos-cli run --computation '{"name": "my-computation"}'
|
||||
```
|
||||
|
||||
#### Upload Algorithm
|
||||
@@ -25,7 +25,7 @@ To run a computation, use the following command:
|
||||
To upload an algorithm, use the following command:
|
||||
|
||||
```bash
|
||||
./build/agent-cli algo /path/to/algorithm
|
||||
./build/cocos-cli algo /path/to/algorithm
|
||||
```
|
||||
|
||||
#### Upload Dataset
|
||||
@@ -33,7 +33,7 @@ To upload an algorithm, use the following command:
|
||||
To upload a dataset, use the following command:
|
||||
|
||||
```bash
|
||||
./build/agent-cli data /path/to/dataset.csv
|
||||
./build/cocos-cli data /path/to/dataset.csv
|
||||
```
|
||||
|
||||
#### Retrieve result
|
||||
@@ -41,47 +41,5 @@ To upload a dataset, use the following command:
|
||||
To retrieve the computation result, use the following command:
|
||||
|
||||
```bash
|
||||
./build/agent-cli result
|
||||
./build/cocos-cli result
|
||||
```
|
||||
|
||||
## Installtion
|
||||
|
||||
If you want to install the CLI globally, you can use the following command:
|
||||
|
||||
```bash
|
||||
sudo cp build/agent-cli /usr/local/bin/
|
||||
```
|
||||
|
||||
This will make the agent-cli executable available from any location in your terminal.
|
||||
|
||||
#### Run Computation
|
||||
|
||||
To run a computation, use the following command:
|
||||
|
||||
```bash
|
||||
agent-cli run --computation '{"name": "my-computation"}'
|
||||
```
|
||||
|
||||
#### Upload Algorithm
|
||||
|
||||
To upload an algorithm, use the following command:
|
||||
|
||||
```bash
|
||||
agent-cli algorithm /path/to/algorithm
|
||||
```
|
||||
|
||||
#### Upload Dataset
|
||||
|
||||
To upload a dataset, use the following command:
|
||||
|
||||
```bash
|
||||
agent-cli dataset /path/to/dataset.csv
|
||||
```
|
||||
|
||||
#### Retrieve result
|
||||
|
||||
To retrieve the computation result, use the following command:
|
||||
|
||||
```bash
|
||||
agent-cli result
|
||||
```
|
||||
Reference in New Issue
Block a user