https://github.com/grycap/oscar-cli
A command line interface to easily interact with OSCAR clusters
https://github.com/grycap/oscar-cli
cli faas kubernetes oscar serverless
Last synced: 7 months ago
JSON representation
A command line interface to easily interact with OSCAR clusters
- Host: GitHub
- URL: https://github.com/grycap/oscar-cli
- Owner: grycap
- License: apache-2.0
- Created: 2021-03-10T11:46:39.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-28T16:08:43.000Z (over 1 year ago)
- Last Synced: 2024-05-29T02:07:42.140Z (over 1 year ago)
- Topics: cli, faas, kubernetes, oscar, serverless
- Language: Go
- Homepage:
- Size: 962 KB
- Stars: 1
- Watchers: 8
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://github.com/grycap/oscar-cli/actions/workflows/main.yaml)
[](https://goreportcard.com/report/github.com/grycap/oscar-cli)
[](https://pkg.go.dev/github.com/grycap/oscar-cli)
[](https://github.com/grycap/oscar-cli/blob/main/LICENSE)OSCAR-CLI provides a command line interface to interact with [OSCAR](https://github.com/grycap/oscar) clusters in a simple way. It supports service management, workflows definition from FDL (Functions Definition Language) files and the ability to manage files from OSCAR's compatible storage providers (MinIO, Amazon S3 and Onedata). The folder [`example-workflow`](https://github.com/grycap/oscar-cli/tree/main/example-workflow) contains all the necessary files to create a simple workflow to test the tool.
## Download
### Releases
The easy way to download OSCAR-CLI is through the github [releases page](https://github.com/grycap/oscar-cli/releases). There are binaries for multiple platforms and OS. If you need a binary for another platform, please open an [issue](https://github.com/grycap/oscar-cli/issues).
### Install from source
If you have [go](https://golang.org/doc/install) installed and [configured](https://github.com/golang/go/wiki/SettingGOPATH), you can get it from source directly by executing:
```sh
go install github.com/grycap/oscar-cli@latest
```## Available commands
The documentation is available on [OSCAR's web for CLI](https://docs.oscar.grycap.net/oscar-cli/). A [video tutorial](https://youtu.be/itaKJyd9QX4) is available on YouTube.
- [apply](#apply)
- [cluster](#cluster)
- [add](#add)
- [default](#default)
- [info](#info)
- [list](#list)
- [remove](#remove)
- [service](#service)
- [get](#get)
- [list](#list-1)
- [remove](#remove-1)
- [run](#run)
- [logs list](#logs-list)
- [logs get](#logs-get)
- [logs remove](#logs-remove)
- [get-file](#get-file)
- [put-file](#put-file)
- [list-files](#list-files)
- [version](#version)
- [help](#help)### apply
Apply a FDL file to create or edit services in clusters.
```
Usage:
oscar-cli apply FDL_FILE [flags]Aliases:
apply, aFlags:
--config string set the location of the config file (YAML or JSON)
-h, --help help for apply
```### cluster
Manages the configuration of clusters.
#### Subcommands
##### add
Add a new existing cluster to oscar-cli.
```
Usage:
oscar-cli cluster add IDENTIFIER ENDPOINT {USERNAME {PASSWORD | --password-stdin} | --oidc-account-name ACCOUNT} [flags]Aliases:
add, aFlags:
--disable-ssl disable verification of ssl certificates for the added cluster
-h, --help help for add
-o, --oidc-account-name string OIDC account name to authenticate using oidc-agent. Note that oidc-agent must be started and properly configured
(See: https://indigo-dc.gitbook.io/oidc-agent/)
--password-stdin take the password from stdinGlobal Flags:
--config string set the location of the config file (YAML or JSON)
```##### default
Show or set the default cluster.
```
Usage:
oscar-cli cluster default [flags]Aliases:
default, dFlags:
-h, --help help for default
-s, --set string set a default cluster by passing its IDENTIFIERGlobal Flags:
--config string set the location of the config file (YAML or JSON)
```##### info
Show information of an OSCAR cluster.
```
Usage:
oscar-cli cluster info [flags]Aliases:
info, iFlags:
-c, --cluster string set the cluster
-h, --help help for infoGlobal Flags:
--config string set the location of the config file (YAML or JSON)
```##### list
List the configured OSCAR clusters.
```
Usage:
oscar-cli cluster list [flags]Aliases:
list, lsFlags:
-h, --help help for listGlobal Flags:
--config string set the location of the config file (YAML or JSON)
```##### remove
Remove a cluster from the configuration file.
```
Usage:
oscar-cli cluster remove IDENTIFIER [flags]Aliases:
remove, rmFlags:
-h, --help help for removeGlobal Flags:
--config string set the location of the config file (YAML or JSON)
```### service
Manages the services within a cluster.
#### Subcommands
##### get
Get the definition of a service.
```
Usage:
oscar-cli service get SERVICE_NAME [flags]Aliases:
get, gFlags:
-c, --cluster string set the cluster
-h, --help help for getGlobal Flags:
--config string set the location of the config file (YAML or JSON)
```##### list
List the available services in a cluster.
```
Usage:
oscar-cli service list [flags]Aliases:
list, lsFlags:
-c, --cluster string set the cluster
-h, --help help for listGlobal Flags:
--config string set the location of the config file (YAML or JSON)
```##### remove
Remove a service from the cluster.
```
Usage:
oscar-cli service remove SERVICE_NAME... [flags]Aliases:
remove, rmFlags:
-c, --cluster string set the cluster
-h, --help help for removeGlobal Flags:
--config string set the location of the config file (YAML or JSON)
```##### run
Invoke a service synchronously (a Serverless backend in the cluster is required).
```
Usage:
oscar-cli service run SERVICE_NAME {--input | --text-input} [flags]Aliases:
run, invoke, rFlags:
-c, --cluster string set the cluster
-h, --help help for run
-i, --input string input file for the request
-o, --output string file path to store the output
-t, --text-input string text input string for the requestGlobal Flags:
--config string set the location of the config file (YAML or JSON)
```##### logs list
List the logs from a service.
```
Usage:
oscar-cli service logs list SERVICE_NAME [flags]Aliases:
list, lsFlags:
-h, --help help for list
-s, --status strings filter by status (Pending, Running, Succeeded or Failed), multiple values can be specified by a comma-separated stringGlobal Flags:
-c, --cluster string set the cluster
--config string set the location of the config file (YAML or JSON)
```##### logs get
Get the logs from a service's job.
```
Usage:
oscar-cli service logs get SERVICE_NAME JOB_NAME [flags]Aliases:
get, gFlags:
-h, --help help for get
-t, --show-timestamps show timestamps in the logsGlobal Flags:
-c, --cluster string set the cluster
--config string set the location of the config file (YAML or JSON)
```##### logs remove
Remove a service's job along with its logs.
```
Usage:
oscar-cli service logs remove SERVICE_NAME {JOB_NAME... | --succeeded | --all} [flags]Aliases:
remove, rmFlags:
-a, --all remove all logs from the service
-h, --help help for remove
-s, --succeeded remove succeeded logs from the serviceGlobal Flags:
-c, --cluster string set the cluster
--config string set the location of the config file (YAML or JSON)
```##### get-file
Get a file from a service's storage provider.
The STORAGE_PROVIDER argument follows the format STORAGE_PROVIDER_TYPE.STORAGE_PROVIDER_NAME,
being the STORAGE_PROVIDER_TYPE one of the three supported storage providers (MinIO, S3 or Onedata)
and the STORAGE_PROVIDER_NAME is the identifier for the provider set in the service's definition.```
Usage:
oscar-cli service get-file SERVICE_NAME STORAGE_PROVIDER REMOTE_FILE LOCAL_FILE [flags]Aliases:
get-file, gfFlags:
-c, --cluster string set the cluster
-h, --help help for get-fileGlobal Flags:
--config string set the location of the config file (YAML or JSON)
```##### put-file
Put a file in a service's storage provider.
The STORAGE_PROVIDER argument follows the format STORAGE_PROVIDER_TYPE.STORAGE_PROVIDER_NAME,
being the STORAGE_PROVIDER_TYPE one of the three supported storage providers (MinIO, S3 or Onedata)
and the STORAGE_PROVIDER_NAME is the identifier for the provider set in the service's definition.```
Usage:
oscar-cli service put-file SERVICE_NAME STORAGE_PROVIDER LOCAL_FILE REMOTE_FILE [flags]Aliases:
put-file, pfFlags:
-c, --cluster string set the cluster
-h, --help help for put-fileGlobal Flags:
--config string set the location of the config file (YAML or JSON)
```##### list-files
List files from a service's storage provider path.
The STORAGE_PROVIDER argument follows the format STORAGE_PROVIDER_TYPE.STORAGE_PROVIDER_NAME,
being the STORAGE_PROVIDER_TYPE one of the three supported storage providers (MinIO, S3 or Onedata)
and the STORAGE_PROVIDER_NAME is the identifier for the provider set in the service's definition.```
Usage:
oscar-cli service list-files SERVICE_NAME STORAGE_PROVIDER REMOTE_PATH [flags]Aliases:
list-files, list-file, lsfFlags:
-c, --cluster string set the cluster
-h, --help help for list-filesGlobal Flags:
--config string set the location of the config file (YAML or JSON)
```### version
Print the version.
```
Usage:
oscar-cli version [flags]Aliases:
version, vFlags:
-h, --help help for version
```### help
Help provides help for any command in the application.
Simply type oscar-cli help [path to command] for full details.```
Usage:
oscar-cli help [command] [flags]Flags:
-h, --help help for help
```