Skip to content

Commit

Permalink
Merge pull request #130 from keirthana/use-tabbed-content
Browse files Browse the repository at this point in the history
Use Sphinx tabs for CLI vs dashboard steps
  • Loading branch information
keirthana authored Aug 29, 2024
2 parents f86e699 + 6325550 commit 5f03417
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 49 deletions.
29 changes: 16 additions & 13 deletions howto/application/create-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The application manifest is a `yaml` file and is used to define various attribut

A default application manifest is created based on the *Resource type* you choose for your application. You can further customise various attributes of your application including the resource requirements for your application.

**Example manifest file**
An example manifest file:

```yaml
name: candy
Expand Down Expand Up @@ -46,27 +46,20 @@ resources:
disk-size: 8GB
```
## Using the dashboard
To create an application using the dashboard, click *Create application* on the applications page, enter the required and any optional details that you want to provide and confirm with *Create application* again. The *Create application* form also provides an option to customise your application manifest.
There may be more advanced scenarios while creating an application that cannot be performed using the dashboard and may require using the `amc` CLI.

## Using the CLI
`````{tabs}
````{group-tab} CLI

An application can be created from a directory, a zip archive or a tarball file. If you cannot use a directory, the second best option is to use a zip archive that provides better optimisation when compared to a tarball.

If you are using a directory or a zip archive, ensure that the directory/zip contains the `manifest.yaml` file. You can also optionally include `app.apk` and `extra-data`.

If you are using a tarball file, compress the file with bzip2 and use the same components and structure as the directory.

**Tips to create a zip or a tarball file:**

A zip archive file can be created with the following command:
A zip archive file can be created with the following command:

zip -r foo.zip <package-folder-path> app.apk extra-data manifest.yaml

A tarball can be created with the following command:
A tarball can be created with the following command:

tar cvjf foo.tar.bz2 -C <package-folder-path> app.apk extra-data manifest.yaml

Expand Down Expand Up @@ -126,8 +119,18 @@ resources:
disk-size: 8GB
```

````

```{group-tab} Dashboard
Click *Create application* on the applications page, enter the required and any optional details that you want to provide and confirm with *Create application* again. The *Create application* form also provides an option to customise your application manifest.
There may be more advanced scenarios while creating an application that cannot be performed using the dashboard and may require using the `amc` CLI.
```
`````
Once the status of the application switches to `ready`, the application is ready and can be used. See {ref}`howto-wait-for-application` for information about how to monitor the application status.
## Related topics
* {ref}`sec-application-bootstrap`
* {ref}`sec-application-bootstrap`
13 changes: 9 additions & 4 deletions howto/application/delete-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ When an application is no longer needed, it can be fully removed from Anbox Clou

Once you're sure you want to remove the application, you can delete it via the dashboard or the CLI.

## Using the dashboard
````{tabs}
On the *Applications* page, click *Delete* ( ![delete application icon](/images/icons/delete-icon.png) ) and confirm the deletion.

## Using the CLI
```{group-tab} CLI
Run:
amc application delete bcmap7u5nof07arqa2ag
The command will ask for your approval before the application is removed. If you want to bypass the check, you can add the `--yes` flag to the command.
```
```{group-tab} Dashboard
On the *Applications* page, click *Delete* ( ![delete application icon](/images/icons/delete-icon.png) ) and confirm the deletion.
```
````
14 changes: 9 additions & 5 deletions howto/application/stream-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

You can stream applications using the Anbox Cloud dashboard or your custom stream client. You can also stream applications by launching an instance with streaming enabled, using the `amc` CLI.

## Using the CLI
````{tabs}
```{group-tab} CLI
If you are using the `amc` CLI, you can use the `--enable-streaming` option at the time of launching the instance:
Expand All @@ -19,8 +20,8 @@ To further customise the streaming configuration, use the following arguments:
For example, to create an instance with a 1080p resolution, a frame rate of 60 and a DPI of 120, run:
amc launch --enable-streaming --display-size=1920x1080 --display-density=120 --fps=60 <application_id>

## Using the dashboard
```
```{group-tab} Dashboard
The dashboard has in-browser streaming capabilities through WebRTC. It uses the {ref}`sec-streaming-sdk`.
Expand All @@ -30,9 +31,9 @@ You can start a streaming session for any of the successfully created applicatio
To understand how the streaming stack of Anbox Cloud works, see {ref}`exp-application-streaming`.
### Streaming statistics
## Streaming statistics
View the streaming statistics for your running sessions by selecting the **Statistics** button on the session. The statistics display on the right pane and also have a download option to download the statistics in a `.csv` format for further analysis.
You can view the streaming statistics for your running sessions by selecting the **Statistics** button on the session. The statistics display on the right pane and also have a download option to download the statistics in a `.csv` format for further analysis.
The downloaded `.csv` file has the following statistics:
Expand Down Expand Up @@ -62,6 +63,9 @@ To share your stream with users without an account, click *Set up sharing* ( ![s
Set your stream title and expiration details and generate a link that can be shared with others.
```
````

## Related topics

* {ref}`tut-set-up-stream-client`
Expand Down
47 changes: 27 additions & 20 deletions howto/instance/create-instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,8 @@
# How to create an instance
To launch an application or an image, Anbox Cloud creates an instance for it. To create and launch an instance, you can use the Anbox Cloud dashboard or the CLI.

## Using the dashboard

Create an instance on the *Instances* page to launch an instance. The information required for launching an instance depends on whether you are creating the instance from an application or an image.

When you create the instance from an application, the attributes you define for the application decide most of the properties of the instance.

When you create the instance from an image, you can define the properties of the instance during its creation.

Once you create an instance by providing the necessary attributes, you can view the instance and its status on the *Instances* page.

There may be more advanced scenarios while creating an instance that cannot be performed using the dashboard and may require using the `amc` CLI.

## Using the CLI
`````{tabs}
````{group-tab} CLI
Depending on what you need, you can use the either of the following commands to create an instance for a registered application or an image.
Expand All @@ -26,7 +15,7 @@ By default, the instance will run headless.
The following examples demonstrate different ways of launching instances using `amc launch`, but you can use `amc init` in the same way.
(sec-launch-application-instances)=
### Launch application instances
## Launch application instances
Before launching an instance for an application, get the ID of the application that for which you want to launch an instance. To do this, run:
Expand Down Expand Up @@ -55,7 +44,7 @@ The `amc launch` command fails if you provide the ID of an application that is n
amc launch --application-version=0 bcmap7u5nof07arqa2ag
### Launch a raw instance
## Launch a raw instance
You can launch a raw instance from an image. To do so, get the ID of the image by running:
Expand All @@ -80,7 +69,7 @@ Launch a raw instance by providing the image ID in the following command:
See {ref}`ref-provided-images` for a list of images that are available in Anbox Cloud.
### Launch an instance with streaming enabled
## Launch an instance with streaming enabled
*since 1.22.0*
Expand All @@ -96,7 +85,7 @@ If you want to to further customise the streaming configuration such as display
amc launch --enable-streaming --display-size=1920x1080 --display-density=120 --fps=60 ...
### Launch an instance with a specific name
## Launch an instance with a specific name
*since 1.22.0*
Expand All @@ -110,7 +99,7 @@ This will create an instance with the name "foo" which can then be used in other
amc shell foo
### Launch an instance on a specific node
## Launch an instance on a specific node
By default, every instance is scheduled by AMS onto a LXD node. Alternatively, you can launch an instance directly on a specific node:
Expand All @@ -120,7 +109,7 @@ By default, every instance is scheduled by AMS onto a LXD node. Alternatively, y
AMS will still verify that the selected node has enough resources to host the instance. If not, the instance will fail to launch.
```
### Launch an instance with a different Anbox platform
## Launch an instance with a different Anbox platform
By default, instances start with the `webrtc` platform if `--enable-graphics` is specified. Otherwise, they start with the `null` platform. To select a different platform, specify it with the `-p` flag. The platform cannot be changed at runtime and must be selected when the instance is created. For example, you can launch an instance with the `webrtc` platform with the following command:
Expand All @@ -132,14 +121,32 @@ If you have built your own platform named `foo` and you built it via an addon in
For more information, see {ref}`exp-platforms` and {ref}`sec-supported-platforms`.
### Launch an instance with development mode enabled
## Launch an instance with development mode enabled
You can launch instances with additional development features turned on. This development mode must be enabled when an instance is launched, and it cannot be turned off afterwards. You should never enable development mode for instances used in a production environment.
To launch an instance with development mode enabled, add the `--devmode` flag to the launch command:
amc launch --devmode <application_id>
````
```{group-tab} Dashboard
Create an instance on the *Instances* page to launch an instance. The information required for launching an instance depends on whether you are creating the instance from an application or an image.
When you create the instance from an application, the attributes you define for the application decide most of the properties of the instance.
When you create the instance from an image, you can define the properties of the instance during its creation.
Once you create an instance by providing the necessary attributes, you can view the instance and its status on the *Instances* page.
There may be more advanced scenarios while creating an instance that cannot be performed using the dashboard and may require using the `amc` CLI.
```
`````

## Related topics

* {ref}`exp-application-streaming`
Expand Down
18 changes: 11 additions & 7 deletions howto/instance/delete-instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@

An instance can be deleted, which will cause any connected user to be disconnected immediately.

## Using the dashboard

On the *Instances* page, click *Delete* ( ![delete application icon](/images/icons/delete-icon.png) ) and confirm the deletion.

## Using the CLI

````{tabs}
```{group-tab} CLI
Run:
amc delete <instance_id>
Provide the ID of the instance that you want to delete.
In some cases, it is helpful to delete all instances currently available.
The `amc` command provides a `--all` flag for this, but be careful with this!
The `amc` command provides a `--all` flag for this, but be careful while performing a deletion of all instances.
amc delete --all
```
```{group-tab} Dashboard
On the *Instances* page, click *Delete* ( ![delete application icon](/images/icons/delete-icon.png) ) and confirm the deletion.
```
````

0 comments on commit 5f03417

Please sign in to comment.