-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathInvenioRDM-setup.html
More file actions
139 lines (137 loc) · 6.69 KB
/
InvenioRDM-setup.html
File metadata and controls
139 lines (137 loc) · 6.69 KB
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
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>cloud-init-examples</title>
<link rel="stylesheet" href="https://caltechlibrary.github.io/css/site.css">
<link rel="stylesheet" href="https://media.library.caltech.edu/cl-webcomponents/css/code-blocks.css">
<script type="module" src="https://media.library.caltech.edu/cl-webcomponents/copyToClipboard.js"></script>
<script type="module" src="https://media.library.caltech.edu/cl-webcomponents/footer-global.js"></script>
</head>
<body>
<header>
<a href="https://library.caltech.edu"><img src="https://media.library.caltech.edu/assets/caltechlibrary-logo.png" alt="Caltech Library logo"></a>
</header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="index.html">README</a></li>
<li><a href="LICENSE">LICENSE</a></li>
<!-- <li><a href="INSTALL.html">INSTALL</a></li> -->
<!-- <li><a href="user_manual.html">User Manual</a></li> -->
<li><a href="about.html">About</a></li>
<li><a href="search.html">Search</a></li>
<li><a href="https://github.com/caltechlibrary/cloud-init-examples">GitHub</a></li>
</ul>
</nav>
<section>
<h1 id="invenio-rdm-setup">Invenio RDM Setup</h1>
<p>This is a recipe for getting a development version of InvenioRDM
running inside a multipass VM</p>
<h2 id="pre-requisites">Pre-requisites</h2>
<p>You need the following installed to follow along with these
instructions. It assumes you’re running macOS though it should work for
Windows too.</p>
<ol type="1">
<li>Install <a href="https://multipass.run"
title="Multipass website has a link tand instruction to install it based on host operating system, macOS -- Windows or Linux">multipass</a></li>
<li>Git client so you can download our cloud init examples repository
assumeed by these instructions</li>
</ol>
<p>If you’re already running Linux (e.g. Ubuntu 20.04 LTS), you can
install multipass using <a href="https://snapscraft.io"
title="The snaps website">snap</a>.</p>
<p>Optional: If you want to access the web browser inside your VM,
install a remote desktop viewer. Microsoft Remote Desktop works for both
Windows and macOS machines. On macOS install it from the app store. You
can then use a remote desktop view that support xrdp protocol such as
the <a href="https://remmina.org/"
title="Remote access screen and file sharing to your desktop website">Remmina</a>
package via <code>sudo apt install remmina</code> or
<code>sudo snap install remmina</code>.</p>
<h2 id="vm-setup-recipe">VM Setup Recipe</h2>
<p>Here are a summary of the steps. The full commands can be found
below. 1. Clone the cloud-init-examples repository 2. change to that
directory 3. Use <code>start-vm.bash invenio-rdm xlarge focal</code> to
create the VM and start it the first time 4. Add a password for the user
you’re going to log in with, e.g. ubuntu user 5. Install
<code>nvm</code>, the node version manager 6. Before you reboot, make
sure xrdp and ubuntu-desktop are installed and updated 7. Reboot the VM
just to make sure everything is working correctly 8. Use
<code>multipass info invenio-rdm</code> to find the IP address and
running state of the VM before proceeding to the next section</p>
<p>On your host machine where you’ve installed <a
href="https://multipass.run" title="Multipass website">multipass</a> you
can issue the following commands.</p>
<pre class="shell"><code> git clone git@github.com:caltechlibrary/cloud-init-examples
cd cloud-init-examples
./start-vm.bash invenio-rdm xlarge
multipass shell invenio-rdm
sudo passwd ubuntu
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
sudo apt update
sudo apt dist-upgrade
sudo apt autoremove
sudo apt autoclean
sudo reboot
multipass info invenio-rdm</code></pre>
<p>Before we go forward Ubuntu gets updates. It’s a good idea to also
update your VM’s Ubuntu even when running a LTS.</p>
<p>NOTE: When you reboot the VM you’ll be dumpted out at your host
system’s shell. Wait a minute or then use Use the last command
<code>multipass info invenio-rdm</code> to get the reboot status and to
show the IP addresses we need to connect to the VM.</p>
<h2 id="inveniordm-configuration">InvenioRDM Configuration</h2>
<p>Now we can connect to our vm in our terminal window</p>
<pre class="shell"><code> multipass shell invenio-rdm</code></pre>
<p>If you’re going to do development InvenioRDM needs NodeJS 14.0.0 to
build properly. We need to install NodeJS using <code>nvm</code> to meet
that requirement.</p>
<pre class="shell"><code> nvm install 14</code></pre>
<p>Now we can follow the instructions based on
https://inveniordm.docs.cern.ch/install/build-setup-run/.</p>
<pre><code> invenio-cli init rdm -c v9.1</code></pre>
<p>I answered the questions as follows</p>
<ul>
<li>project_name: demo</li>
<li>project_shortname: demo</li>
<li>project_site: demo.local</li>
<li>github_repo: rsdoiel/invenio-demo</li>
<li>desciption: Demo InvenioRDM Instance</li>
<li>author_name: Caltech Library</li>
<li>author_email: rsdoiel@caltech.edu</li>
<li>year: 2022</li>
<li>then accepted all the defaults.</li>
</ul>
<p>In the terminal run the following commands</p>
<pre class="shell"><code> cd demo
invenio-cli install
invenio-cli services setup</code></pre>
<p>Now edit the ‘invenio.cfg’ file to add your VM IP address. In this
example mine was 192.168.64.8; please change this to the IP for your VM.
You can get the IP address of the VM from running
<code>multipass info invenio</code> on your host machine.</p>
<pre><code>APP_ALLOWED_HOSTS = ['0.0.0.0', 'localhost', '127.0.0.1', '192.168.64.8']
SITE_UI_URL = "https://192.168.64.8"
SITE_API_URL = "https://192.168.64.8/api"</code></pre>
<p>Now we can run the application</p>
<pre class="shell"><code> invenio-cli run --host 192.168.64.8</code></pre>
<p>NOTE: The first to you use <code>invenio-cli run</code> it will
install system vocabularies, this takes a few minutes. You can press
ctl-C once the process once log messages stop appearing.</p>
<p>NOTE: Invenio runs on port 5000 by default, the URL would look like
https://192.168.64.8:5000 for our example.</p>
<p>You can now open firefox and go to your VM’s IP address port 5000 to
see your Invenio instance. Other browsers may work, but have more
annoying warnings about the self-signed SSL certificate that is used.
Chrome will just fail unless you get Let’s Encrypt and cerbot
working.</p>
<p>Sometimes you need to tear down and start over an development
InvenioRDM instance. These need to be run from the directory where you
installed the Invenio demo.</p>
<pre class="shell"><code> invenio-cli services stop
invenio-cli services destroy
invenio-cli destroy</code></pre>
</section>
<footer-global></footer-global>
</body>
</html>