Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnacioHeredia committed Jan 17, 2023
1 parent cd44542 commit 4806d28
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 15 deletions.
29 changes: 22 additions & 7 deletions source/user/howto/rclone.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,25 @@ Configuring rclone
After login into `DEEP-Nextcloud <https://data-deep.a.incd.pt/>`__ with your DEEP-IAM credentials, go to
(1) **Settings** (top right corner) ➜ (2) **Security** ➜ (3) **Devices & sessions**. Set a name for your
application (typically in the docs we will use ``rshare``) and click on **Create new app password**.
This will generate your ``<user>`` and ``<password>`` credentials. Your username should start with "DEEP-IAM-..."
This will generate your ``<user>`` and ``<password>`` credentials. Your username should start with ``DEEP-IAM-...``.

Now you have several options to configure rclone:

Configuring via ``env`` variables (Dashboard users)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If your are creating a deployment from the Dashboard, then you only need to fill the
``rclone_user`` and ``rclone_password`` parameters in the configuration and we will
If your are creating a deployment from the **Dashboard**, then you only need to fill the
``rclone_user`` and ``rclone_password`` parameters in the configuration form (**Storage options**) and we will
automatically set up rclone configuration for you via setting environment variables.

Once you machine is launched, you must run the following command in the terminal to properly configure rclone:

.. code-block:: console
$ export RCLONE_CONFIG_RSHARE_PASS=$(rclone obscure $RCLONE_CONFIG_RSHARE_PASS)
This is because, to connect with the remote, rclone needs to use an obscured version of the password, not the raw one.

You can always check those env variables afterwards:

.. code-block:: console
Expand All @@ -71,13 +79,14 @@ and modify them if needed:

.. code-block:: console
$ export RCLONE_CONFIG_RSHARE_PASS=***new-password***
$ export RCLONE_CONFIG_RSHARE_PASS=***new-password*** # remember this should an obscured version of the raw password --> `rclone obscure <raw-password>`
Configuring via ``rclone config`` (local development)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

One can use instead the ``rclone config`` command that will create a configuration file (``rclone.conf``) for rclone:
If you are developing in a Docker container deployed in your **local machine**,
one can use instead the ``rclone config`` command that will create a configuration file (``rclone.conf``) for rclone:

.. code-block:: console
Expand Down Expand Up @@ -133,9 +142,15 @@ You can check that everything works fine with:

.. code-block:: console
rclone about rshare:
$ rclone listremotes # check you don't have two remote storages with same name
$ rclone about rshare: # should output your used space in Nextcloud.
.. tip::

which should output your used space in Nextcloud.
If ``listremotes`` is listing two remotes with the same name you probably configured the rclone twice.
Most likely you ran ``rclone config`` on a machine deployed with the Dashboard, so you
have both the ``env`` and ``rclone.conf`` configurations. To fix this, either remove the ``env`` variables
(use ``unset`` command) or delete the ``rclone.conf`` file.

You can start copying files from your remote to your local:

Expand Down
42 changes: 34 additions & 8 deletions source/user/howto/train-model-remotely.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Train a model remotely
.. admonition:: Requirements

* You need a `DEEP-IAM <https://iam.deep-hybrid-datacloud.eu/>`__ account to be able to access the Dashboard and Nextcloud storage.
* For Step 7 we recommend having `docker <https://docs.docker.com/install/#supported-platforms>`__ installed (though it's not strictly mandatory).


This is a step by step guide on how to train a general model from the `DEEP Marketplace <https://marketplace.deep-hybrid-datacloud.eu/>`__
with your own dataset, in the :doc:`DEEP Dashboard <../overview/dashboard>`.
Expand Down Expand Up @@ -110,6 +112,15 @@ We can also check rclone is correctly configured with:
which should output your used space in Nextcloud.

.. tip::
If you happen to need additional packages, you will have to update the package index first.
Note that sudo is not needed as you are always root in your Docker containers:

.. code-block:: console
$ apt update
$ apt install vim
Now we will mount our remote Nextcloud folders in our local containers:

.. code-block:: console
Expand Down Expand Up @@ -156,20 +167,35 @@ In **Access** ➜ **History** you will be able to see the status of your current
------------------------------------------

Once the training has finished, you can directly test it by clicking on the ``predict`` POST method.
Select you new model weights upload the image your want to classify.
For this you have to kill the process running deepaas, and launch it again.

If you are satisfied with your model, then it's time to save it into your remote storage, so that you still have
access to it if your machine is deleted.
.. code-block:: console
$ kill -9 $(ps aux | grep '[d]eepaas-run' | awk '{print $2}')
This is because the user inputs for deepaas are generated at the deepaas launching.
Thus it is not aware of the newly trained model. Once deepaas is restarted, head to the
``predict`` POST method, select you new model weights and upload the image your want to classify.

If you are satisfied with your model, then it's time to save it into your remote storage,
so that you still have access to it if your machine is deleted.
For this we have to create a ``tar`` file with the model folder (in this case, the foldername is
the timestamp at which the training was launched) so that we can download in our Docker container.

So go back to JupyterLab, open a Terminal window and run:

.. code-block:: console
$ rclone copy /srv/image-classification/models rshare:/models
$ cd /srv/image-classification-tf/models
$ tar cfJ <modelname.tar.xz> <foldername>
$ rclone copy /srv/image-classification-tf/models rshare:/models
Now you should be able to see your new models weights in Nextcloud.

Now you should be able to see your new models weights. For the next step, you need to make them
publicly available through an URL so they can be downloaded in your Docker container
(see `Nextcloud Public Links <https://docs.nextcloud.com/server/latest/user_manual/en/files/sharing.html>`__).
For the next step, you need to make them `publicly available <https://docs.nextcloud.com/server/latest/user_manual/en/files/sharing.html>`__
through an URL so they can be downloaded in your Docker container.
In Nextcloud, go to the ``tar`` file you just created:
:fa:`share-nodes` ➜ Share Link ➜ :fa:`square-plus` (Create a new share link)


7. Create a Docker repo for your new module
Expand All @@ -184,7 +210,7 @@ To account for this simpler process, we have prepared a version of the
:doc:`the DEEP Modules Template <../overview/cookiecutter-template>`
specially tailored to this task.

In your local machine, run the Template with the ``child-module`` branch.
In your **local machine** (not the Dashboard deployment), run the Template with the ``child-module`` branch.

.. code-block::
Expand Down

0 comments on commit 4806d28

Please sign in to comment.