Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate AppAPI documentation to admin and developer manuals #12318

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ba294ff
chore(ExApp): migrate and split AppAPI documentation to relevant manuals
edward-ly Oct 21, 2024
e248d71
fix(ExApp): temporarily update missing references
edward-ly Oct 21, 2024
5e08758
fix(ExApp): update installation steps
edward-ly Oct 22, 2024
45bc589
chore(developer): move ExApp intro and glossary to separate page
edward-ly Oct 23, 2024
5602a6c
fix(deps): re-add mermaid extension for sphinx
edward-ly Oct 23, 2024
edc1425
fix(developer): update nextcloud-docker-dev link
edward-ly Oct 23, 2024
9311870
fix(admin): merge AppAPI and External Apps page ExApps Management int…
edward-ly Oct 23, 2024
b045b0e
fix(ExApp): merge AppAPI concepts page into developer manual AppAPI o…
edward-ly Oct 24, 2024
4aded57
chore(ExApp): codespell errors
edward-ly Oct 24, 2024
0dacfbd
fix(developer): remove duplicate reference to declarative settings
edward-ly Oct 24, 2024
034d44d
fix(admin): rename managing ExApps page, use italics for all "[option…
edward-ly Oct 29, 2024
48982c4
fix(admin): remove references to ExApp Management UI and removed AppA…
edward-ly Oct 30, 2024
4b794d1
fix(developer): update AppAPI installation for ExApps
edward-ly Oct 30, 2024
dd03488
fix(developer): clean up grammar and syntax for ExApp installation page
edward-ly Oct 30, 2024
2f6e97a
fix(developer): clean up grammar and syntax in ExApp deployment page
edward-ly Oct 30, 2024
4378c26
fix(developer): clean up grammar in ExApp authentication page
edward-ly Oct 30, 2024
0c9c8e7
fix(developer): update ExApp Makefile example
edward-ly Oct 30, 2024
f83ba5a
fix(developer): combine ExApp development setup pages
edward-ly Oct 30, 2024
c6795f2
fix(developer): rename and reorder ExApp developer notes section
edward-ly Oct 30, 2024
9a70f3e
fix(developer): clean up grammar and syntax in ExApp overview page
edward-ly Oct 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions admin_manual/ai/app_api_and_external_apps.rst

This file was deleted.

1 change: 0 additions & 1 deletion admin_manual/ai/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ Artificial Intelligence
app_recognize
app_context_chat
app_summary_bot
app_api_and_external_apps
ai_as_a_service
1 change: 1 addition & 0 deletions admin_manual/contents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Table of contents
configuration_server/index
occ_command
apps_management
exapps_management/index
configuration_user/index
configuration_files/index
file_workflows/index
Expand Down
70 changes: 70 additions & 0 deletions admin_manual/exapps_management/AppAPIAndExternalApps.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
========================
AppAPI and External Apps
========================

.. _ai-app_api:

Previously, Nextcloud only supported applications written in the PHP programming language.
In order to support a wider range of use cases,
an ecosystem for **ExApps** (short for "External Apps") was introduced, allowing for the installation of apps as Docker containers.

Most of our :doc:`../ai/index` (AI) apps are developed as ExApps and thus may require some preparation of your Nextcloud instance before you can install them.

Installing AppAPI
-----------------

All ExApps require the `AppAPI <https://apps.nextcloud.com/apps/app_api>`_ Nextcloud app as a dependency.
As of Nextcloud 30, AppAPI is automatically installed by default.
If AppAPI is not installed, you can still install it by simply navigating to the Apps management page in your Nextcloud instance and search for AppAPI from the Tools category.

Setup deploy daemon
-------------------

A Deploy Daemon is a way for Nextcloud to install and communicate with and control ExApps.

.. note::
If you are using Nextcloud AIO with the "Docker Socket Proxy" container enabled, a Deploy Daemon will be automatically created and configured to work out-of-the-box.
Otherwise, follow the steps below to set up a Deploy Daemon from the AppAPI admin settings.

1. Setup a Docker container called `docker-socket-proxy <https://github.com/nextcloud/docker-socket-proxy#readme>`_ that proxies access to Docker for your Nextcloud instance.
2. Go to the AppAPI admin settings.
3. Click on the "Register Daemon" button.
4. Fill in the required fields:
- ``Name``: unique name of the Deploy daemon
- ``Display name``: the name that will be displayed in the UI
- ``Deployment method``: by default you will need to choose ``docker_install``, ``manual_install`` is for development or custom use case of manual ExApp installation
- ``Daemon Host``: hostname/IP address + port of the Deploy daemon
- ``Nextcloud URL``: autofilled with current domain, you might need to change the protocol to http/https depending on your setup
- ``Set as default daemon``: check if you want set new Deploy daemon as default
- ``Enable https``: check if your Deploy daemon (Docker Socket Proxy) is configured with TLS
- Deploy Config:
- ``Network``: Docker network name, depends on your networking setup, enforces to "host" if "Enable https" is checked
- ``HaProxy password``: password for Docker Socket Proxy, if it is configured with TLS
- ``Compute Device``: CPU, CUDA or ROCm, depending on your hardware config on Deploy daemon host machine
- ``Add additional option`` (see :ref:`additional_options_list`): setup additional KEY + VALUE deploy config options
5. Click "Check connection" to verify that the configuration is correct.
6. Click "Register" to save the Deploy Daemon configuration.

Deployment configuration examples can be found :ref:`here <deploy-configs>`.

Installing ExApps
-----------------

You can now install ExApps from the Nextcloud App Store by clicking "Install" on the respective app in the Apps page.
If successful, the ExApp will be displayed under the "Your apps" list.

.. image:: ./img/exapp_list_example.png

FAQ
---

* I have two graphics cards XXX with 6/8/Y GB of ram each. How can I run something which does not fit into one graphics card?
* Distributing models across multiple GPUs is currently not supported. You will need a GPU that fits all of the model you are trying to use.
* I have YYY graphics card that does not supports CUDA - can I use it and how?
* No, our AI apps require GPUs with CUDA support to function at this time.
* What is the minimum VRAM size requirement for the GPU if I want to install multiple apps?
* When running multiple ExApps on the same GPU, the GPU must hold the largest model amongst the apps you install.
* Is it possible to add more graphics cards for my instance to enable parallel requests or to speed up one request?
* Parallel processing of AI workloads for the same app with multiple GPUs is currently not supported.
* Can I use the CPU and GPU in parallel for AI processing?
* No, you can only process AI workloads on either the CPU or GPU for one app. For different apps, you can decide whether to run them on CPU or GPU.
135 changes: 135 additions & 0 deletions admin_manual/exapps_management/CreationOfDeployDaemon.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
.. _create-deploy-daemon:

Creation of Deploy Daemon
=========================

The Deploy Daemon (DaemonConfig) is used to orchestrate the deployment of ExApps.

.. note::

Currently only ``docker-install`` and ``manual-install`` deployment methods are supported.

The recommended daemon configuration is using `AppAPI Docker Socket Proxy <https://github.com/cloud-py-api/docker-socket-proxy>`_.

.. image:: ./img/app_api_3.png


You can choose one of the basic configuration templates and adjust to your needs.

.. note:: We highly recommend to use UI to create Deploy Daemons.

Register Deploy daemon form
^^^^^^^^^^^^^^^^^^^^^^^^^^^

1. ``Name``: unique name of the Deploy daemon
2. ``Display name``: the name that will be displayed in the UI
3. ``Deployment method``: by default you will need to choose ``docker_install``, ``manual_install`` is for development or custom use case of manual ExApp installation
4. ``Daemon Host``: hostname/IP address + port of the Deploy daemon
5. ``Nextcloud URL``: autofilled with current domain, you might need to change the protocol to http/https depending on your setup
6. ``Set as default daemon``: check if you want set new Deploy daemon as default
7. ``Enable https``: check if your Deploy daemon (Docker Socket Proxy) is configured with TLS
8. Deploy Config:
9. ``Network``: Docker network name, depends on your networking setup, enforces to "host" if "Enable https" is checked
10. ``HaProxy password``: password for Docker Socket Proxy, if it is configured with TLS
11. ``Compute Device``: CPU, CUDA or ROCm, depending on your hardware config on Deploy daemon host machine
12. ``Add additional option`` (see :ref:`additional_options_list`): setup additional KEY + VALUE deploy config options

.. note::

For remote DSP setup, it should expose the ports on the host.


.. _create-deploy-daemon-cli:

OCC CLI
^^^^^^^

There are a few commands to manage Deploy Daemons:

1. Register ``occ app_api:daemon:register``
2. Unregister ``occ app_api:daemon:unregister``
3. List registered daemons ``occ app_api:daemon:list``

Register
--------

Register Deploy Daemon (DaemonConfig).

Command: ``app_api:daemon:register [--net NET] [--haproxy_password HAPROXY_PASSWORD] [--compute_device COMPUTE_DEVICE] [--set-default] [--] <name> <display-name> <accepts-deploy-id> <protocol> <host> <nextcloud_url>``

Arguments
*********

* ``name`` - unique name of the daemon (e.g. ``docker_local_sock``)
* ``display-name`` - name of the daemon (e.g. ``My Local Docker``, will be displayed in the UI)
* ``accepts-deploy-id`` - type of deployment (``docker-install`` or ``manual-install``)
* ``host`` - **path to docker-socket** or the Docker Socket Proxy: ``address:port``
* ``protocol`` - protocol used to communicate with the Daemon/ExApps (``http`` or ``https``)
* ``nextcloud_url`` - Nextcloud URL, Daemon config required option (e.g. ``https://nextcloud.local``)

Options
*******

* ``--net [network-name]`` - ``[required]`` network name to bind docker container to (default: ``host``)
* ``--haproxy_password HAPROXY_PASSWORD`` - ``[optional]`` password for AppAPI Docker Socket Proxy
* ``--compute_device GPU`` - ``[optional]`` GPU device to expose to the daemon (e.g. ``cpu|cuda|rocm``, default: ``cpu``)
* ``--set-default`` - ``[optional]`` set created daemon as default for ExApps installation

DeployConfig
************

DeployConfig is a set of additional options in Daemon config, which are used in deployment algorithms to configure
ExApp container.

.. code-block:: json

{
"net": "host",
"nextcloud_url": "https://nextcloud.local",
"haproxy_password": "some_secure_password",
"computeDevice": {
"id": "cuda",
"name": "CUDA (NVIDIA)",
},
}

DeployConfig options
********************

* ``net`` **[required]** - network name to bind docker container to (default: ``host``)
* ``nextcloud_url`` **[required]** - Nextcloud URL (e.g. ``https://nextcloud.local``)
* ``haproxy_password`` *[optional]* - password for AppAPI Docker Socket Proxy
* ``computeDevice`` *[optional]* - Compute device to attach to the daemon (e.g. ``{ "id": "cuda", "label": "CUDA (NVIDIA)" }``)

Unregister
----------

Unregister Deploy Daemon (DaemonConfig).

Command: ``app_api:daemon:unregister <daemon-config-name>``

List registered daemons
-----------------------

List registered Deploy Daemons (DaemonConfigs).

Command: ``app_api:daemon:list``

Nextcloud AIO
^^^^^^^^^^^^^

In case of AppAPI installed in AIO, default Deploy Daemon is registered automatically.
It is possible to register additional Deploy Daemons with the same ways as described above.


.. _additional_options_list:

Additional options
^^^^^^^^^^^^^^^^^^

There is a possibility to add additional options to the Deploy Daemon configuration,
which are key-value pairs.

Currently, the following options are available:

- ``OVERRIDE_APP_HOST`` - can be used to override the host that will be used for ExApp binding (not passed to ExApp container envs)
Loading