Seaplane CLI
Seaplane provides users the following commands to seamlessly get started:
Command Name | Description |
---|---|
init | Create a new Seaplane project that has a default project file structure. Click here for more information on creating a new project and the default file structure. |
build | Build the Seaplane project, which creates the project zip file and build folder. |
deploy | Build the Seaplane project and deploy your project on Seaplane's infrastructure. |
destroy | Destroy the running tasks of your application. Please note that changing your tasks' names in between a seaplane deploy and seaplane destroy will orphan the renamed tasks. The destroy command only destroys the tasks by their task name in your project. |
status | Shows the dataflow of a deployed application including the number of messages in and out per task. Learn more by going to Application Status. Please note that message counts do not reset when apps are redeployed. |
status -w | Automatically refreshes to show the status every 2 seconds. Please note that you must have watch installed on your machine or virtual environment to use this command. For macOS download Homebrew from their website and run brew install watch to complete the installation of watch. |
request | Send data to the application entry point. Returns a request ID, which can be used to identify that specific request and retrieve the output. |
response | By default seaplane response gets the last request's data from the response endpoint. Alternatively, you can get a specific request's response by including its ID as seaplane response -r <request-id> or seaplane response --request_id <request-id> |
--version | Returns the installed Seaplane version on your machine or in your virtual environment. |
--help | Returns all available Seaplane commands. |
seaplane initโ
Run seaplane init <my-seaplane-project>
command. This will create a new Seaplane project with a default project file structure. For more information on the default project file structure click here.
- Command Line
- Expected Output
seaplane init <my-seaplane-project>
๐ฉ๏ธ <my-seaplane-project> project generated successfully!
seaplane buildโ
Inside your Seaplane project root directory use the command seaplane build
to build the application. This creates the build folder, schema.json, and project zip that are used by the Seaplane platform to deploy your app. Learn more about applications here.
Please note to run poetry lock
and poetry install
if this is the first time you are building and deploying your application or if you made any changes to your pyproject.toml file.
- Command Line
- Expected Output
seaplane build
[Seaplane]
Seaplane Apps <version_number>
[Seaplane] โ๏ธ Assign Task process-data to App: <app_name>-processor-application
{"apps": {"<app_name>-processor-application": {"id": "<app_name>-processor-application", "entry_point": {"type": "API", "parameters": []}, "tasks": [{"id": "process-data", "name": "process_data", "replicas": 1, "ack_wait": 2}], "io": {"entry_point": ["process-data"], "returns": "process-data"}}}, "carrier_endpoint": "https://carrier.cplane.cloud/v1", "identity_endpoint": "https://flightdeck.cplane.cloud/v1"}
seaplane deployโ
Deploys an application on Seaplane's infrastructure when executed inside a Seaplane project root directory.
- Command Line
- Expected Output
seaplane deploy
[Seaplane] ๐ Deployment complete
seaplane destroyโ
Destroys an application and its associated tasks. seaplane destroy
deletes all infrastructure associated with this application with the exception of persistent data stores.
This command will destroy tasks by their unique task names that were defined prior to seaplane deploy
.
If you run seaplane deploy
, change a task name, and run seaplane destroy
, then the changed task name is not destroyed. That task is now an orphan. To avoid ongoing tasks change a task's name prior to seaplane deploy
to ensure that seaplane destroy
removes the application and its associated tasks.
You can use seaplane status
to verify that the previous tasks that you had run are now completed.
- Command Line
- Expected Output
seaplane destroy
seaplane destroy
[Seaplane]
Seaplane Apps <version number>
[Seaplane] โ๏ธ Assign Task <my-project-task> to App: <my-project-app>
[Seaplane] Requesting access token...
seaplane status
[Seaplane]
Seaplane Apps <version number>
[Seaplane] Requesting access token...
โโโโโโโโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโโโโ
โ Task Name โ Status โ Messages In โ Messages Out โ
โโโโโโโโโโโโโโโโโโโโโโชโโโโโโโโโโโโโโโโโโโโโโโโโโโชโโโโโโโโโโโโโโโโชโโโโโโโโโโโโโโโโโก
โ <my-project-task> โ <number> completed tasks โ 0 โ 0 โ
โโโโโโโโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโโโโ
NOTE: Message counts are currently unavailable for HTTP ENDPOINTS.
seaplane statusโ
Run seaplane status
in your project root directory. seaplane status
shows the dataflow of a deployed application including the number of messages in and out per task.
Learn more about your application status and how to debug with the application status here. Please note that message counts do not reset when apps are redeployed.
- Command Line
- Expected Output
seaplane status
seaplane status
[Seaplane]
Seaplane Apps <version number>
[Seaplane] Requesting access token...
โโโโโโโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโโโโ
โ Task Name โ Status โ Messages In โ Messages Out โ
โโโโโโโโโโโโโโโโโโโโโชโโโโโโโโโโโโโโโโโโโโชโโโโโโโโโโโโโโโโชโโโโโโโโโโโโโโโโโก
โ <my-project-task> โ 1: running โ 0 โ 0 โ
โ โ 2 completed tasks โ โ โ
โโโโโโโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโโโโ
NOTE: Message counts are currently unavailable for HTTP ENDPOINTS.
seaplane status -wโ
Run the seaplane status -w
command in your project root directory to automatically refresh the status every 2 seconds.
To use seaplane status -w
you need to have watch installed on your machine or on your virtual environment. For macOS follow the steps below to install Homebrew and watch:
- Download Homebrew from their website.
- Run
brew install watch
.
- Command Line
- Expected Output
seaplane status -w
[Seaplane]
Seaplane Apps version 0.5b12
[Seaplane] Requesting access token...
โโโโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโโโโ
โ Task Name โ Status โ Messages In โ Messages Out โ
โโโโโโโโโโโโโโโโโโชโโโโโโโโโโโโโโโโโโโโโชโโโโโโโโโโโโโโโโชโโโโโโโโโโโโโโโโโก
โ a โ 1: running โ 11 โ 0 โ
โ โ 3 completed tasks โ โ โ
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโค
โ b โ 1: running โ 0 โ 0 โ
โ โ 3 completed tasks โ โ โ
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโค
โ c โ 1: running โ 0 โ 0 โ
โ โ 2: running โ โ โ
โ โ 3: running โ โ โ
โ โ 4: running โ โ โ
โ โ 5: running โ โ โ
โ โ 15 completed tasks โ โ โ
โโโโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโโโโ
NOTE: Message counts are currently unavailable for HTTP ENDPOINTS.
seaplane requestโ
Use seaplane request
to send data to your application entry point. Please note that the input data should match the expected data type of your application.
For example, if your application expects a JSON string your input should match this format.
seaplane request
returns its request-id.
- Command Line
- Expected Output
seaplane request -d'{"foo": "bar"}'
request_id: <a-unique-id>
seaplane responseโ
Use seaplane response
to get data from your application endpoint. By default the command seaplane response
uses the last request and returns the associated data. To get the data from a specific request use seaplane response --request_id <request-id>
- Command Line
- Expected Output
- By default takes the last request and returns the response.
seaplane response
- Use a request-ID to get a specific response.
seaplane response -r <request-id>
OR
seaplane response --request_id <request-id>
Please note that the example is with the default Hello-World Project.
- For
seaplane response
Hello World <last-request-data>
- For
seaplane response --request_id <request-id>
Hello World <request-id-data>
seaplane --versionโ
seaplane --version
or seaplane -v
returns the installed version of Seaplane on your machine or in your virutal environment.
- Command Line
- Expected Output
seaplane --version
OR
seaplane -v
seaplane <version-number>
seaplane --helpโ
Run seaplane --help
, seaplane -h
, or seaplane
to see the list of available commands in your terminal.
- Command Line
- Expected Output
seaplane --help
OR
seaplane -h
OR
seaplane
usage: seaplane [-h] [-v] {build,deploy,destroy,init,status,request,response} ...
Seaplane Apps command line interface
positional arguments:
{build,deploy,destroy,init,status,request,response}
Available commands
build Build command
deploy Deploy command
destroy Remove your App and associated tasks
init Init command
status Status of your app and resources
request Send data to the request endpoint
response Get data from the response endpoint
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit