Merge "Improve doc"
This commit is contained in:
commit
f3df0936d5
|
@ -34,7 +34,6 @@ host.
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ kubectl proxy --accept-hosts='.*' --address='0.0.0.0'
|
$ kubectl proxy --accept-hosts='.*' --address='0.0.0.0'
|
||||||
|
|
||||||
Starting to serve on [::]:8001
|
Starting to serve on [::]:8001
|
||||||
|
|
||||||
.. end
|
.. end
|
||||||
|
@ -43,7 +42,7 @@ host.
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ git clone https://github.com/LingxianKong/qinling.git
|
$ git clone https://github.com/openstack/qinling.git
|
||||||
$ cd qinling/tools/vagrant
|
$ cd qinling/tools/vagrant
|
||||||
|
|
||||||
.. end
|
.. end
|
||||||
|
@ -75,23 +74,23 @@ host.
|
||||||
|
|
||||||
.. end
|
.. end
|
||||||
|
|
||||||
If you see message like the above, congratulations!
|
If you see message like the above, congratulations, your own Qinling service
|
||||||
|
is up and running!
|
||||||
|
|
||||||
Getting started with Qinling
|
Getting started with Qinling
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
**Currently, you can interact with Qinling using python-qinlingclient or
|
.. note::
|
||||||
sending RESTful API directly. Both ways are described in this guide.**
|
|
||||||
|
|
||||||
``httpie`` is a convenient tool to send HTTP request, make sure you installed
|
Currently, you can interact with Qinling using python-qinlingclient or
|
||||||
``httpie`` via ``pip install httpie`` before playing with Qinling.
|
sending RESTful API directly. Both ways are described in this guide.
|
||||||
|
``httpie`` is a convenient tool to send HTTP request, it has been installed
|
||||||
|
automatically inside the vagrnat VM.
|
||||||
|
|
||||||
If you prefer to use CLI, please make sure python-qinlingclient is installed.
|
Perform following commands on your local host, we will create
|
||||||
|
runtime/function/execution during the process.
|
||||||
|
|
||||||
Perform following commands on your local host, the process will create
|
1. (Optional) Prepare a docker image including development environment for a
|
||||||
runtime/function/execution in Qinling.
|
|
||||||
|
|
||||||
#. (Optional) Prepare a docker image including development environment for a
|
|
||||||
specific programming language. For your convenience, I already build one
|
specific programming language. For your convenience, I already build one
|
||||||
(``lingxiankong/python-runtime``) in my docker hub account that you could
|
(``lingxiankong/python-runtime``) in my docker hub account that you could
|
||||||
directly use to create runtime in Qinling. Only ``Python 2`` runtime is
|
directly use to create runtime in Qinling. Only ``Python 2`` runtime is
|
||||||
|
@ -108,9 +107,10 @@ runtime/function/execution in Qinling.
|
||||||
|
|
||||||
.. end
|
.. end
|
||||||
|
|
||||||
#. Create runtime. A runtime in Qinling is running environment for a specific
|
2. Create runtime. ``runtime`` in Qinling is running environment for a
|
||||||
language, this resource is supposed to be created/deleted/updated by cloud
|
specific language, this resource is supposed to be created/deleted/updated
|
||||||
operator. After creation, check the runtime status is ``available``:
|
by cloud operator. After creation, check the runtime status until it's
|
||||||
|
``available`` before you execute any functions:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
|
@ -172,14 +172,14 @@ runtime/function/execution in Qinling.
|
||||||
|
|
||||||
.. end
|
.. end
|
||||||
|
|
||||||
#. Create a customized function package:
|
3. Create a customized function package:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ mkdir ~/qinling_test
|
$ mkdir ~/qinling_test
|
||||||
$ cat <<EOF > ~/qinling_test/main.py
|
$ cat <<EOF > ~/qinling_test/main.py
|
||||||
import requests
|
import requests
|
||||||
def main():
|
def main(*args, **kwargs):
|
||||||
r = requests.get('https://api.github.com/events')
|
r = requests.get('https://api.github.com/events')
|
||||||
return len(r.json())
|
return len(r.json())
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -191,7 +191,7 @@ runtime/function/execution in Qinling.
|
||||||
|
|
||||||
.. end
|
.. end
|
||||||
|
|
||||||
#. Create function, ``runtime_id`` comes from the output of above command:
|
4. Create function, ``runtime_id`` comes from the output of the above command:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ runtime/function/execution in Qinling.
|
||||||
|
|
||||||
.. end
|
.. end
|
||||||
|
|
||||||
#. Invoke the function by specifying ``function_id``:
|
5. Invoke the function by specifying ``function_id``:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
|
@ -290,4 +290,4 @@ runtime/function/execution in Qinling.
|
||||||
.. end
|
.. end
|
||||||
|
|
||||||
If you invoke the same function again, you will find it is much faster
|
If you invoke the same function again, you will find it is much faster
|
||||||
thanks to Qinling cache mechanism.
|
due to Qinling cache mechanism.
|
||||||
|
|
Loading…
Reference in New Issue