carta-controller 5.0.0-beta.1 → 5.0.0-beta.1c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,281 +0,0 @@
1
- .. _almalinux8_instructions:
2
-
3
- Step-by-step instructions for AlmaLinux 8
4
- =========================================
5
-
6
- .. note::
7
-
8
- These instructions should also work for RHEL 8 and Rocky Linux 8. Some changes may be necessary for RHEL 7 / CentOS 7.
9
-
10
-
11
- 1. Install Node.js
12
- ~~~~~~~~~~~~~~~~~~
13
-
14
- The CARTA controller uses `Node.js <https://nodejs.org/>`_, which can easily be installed from the AlmaLinux 8 AppStream repository. We recommend using the `latest LTS version <https://github.com/nodejs/release#release-schedule>`_. The oldest version known to work with the controller is v16. Here we install v20, as well as the ``npm`` package manager.
15
-
16
- .. code-block:: shell
17
-
18
- # Install Node.js v20:
19
- sudo dnf module enable nodejs:20
20
- sudo dnf install -y nodejs npm
21
-
22
- # Check it is installed and working:
23
- node --version
24
- npm --version
25
-
26
- 2. Install MongoDB
27
- ~~~~~~~~~~~~~~~~~~
28
-
29
- The CARTA controller uses `MongoDB <https://www.mongodb.com/>`_ to store user preferences, etc.. MongoDB is not available through the default AlmaLinux 8 repositories, but we can add a custom repository to install it more easily.
30
-
31
- .. code-block:: shell
32
-
33
- # Create a custom MongoDB repo file:
34
- sudo cat <<EOT >> /etc/yum.repos.d/mongodb-org.repo
35
- [mongodb-org-4.4]
36
- name=MongoDB Repository
37
- baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.4/x86_64/
38
- gpgcheck=1
39
- enabled=1
40
- gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc
41
- EOT
42
-
43
- # Install MongoDB:
44
- sudo dnf update
45
- sudo dnf install -y mongodb-org
46
-
47
- # Start and enable MongoDB to run on startup:
48
- sudo systemctl start mongod
49
- sudo systemctl enable mongod
50
-
51
- # Check that it is working
52
- sudo systemctl status mongod
53
-
54
- .. note::
55
-
56
- On RHEL7/CentOS7, MongoDB v14 can be installed as follows:
57
-
58
- .. code-block:: shell
59
-
60
- curl -fsSL https://rpm.nodesource.com/setup_14.x | bash - && yum install -y nodejs
61
-
62
-
63
- 3. Install the CARTA controller
64
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65
-
66
- The easiest way to install the CARTA controller is using ``npm``.
67
-
68
- .. code-block:: shell
69
-
70
- sudo dnf install -y python3 make gcc-c++
71
- sudo npm install -g --unsafe-perm carta-controller
72
-
73
-
74
- .. note::
75
-
76
- If you would like to install the latest **beta** release of CARTA, please install the ``beta`` tag of the controller instead:
77
-
78
- .. code-block:: shell
79
-
80
- sudo npm install -g --unsafe-perm carta-controller@beta
81
-
82
- .. note::
83
-
84
- The CARTA controller executable will be installed at ``/usr/local/lib/node_modules/carta-controller``.
85
- The CARTA frontend will be installed at ``/usr/local/lib/node_modules/carta-controller/node_modules/carta-frontend/build``.
86
-
87
- .. note::
88
-
89
- Do not pass the ``--unsafe-perm`` flag to ``npm`` if using a local install.
90
-
91
- .. note::
92
-
93
- On RHEL7/CentOS7 the CARTA controller package can not run with the default gcc version 4.8.5 (there would be an error due to ``node-linux-pam``).
94
- A work around is to install a newer GCC version from source in order to get a newer ``libstdc++.so.6``, then add the location of the newer
95
- ``libstdc++.so.6`` to the LD_LIBRARY_PATH. After that, the CARTA controller can run on RHEL7/CentOS7.
96
-
97
-
98
-
99
- 4. Install the CARTA backend
100
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101
-
102
- The easiest way is to install the CARTA backend is from our `cartavis/carta Copr <https://copr.fedorainfracloud.org/coprs/cartavis/carta/>`_ repository.
103
-
104
- .. code-block:: shell
105
-
106
- # Install the CARTA backend
107
- sudo dnf -y install 'dnf-command(copr)'
108
- sudo dnf -y copr enable cartavis/carta
109
- sudo dnf -y install epel-release
110
- sudo dnf -y install carta-backend
111
-
112
- # Check that the backend can run and matches the major version number of the controller.
113
- /usr/bin/carta_backend --version
114
-
115
- .. note::
116
- The ``carta-backend`` package is updated with every stable CARTA release. If you would like to install the latest **beta** version of CARTA, or to receive beta release updates as well as stable release updates in the future, please install ``carta-backend-beta`` instead:
117
-
118
- .. code-block:: shell
119
-
120
- sudo dnf -y install carta-backend-beta
121
-
122
- Make sure that you install the matching controller version (using the ``beta`` tag).
123
-
124
- We currently install the beta version of ``carta_backend`` in a non-standard location:
125
-
126
- .. code-block:: shell
127
-
128
- /opt/carta-beta/bin/carta_backend --version
129
-
130
-
131
- 5. Install Nginx
132
- ~~~~~~~~~~~~~~~~
133
-
134
- The CARTA controller requires a webserver. Here we use `NGINX <https://www.nginx.com/>`_, but Apache should work too.
135
-
136
- .. code-block:: shell
137
-
138
- # Install nginx:
139
- sudo dnf install -y nginx
140
- sudo systemctl start nginx
141
- sudo systemctl enable nginx
142
- sudo setsebool -P httpd_can_network_connect 1
143
- sudo firewall-cmd --permanent --zone=public --add-service=http
144
- sudo firewall-cmd --permanent --zone=public --add-service=https
145
- sudo firewall-cmd --reload
146
-
147
- # Set up the nginx configuration file using our sample configuration file linked below:
148
- sudo cd /etc/nginx/conf.d/
149
- sudo vi /etc/nginx/conf.d/carta.conf
150
- sudo systemctl restart nginx
151
-
152
- # Check it is running:
153
- sudo systemctl status nginx
154
-
155
- A :ref:`sample configuration file<example_nginx>` is provided in the configuration section. This should be adapted to your server configuration.
156
-
157
- .. note::
158
- If there are problems, you can debug with ``journactl -xe`` and by checking log files in ``/var/log/nginx/``.
159
-
160
-
161
- 6. Create the 'carta' user and modify sudoers
162
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
163
-
164
- For security, we recommend not to run the CARTA controller as the root user. Therefore we create a new user called ``carta``.
165
-
166
- We will assign the group ``carta-users`` to every user account and enable them to run ``/usr/bin/carta_backend`` and the script to close the CARTA backend, ``/usr/local/bin/carta-kill-script``, by adding a custom entry to the ``sudoers`` file.
167
-
168
- .. code-block:: shell
169
-
170
- # Create the carta user:
171
- sudo adduser carta
172
- # Check everything is OK
173
- id carta
174
- # It should show 'uid=1000(carta) gid=1000(carta) groups=1000(carta)'
175
-
176
- # So that log files can be written:
177
- sudo mkdir -p /var/log/carta
178
- sudo chown -R carta /var/log/carta
179
-
180
- # Add the custom sudoers file entry using our sample linked below
181
- sudo visudo -f /etc/sudoers.d/carta_controller
182
-
183
- An :ref:`example sudoers configuration<example_sudoers>` is provided in the configuration section.
184
-
185
- .. note::
186
- The only safe way to modify sudoers is using ``visudo``. Any syntax errors from directly editing sudoers could make your system unusable.
187
-
188
- .. note::
189
- The ``carta`` user should not be in the ``carta-users`` group. ``carta-users`` should only be assigned to the normal user accounts.
190
-
191
- .. note::
192
- If you have installed the **beta** version of CARTA, please remember to change the path to the ``carta_backend`` executable in the sudoers file:
193
-
194
- .. code-block:: bash
195
-
196
- carta ALL=(%carta-users) NOPASSWD:SETENV: /opt/carta-beta/bin/carta_backend
197
-
198
- 7. Set up the user authentication method
199
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
200
-
201
- This is the most difficult step and depends on how you authenticate users at your institute. In this step-by-step guide we use PAM local authentication and a local user, ``bob``, on the server running the CARTA controller. The user ``bob`` needs to be part of the ``carta-users`` group.
202
-
203
- With PAM authentication, the ``carta`` user that runs the CARTA controller requires access to the ``/etc/shadow`` file in order to authenticate other users. We can enable this by creating a new group called ``shadow`` and assigning the ``/etc/shadow`` file to that group.
204
-
205
- .. note::
206
- Only PAM with local authentication requires ``/etc/shadow`` access. PAM using LDAP, and Google OAuth, do not require ``/etc/shadow`` access.
207
-
208
- .. code-block:: shell
209
-
210
- # Create the test user 'bob':
211
- sudo useradd -G carta-users bob
212
- sudo passwd bob
213
-
214
- # A new group called 'shadow' needs to be assinged to the /etc/shadow file and user 'carta':
215
- sudo groupadd shadow
216
- sudo chgrp shadow /etc/shadow
217
- sudo chmod g+r /etc/shadow
218
- sudo usermod -a -G shadow carta
219
- ls -l /etc/shadow
220
- # It should show permissions as ----r-----. 1 root shadow
221
- # It could be helpful to reboot the server at this point
222
- sudo reboot
223
-
224
-
225
- 8. Configure the CARTA controller
226
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
227
-
228
- Create and fill in the ``config.json`` using our :ref:`sample configuration file<example_config>`.
229
- Also generate private/public keys as they are used by the CARTA controller to sign/verify/refresh access tokens.
230
-
231
- .. code-block:: shell
232
-
233
- sudo mkdir /etc/carta
234
- sudo chown -R carta /etc/carta
235
- vi /etc/carta/config.json
236
-
237
- # Generate private/public keys:
238
- cd /etc/carta
239
- sudo openssl genrsa -out carta_private.pem 4096
240
- sudo openssl rsa -in carta_private.pem -outform PEM -pubout -out carta_public.pem
241
-
242
- Please check the `CARTA Configuration Schema <https://carta-controller.readthedocs.io/en/latest/schema.html#schema>`_ for all available options.
243
-
244
-
245
- 9. Check everything is working
246
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
247
-
248
- Here we switch to the ``carta`` user and test the CARTA controller with our test user ``bob``:
249
-
250
- .. code-block:: shell
251
-
252
- su - carta
253
- carta-controller -verbose -test bob
254
-
255
- If the test is successful, the CARTA controller should be ready to deploy.
256
-
257
-
258
- 10. Start the CARTA controller
259
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
260
-
261
- .. code-block:: shell
262
-
263
- su - carta
264
- carta-controller
265
-
266
- Now your users should be able to access your server's URL and log into CARTA.
267
-
268
-
269
- Optional: Set up the CARTA controller to run with pm2
270
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
271
-
272
- `pm2 <https://pm2.keymetrics.io/>`_ is a very convenient tool to keep the CARTA controller service running in the background, and even start it up automatically after a reboot.
273
-
274
- .. code-block:: shell
275
-
276
- sudo npm install -g pm2
277
- su -carta
278
- pm2 start carta-controller
279
-
280
- Please refer to the `pm2 documentation <https://pm2.keymetrics.io/docs/usage/startup/>`_ for detailed instructions.
281
-
@@ -1,127 +0,0 @@
1
- .. _focal_instructions:
2
-
3
- Step-by-step instructions for Ubuntu 20.04.2 (Focal Fossa)
4
- ==========================================================
5
-
6
- .. note::
7
-
8
- These instructions can be used almost unchanged on Ubuntu 18.04 (Bionic Badger). We note differences where they occur.
9
-
10
- Dependencies
11
- ------------
12
-
13
- Install the CARTA backend and other required packages
14
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
-
16
- .. code-block:: shell
17
-
18
- # Add CARTA PPA
19
- sudo add-apt-repository ppa:cartavis-team/carta
20
- sudo apt-get update
21
-
22
- # Install the backend package with all dependencies
23
- sudo apt-get install carta-backend
24
-
25
- # Install additional packages
26
- sudo apt-get install nginx g++ mongodb make curl
27
-
28
- .. note::
29
- The ``carta-backend`` package is updated with every stable CARTA release. If you would like to install the latest **beta** version of CARTA, or to receive beta release updates as well as stable release updates in the future, please install the ``carta-backend-beta`` package instead:
30
-
31
- .. code-block:: shell
32
-
33
- sudo apt-get install install carta-backend-beta
34
-
35
- These packages cannot be installed simultaneously, as they use the same install locations. If you install one, you will automatically be prompted to uninstall the other.
36
-
37
- Make sure that you install the matching controller version (using the ``beta`` tag).
38
-
39
- Set up directories and permissions
40
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41
-
42
- Ensure that all users who should have access to CARTA belong to a group that identifies them (assumed here to be called ``carta-users``).
43
-
44
- .. code-block:: shell
45
-
46
- # create a 'carta' user to run the controller
47
- sudo adduser --system --home /var/lib/carta --shell=/bin/bash --group carta
48
-
49
- # add 'carta' user to the shadow group (only required for PAM UNIX authentication)
50
- sudo usermod -a -G shadow carta
51
-
52
- # log directory owned by carta
53
- sudo mkdir -p /var/log/carta
54
- sudo chown carta: /var/log/carta
55
-
56
- # config directory owned by carta
57
- sudo mkdir -p /etc/carta
58
- sudo chown carta: /etc/carta
59
-
60
- # edit sudoers file to allow passwordless sudo execution of
61
- # /usr/local/bin/carta-kill-script and /usr/bin/carta_backend
62
- # by the carta user
63
- sudo visudo -f /etc/sudoers.d/carta_controller
64
-
65
- An :ref:`example sudoers configuration<example_sudoers>` is provided in the configuration section.
66
-
67
- Configure nginx
68
- ~~~~~~~~~~~~~~~
69
-
70
- A :ref:`sample configuration file<example_nginx>` is provided in the configuration section. This should be adapted to your server configuration. The relevant part of the config is for forwarding ``/`` to port 8000.
71
-
72
- Install CARTA controller
73
- ------------------------
74
-
75
- .. note::
76
-
77
- We recommend using the `latest LTS version <https://github.com/nodejs/release#release-schedule>`_ of NodeJS. The oldest version known to work with the controller is v16. In the example below we install the latest LTS version from the `NodeSource repo <https://github.com/nodesource/distributions>`_. Do not pass the ``--unsafe-perm`` flag to ``npm`` if using a local install.
78
-
79
- .. code-block:: shell
80
-
81
- # Install the latest NodeJS LTS repo
82
- curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
83
-
84
- # Install NodeJS, NPM and tools required to compile native addons
85
- sudo apt-get install -y nodejs build-essential
86
-
87
- # Install carta-controller (includes frontend config)
88
- sudo npm install -g --unsafe-perm carta-controller
89
-
90
- # Install PM2 node service
91
- sudo npm install -g pm2
92
-
93
- # Switch to carta user
94
- sudo su - carta
95
-
96
- # Generate private/public keys
97
- cd /etc/carta
98
- openssl genrsa -out carta_private.pem 4096
99
- openssl rsa -in carta_private.pem -outform PEM -pubout -out carta_public.pem
100
-
101
- .. note::
102
-
103
- If you would like to install the latest **beta** release of CARTA, please install the ``beta`` tag of the controller instead:
104
-
105
- .. code-block:: shell
106
-
107
- sudo npm install -g --unsafe-perm carta-controller@beta
108
-
109
- Configure controller
110
- ~~~~~~~~~~~~~~~~~~~~
111
-
112
- Edit ``/etc/carta/config.json`` to customise the appearance of the dashboard and other options. A :ref:`sample configuration file<example_config>` is provided in the configuration section.
113
-
114
- Run controller
115
- ~~~~~~~~~~~~~~
116
-
117
- This should be executed as the ``carta`` user.
118
-
119
- .. code-block:: shell
120
-
121
- pm2 start carta-controller
122
-
123
- Create pm2 startup script
124
- ~~~~~~~~~~~~~~~~~~~~~~~~~
125
-
126
- This service will start the controller automatically after a reboot. Please refer to the `pm2 documentation <https://pm2.keymetrics.io/docs/usage/startup/>`_ for detailed instructions. You should run ``pm2 startup`` as ``carta``, execute the generated command as a user with ``sudo`` access, and finally run ``pm2 save`` as ``carta`` to save the running controller process.
127
-