From 6325550d7c86ea8fb33aa1282ef1a74c0a136bae Mon Sep 17 00:00:00 2001 From: Keirthana T S Date: Thu, 29 Aug 2024 14:22:27 +0530 Subject: [PATCH] Use Sphinx tabs for CLI vs dashboard steps --- howto/application/create-application.md | 29 ++++++++------- howto/application/delete-application.md | 13 ++++--- howto/application/stream-application.md | 14 +++++--- howto/instance/create-instance.md | 47 ++++++++++++++----------- howto/instance/delete-instance.md | 18 ++++++---- 5 files changed, 72 insertions(+), 49 deletions(-) diff --git a/howto/application/create-application.md b/howto/application/create-application.md index efa35cf6..5562470c 100644 --- a/howto/application/create-application.md +++ b/howto/application/create-application.md @@ -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 @@ -46,13 +46,8 @@ 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. @@ -60,13 +55,11 @@ If you are using a directory or a zip archive, ensure that the directory/zip con 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 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 app.apk extra-data manifest.yaml @@ -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` \ No newline at end of file +* {ref}`sec-application-bootstrap` diff --git a/howto/application/delete-application.md b/howto/application/delete-application.md index f45b7bae..af1382d4 100644 --- a/howto/application/delete-application.md +++ b/howto/application/delete-application.md @@ -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. +``` +```` diff --git a/howto/application/stream-application.md b/howto/application/stream-application.md index 08123ea9..24398b72 100644 --- a/howto/application/stream-application.md +++ b/howto/application/stream-application.md @@ -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: @@ -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 - -## Using the dashboard +``` +```{group-tab} Dashboard The dashboard has in-browser streaming capabilities through WebRTC. It uses the {ref}`sec-streaming-sdk`. @@ -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: @@ -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` diff --git a/howto/instance/create-instance.md b/howto/instance/create-instance.md index cf97564e..8cd3f8f3 100644 --- a/howto/instance/create-instance.md +++ b/howto/instance/create-instance.md @@ -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. @@ -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: @@ -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: @@ -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* @@ -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* @@ -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: @@ -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: @@ -132,7 +121,7 @@ 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. @@ -140,6 +129,24 @@ To launch an instance with development mode enabled, add the `--devmode` flag to amc launch --devmode +```` + +```{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` diff --git a/howto/instance/delete-instance.md b/howto/instance/delete-instance.md index c6b0bc7a..a9ae6997 100644 --- a/howto/instance/delete-instance.md +++ b/howto/instance/delete-instance.md @@ -3,12 +3,8 @@ 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 @@ -16,6 +12,14 @@ Run: 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. + +``` +````