File: install_manually.rst

package info (click to toggle)
murano 1%3A6.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,644 kB
  • sloc: python: 34,127; sh: 717; pascal: 269; makefile: 83
file content (385 lines) | stat: -rw-r--r-- 11,066 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
.. _install_manually:

=======================
Install murano manually
=======================

Before you install Murano, verify that you completed the following tasks:

#. Install software prerequisites depending on the operating system you use
   as described in the System prerequisites section.

   .. TODO (OG): add ref to System prerequisites when it is ready

#. Install tox:

   .. code-block:: console

      sudo pip install tox

#. Install and configure a database.

   Murano can use various database types on back end. For development
   purposes, use SQLite. For production installations, consider using
   MySQL database.

   .. warning::

      Murano supports PostgreSQL as well. Though, use it with caution
      as it has not been thoroughly tested yet.

   Before you can use MySQL database, proceed with the following:

   #. Install MySQL:

      .. code-block:: console

         apt-get install mysql-server

   #. Create an empty database:

      Replace %MURANO_DB_PASSWORD% with the actual password. For example,
      'admin'.

      .. code-block:: console

         mysql -u root -p

         mysql> CREATE DATABASE murano;
         mysql> GRANT ALL PRIVILEGES ON murano.* TO 'murano'@'localhost' \
         IDENTIFIED BY %MURANO_DB_PASSWORD%;
         mysql> exit;

Install the API service and engine
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#.  Create a folder to which all murano components will be stored:

    .. code-block:: console

        mkdir ~/murano

#.  Clone the murano git repository to the management server:

    .. code-block:: console

        cd ~/murano
        git clone git://git.openstack.org/openstack/murano

#.  Create the configuration file. Murano has a common configuration
    file for API and engine services.

    #. Generate a sample configuration file using tox:

       .. code-block:: console

          cd ~/murano/murano
          tox -e genconfig

    #. Create a copy of ``murano.conf`` for further modifications:

       .. code-block:: console

          cd ~/murano/murano/etc/murano
          cp murano.conf.sample murano.conf

#.  Edit the ``murano.conf`` file. An example below contains the basic
    configuration.

    .. note::

       The example uses MySQL database. If you want to use another
       database type, edit the ``[database]`` section correspondingly.

       Replace items in "%" with the actual values. For example, replace
       %RABBITMQ_SERVER_IP% with 127.0.0.1. So, the complete row with the
       replaced value will be rabbit_host = 127.0.0.1

    .. code-block:: ini

        [DEFAULT]
        debug = true
        verbose = true
        rabbit_host = %RABBITMQ_SERVER_IP%
        rabbit_userid = %RABBITMQ_USER%
        rabbit_password = %RABBITMQ_PASSWORD%
        rabbit_virtual_host = %RABBITMQ_SERVER_VIRTUAL_HOST%

        ...

        [database]
        connection = mysql+pymysql://murano:%MURANO_DB_PASSWORD%@127.0.0.1/murano

        ...

        [keystone]
        auth_url = 'http://%OPENSTACK_HOST_IP%:5000'

        ...

        [keystone_authtoken]
        www_authenticate_uri  = 'http://%OPENSTACK_HOST_IP%:5000'
        auth_host = '%OPENSTACK_HOST_IP%'
        auth_port = 5000
        auth_protocol = http
        admin_tenant_name = %OPENSTACK_ADMIN_TENANT%
        admin_user = %OPENSTACK_ADMIN_USER%
        admin_password = %OPENSTACK_ADMIN_PASSWORD%

        ...

        [murano]
        url = http://%YOUR_HOST_IP%:8082

        [rabbitmq]
        host = %RABBITMQ_SERVER_IP%
        login = %RABBITMQ_USER%
        password = %RABBITMQ_PASSWORD%
        virtual_host = %RABBITMQ_SERVER_VIRTUAL_HOST%

        [networking]
        default_dns = 8.8.8.8 # In case OpenStack neutron has no default
                              # DNS configured

        [oslo_messaging_notifications]
        driver = messagingv2

#. Create a virtual environment and install murano prerequisites
   using **tox**. The virtual environment will be created under
   the ``tox`` directory.

   #. Install MySQL driver since it is not a part of the murano requirements:

      .. code-block:: console

         tox -e venv -- pip install PyMYSQL

   #. Create database tables for murano:

      .. code-block:: console

         cd ~/murano/murano
         tox -e venv -- murano-db-manage \
         --config-file ./etc/murano/murano.conf upgrade

   #.  Launch the murano API in a separate terminal:

       .. code-block:: console

          cd ~/murano/murano
          tox -e venv -- murano-api --config-file ./etc/murano/murano.conf

       .. note::

          Run the command in a new terminal as the process will be running in
          the terminal until you terminate it, therefore, blocking the current
          terminal.

   #.  Leaving the API process running, return to the previous console and
       import murano core library and other libraries from the `meta`
       directory:

       .. code-block:: console

          cd ~/murano/murano/meta/
          for i in */; do pushd ./"$i"; zip -r ../../"${i%/}.zip" *; popd; done
          cd ..
          tox -e venv -- murano --os-username %OPENSTACK_ADMIN_USER% \
          --os-password %OPENSTACK_ADMIN_PASSWORD% \
          --os-auth-url http://%OPENSTACK_HOST_IP%:5000 \
          --os-project-name %OPENSTACK_ADMIN_TENANT% \
          --murano-url http://%MURANO_IP%:8082 \
          package-import --is-public *.zip
          rm *.zip

   #.  Launch the murano engine in a separate terminal:

       .. code-block:: console

          cd ~/murano/murano
          tox -e venv -- murano-engine --config-file ./etc/murano/murano.conf

       .. note::

          Run the command in a new terminal as the process will be running in
          the terminal until you terminate it, therefore, blocking the current
          terminal.

Register in keystone
~~~~~~~~~~~~~~~~~~~~

To make the murano API available to all OpenStack users, you need to register
the Application Catalog service within the Identity service.

#. Add the ``application-catalog`` service to keystone:

   .. code-block:: console

      openstack service create --name murano --description \
      "Application Catalog for OpenStack" application-catalog

#. Provide an endpoint for this service:

   .. code-block:: console

      openstack endpoint create --region RegionOne --publicurl 'http://%MURANO_IP%:8082/' \
      --adminurl 'http://%MURANO_IP%:8082/' --internalurl 'http://%MURANO_IP%:8082/' \
      %MURANO_SERVICE_ID%

   where ``MURANO-SERVICE-ID`` is the unique service number that can be found
   in the :command:`openstack service create` output.

  .. note::

     URLs (``--publicurl``, ``--internalurl``, and ``--adminurl`` values)
     may differ depending on your environment.

Install the murano dashboard
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This section describes how to install and run the murano dashboard.

#.  Clone the repository with the murano dashboard:

    .. code-block:: console

        cd ~/murano
        git clone git://git.openstack.org/openstack/murano-dashboard

#.  Clone the ``horizon`` repository:

    .. code-block:: console

       git clone git://git.openstack.org/openstack/horizon

#.  Create a virtual environment and install ``muranodashboard``
    as an editable module:

    .. code-block:: console

        cd horizon
        tox -e venv -- pip install -e ../murano-dashboard

#.  Prepare local settings.

    .. code-block:: console

        cp openstack_dashboard/local/local_settings.py.example \
        openstack_dashboard/local/local_settings.py


    For more information, check out the official
    `horizon documentation <https://docs.openstack.org/horizon/latest/>`_.

#.  Enable and configure Murano dashboard in the OpenStack Dashboard:

    * For the Newton (and later) OpenStack installations, copy plug-in file
      local settings files, and policy files:

      .. code-block:: console

         cp ../murano-dashboard/muranodashboard/local/enabled/*.py \
         openstack_dashboard/local/enabled/

         cp ../murano-dashboard/muranodashboard/local/local_settings.d/*.py \
         openstack_dashboard/local/local_settings.d/

         cp ../murano-dashboard/muranodashboard/conf/* openstack_dashboard/conf/

    * For the OpenStack installations prior to the Newton release, run:

      .. code-block:: console

         cp ../murano-dashboard/muranodashboard/local/_50_murano.py \
         openstack_dashboard/local/enabled/

      Customize local settings of your horizon installation, by editing the
      ``openstack_dashboard/local/local_settings.py`` file:

      .. code-block:: python

         ...
         ALLOWED_HOSTS = '*'

         # Provide your OpenStack Lab credentials
         OPENSTACK_HOST = '%OPENSTACK_HOST_IP%'

         ...

         DEBUG_PROPAGATE_EXCEPTIONS = DEBUG

      Change the default session back end from browser cookies to database
      to avoid issues with forms during the applications creation:

      .. code-block:: python

         DATABASES = {
           'default': {
           'ENGINE': 'django.db.backends.sqlite3',
           'NAME': 'murano-dashboard.sqlite',
           }
         }

         SESSION_ENGINE = 'django.contrib.sessions.backends.db'


#. (Optional) If you do not plan to get the murano service from the keystone
   application catalog, specify where the ``murano-api`` service is running:

    .. code-block:: python

       MURANO_API_URL = 'http://%MURANO_IP%:8082'

#. (Optional) If you have set up the database as a session back end (this is
   done by default with murano local_settings file starting with Newton),
   perform database migration:

   .. code-block:: console

      tox -e venv -- python manage.py migrate --noinput

   Since a separate user is not required for development purpose,
   you can reply ``no``.

#.  Run Django server at ``127.0.0.1:8000`` or provide a different ``IP``
    and ``PORT`` parameters:

    .. code-block:: console

       tox -e venv -- python manage.py runserver <IP:PORT>

    .. note::

       The development server restarts automatically on every code change.

**Result:** The murano dashboard is available at ``http://IP:PORT``.

Import murano applications
~~~~~~~~~~~~~~~~~~~~~~~~~~

To fill the application catalog, you need to import applications to your
OpenStack environment. You can import applications using the murano dashboard,
as well as the command-line client.

To import applications using CLI, complete the following tasks:

#. Clone the murano apps repository:

   .. code-block:: console

      cd ~/murano
      git clone git://git.openstack.org/openstack/murano-apps

#. Import every package you need from this repository by running
   the following command:

   .. code-block:: console

      cd ~/murano/murano
      pushd ../murano-apps/Docker/Applications/%APP-NAME%/package
      zip -r ~/murano/murano/app.zip *
      popd
      tox -e venv -- murano --murano-url http://%MURANO_IP%:8082 package-import app.zip

**Result:** The applications are imported and available from the application
catalog.