Browse Source

[MNT] modify doc for learnware environment

tags/v0.3.2
zouxiaochuan 2 years ago
parent
commit
b26dd5d224
2 changed files with 26 additions and 11 deletions
  1. +3
    -0
      docs/conf.py
  2. +23
    -11
      docs/workflow/submit.rst

+ 3
- 0
docs/conf.py View File

@@ -19,8 +19,11 @@ extensions = [
"sphinx.ext.todo",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"sphinx.ext.autosectionlabel",
]

autosectionlabel_prefix_document = True

language = "en_US"

# Add any paths that contain templates here, relative to this directory.


+ 23
- 11
docs/workflow/submit.rst View File

@@ -106,24 +106,35 @@ how your learnware configuration file should be structured based on our previous
kwargs: {}


``environment.yaml``
--------------------
``environment.yaml`` or ``requirements.txt``
--------------------------------------------

In this YAML file, you need to specify the conda environment configuration for running your model
(if the model environment is incompatible, you can rely on this for manual configuration).
You can generate this file according to the following steps:
In order to allow others to run your learnware, you need to specify the dependencies of your model. You
can either provide an ``environment.yaml`` file or an ``requirements.txt`` file.

- Create env config for conda:

- ``environment.yaml`` for conda:

if you provide ``environment.yaml``, a new conda environment will be created according to this file
when users install your learnware. The yaml file can be generated by the following command:

.. code-block::

conda env export | grep -v "^prefix: " > environment.yaml
- Recover env from config:

.. code-block::

conda env create -f environment.yaml
- ``requirements.txt`` for pip:

if you provide ``requirements.txt``, dependent packages will be installed through -r option of pip.
More description of ``requirements.txt`` can be found in
`pip documentation <https://pip.pypa.io/en/stable/user_guide/#requirements-files>`_.
It is recommended to use ``environment.yaml`` which can reduce conflics between different packages.

.. note::
Wether you use ``environment.yaml`` or ``requirements.txt``, you should make the dependencies as minimal as possible.
You may need to open the file and delete unnecessary packages manually.


Upload Learnware
@@ -131,7 +142,8 @@ Upload Learnware

Once you have prepared the four required files mentioned above,
you can package them as your own learnware zipfile. Combined with the generated semantic specification that
briefly describes the features of your task and model (Please refer to :ref:`semantic_specification` for more details),
briefly describes the features of your task and model (
Please refer to :ref:`semantic specification<components/spec:Semantic Specification>` for more details),
you can easily upload your learnware to the ``Learnware Market`` with a single line of code:

.. code-block:: python


Loading…
Cancel
Save