UCF Application Builder CLI
The UCF Application Builder CLI tool can be used to create and build applications. It can be used to list and view information about available microservices and perform a few NGC repository operations.
The tool is named ucf_app_builder_cli
.
Basic Operations
Viewing Help
$ ucf_app_builder_cli -h
usage: ucf_app_builder_cli [-h] [-v] [-va] ...
positional arguments:
app Perform actions on apps
service Perform actions on a microservice
registry Perform actions on registry
optional arguments:
-h, --help show this help message and exit
-v, --version Print MS Builder Version
-va, --version-all Print all versions
Checking the Tool Version
$ ucf_app_builder_cli -v
Version:
App Builder : v2.0.0
$ ucf_app_builder_cli --version-all
Versions:
App Builder: v2.0.0
UCF MS Spec: v2.0.0
Application Command app
Application command app
can be used to create and build applications.
$ ucf_app_builder_cli app -h
usage: ucf_app_builder_cli app [-h] ...
positional arguments:
create Create UCF application graph boilerplate
build Build application from graph file and export to helm chart
export-ms Create a microservice from the application
optional arguments:
-h, --help show this help message and exit
Create Application Boilerplate
ucf_app_builder_cli app create [-h] [-o OUTPUT_DIR] name
positional arguments:
name Application Name
optional arguments:
-h, --help show this help message and exit
-o OUTPUT_DIR Directory where the application should be created
e.g.
$ ucf_app_builder_cli app create my-application
Building an Application
ucf_app_builder_cli app build [-h] [-o OUTPUT_DIR] [--ignore-validation-errors]
[--keep-app-specs] [-f]
[-v VALUE-OVERRIDE] [--generate-params-override]
[--force-prod]
app [params [params ...]]
positional arguments:
app UCF Application Graph File or Directory Containing app.yaml
params UCF Application Graph Parameters Files
optional arguments:
-h, --help show this help message and exit
-o OUTPUT_DIR Directory to build the application in
--ignore-validation-errors
Ignore validation errors and build applicatoin
--keep-app-specs Retain app-specs used to create the application helmchart
-f, --force-cleanup Output directory contents will be cleaned up without user confirmation
-v VALUE-OVERRIDE, --value-override VALUE-OVERRIDE
Input that provides the default values in the output value override file
--generate-params-override
Generate override values for those impacted by parameter file
--force-prod Only microservices that are in prod should be selected
e.g.
$ ucf_app_builder_cli app build app.yaml params.yaml
Exporting an Application as a microservice
ucf_app_builder_cli app export-ms [-h] [-o OUTPUT_DIR] [--ignore-validation-errors] [-f] [--force-prod] -e EXPORT_INFO app [params [params ...]]
positional arguments:
app UCF Application Graph File or Directory Containing app.yaml
params UCF Application Graph Parameters Files
optional arguments:
-h, --help show this help message and exit
-o OUTPUT_DIR Directory to export the microservice in
--ignore-validation-errors
Ignore validation errors and build application
-f, --force-cleanup Output directory contents will be cleaned up without user confirmation
--force-prod Only microservices that are in prod should be selected
-e EXPORT_INFO File containing additional user input required to export the application as a microservice
Service Command service
The Service command service
can be used to list and view information about available microservices.
$ ucf_app_builder_cli service -h
usage: ucf_app_builder_cli service [-h] ...
positional arguments:
list List microservices
versions List versions of a microservice
info Info about a microservice
sync Sync a microservice from NGC to cache
optional arguments:
-h, --help show this help message and exit
List Available Microservices
ucf_app_builder_cli service list [-h] [-r REPO_NAME]
optional arguments:
-h, --help show this help message and exit
-r REPO_NAME, --repo-name REPO_NAME
Select an repository name
e.g.
$ ucf_app_builder_cli service list
List Available Microservice Versions
ucf_app_builder_cli service versions [-h] -n NAME [-r REPO_NAME]
optional arguments:
-h, --help show this help message and exit
-n NAME, --name NAME Name of the microservice
-r REPO_NAME, --repo-name REPO_NAME
Select an repository name
e.g.
$ ucf_app_builder_cli service versions -n ucf.svc.myservice
View Microservice Information
ucf_app_builder_cli service info [-h] [-v MS-VERSION] [--show-compliance-details] [--show-license] [--show-docs]
[--show-changelog] -n NAME
optional arguments:
-h, --help show this help message and exit
-v MS-VERSION, --version MS-VERSION
Version of the microservice to get info for
--show-compliance-details
Show compliance check details for the microservice
--show-license Show license text for the microservice
--show-docs Show detailed documentation for the microservice
--show-changelog Show changelog for the microservice
required arguments:
-n NAME, --name NAME name of the ms
e.g.
$ ucf_app_builder_cli service info -n ucf.svc.myservice -v 0.0.1
Synchronize a Microservice
ucf_app_builder_cli service sync [-h] -n NAME [-v MS-VERSION]
optional arguments:
-h, --help show this help message and exit
-v MS-VERSION, --version MS-VERSION
Version of the microservice to sync (default: latest)
required arguments:
-n NAME, --name NAME Name of the microservice to sync
e.g.
$ ucf_app_builder_cli service sync -n ucf.svc.myservice -v 0.0.1
Registry Command registry
The Registry command registry
can be used to perform various registry operations such as set the NGC API Key, sync all microservices
from a NGC repository, cache management.
$ ucf_app_builder_cli registry -h
usage: ucf_app_builder_cli registry [-h] ...
positional arguments:
repo Registry repository operations
cache Registry cache operations
optional arguments:
-h, --help show this help message and exit
Set NGC API Key
ucf_app_builder_cli registry repo set-api-key [-h] -a API_KEY
optional arguments:
-h, --help show this help message and exit
required arguments:
-a API_KEY, --api-key API_KEY
Select a API key
e.g.
ucf_app_builder_cli registry repo set-api-key -a XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
List Available Repositories
ucf_app_builder_cli registry repo list [-h]
optional arguments:
-h, --help show this help message and exit
e.g.
ucf_app_builder_cli registry repo list
View Information for a Repository
ucf_app_builder_cli registry repo info [-h] -n REPO_NAME
optional arguments:
-h, --help show this help message and exit
required arguments:
-n REPO_NAME, --repo-name REPO_NAME
Select an repository name
e.g.
ucf_app_builder_cli registry repo info -n public
Synchronize All Microservices in a Repository
ucf_app_builder_cli registry repo sync [-h] -n REPO_NAME [-a]
optional arguments:
-h, --help show this help message and exit
-a, --all Sync all versions of a microservice
required arguments:
-n REPO_NAME, --repo-name REPO_NAME
Select an repository name
e.g.
ucf_app_builder_cli registry repo sync -n public
Clear Local Repository
ucf_app_builder_cli registry repo clear [-h]
optional arguments:
-h, --help show this help message and exit
e.g.
ucf_app_builder_cli registry repo clear
Set the Registry Cache Path
ucf_app_builder_cli registry cache set [-h] -p CACHE_PATH
optional arguments:
-h, --help show this help message and exit
required arguments:
-p CACHE_PATH, --cache-path CACHE_PATH
Select a cache path
e.g.
ucf_app_builder_cli registry cache set -p /home/ubuntu/ucf_cache
View the Registry Cache Path
ucf_app_builder_cli registry cache view [-h]
optional arguments:
-h, --help show this help message and exit
e.g.
ucf_app_builder_cli registry cache view
Clear the Registry Cache
ucf_app_builder_cli registry cache clear [-h]
optional arguments:
-h, --help show this help message and exit
e.g.
ucf_app_builder_cli registry cache clear