You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/develop/cleanup.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,11 @@
2
2
3
3
## Destroy the instance
4
4
5
-
Finally, we want to destroy it. This will take us to a clean state. Note that it destroys images, containers and volumes (the ones defined in the `december-release/docker-compose.full.yml`. ).
5
+
Finally, we want to destroy it. This will take us to a clean state. Note that it destroys images, containers and volumes (the ones defined in the `february-release-2/docker-compose.full.yml`. ).
Copy file name to clipboardExpand all lines: docs/develop/config.md
+5-13Lines changed: 5 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,20 +31,12 @@ When we set `RECORDS_PERMISSIONS_RECORD_POLICY = MyRecordPermissionPolicy`, we a
31
31
32
32
**Pro tip** : You can type `can_create = []` to achieve the same effect; any empty permission list only allows super users.
33
33
34
-
That's it configuration-wise. If we try to create a record through the API, your instance will check if you are a super user before allowing you. The same approach to configuration holds for any other setting you would like to override. Now we must stop the current instance, rebuild the application image and re-start it to see our changes take effect.
35
-
36
-
You can run the same `build` command. If you are in a hurry, you can skip locking dependencies.
37
-
38
-
```console
39
-
(your-virtualenv)$ invenio-cli server --containers --stop
(your-virtualenv)$ invenio-cli server --containers --start
42
-
```
34
+
That's it configuration-wise. If we try to create a record through the API, your instance will check if you are a super user before allowing you. The same approach to configuration holds for any other setting you would like to override.
43
35
44
36
Did the changes work? We are going to try to create a new record:
@@ -74,15 +66,15 @@ As you can see, the server could not know if we are authenticated/superuser and
74
66
1- Create a user, for example using the web UI (*sign up* button). Alternatively, you can do so with the CLI, executing the following command (Wait until you read point number *2* before executing):
- For now, the only available flavour is RDM (Research Data Management). In the future, there will be others, for example ILS (Integrated Library System).
55
+
56
+
- You may be prompted with `You've downloaded /home/<username>/.cookiecutters/cookiecutter-invenio-rdm before. Is it okay to delete and re-download it? [yes]:`. Press `[Enter]` in that case. This will download the latest cookiecutter template.
57
+
58
+
- Some OpenSSL versions display an error message when obtaining random numbers, but this has no incidence (as far as we can tell) on functionality. We are investigating a possible solution to raise less eyebrows for appearance sake.
In the [Preview Section](../preview/index.md), we have been running all of the
4
+
application in docker containers. This saves you the trouble of installing the
5
+
instance on your host and gets something visible fast. Now, we will run the
6
+
application locally and the database and other services in containers. It's the
7
+
best compromise between getting up and running with relevant services fast, while
8
+
allowing you to iterate on your local instance quickly.
9
+
10
+
Before going on, let's move into the project directory:
11
+
12
+
```console
13
+
$ cd february-release-2
14
+
```
15
+
16
+
To run the application locally, we will need to install it and its dependencies
17
+
first. We use the `install` command with the `--pre` flag. We need to add `--pre`
18
+
in order to allow `pipenv` to install alpha releases, since many InvenioRDM packages
19
+
are now in this phase. Be patient, it might take some time to build.
20
+
21
+
22
+
```console
23
+
$ invenio-cli install --pre
24
+
Installing python dependencies...
25
+
Symlinking invenio.cfg...
26
+
Symlinking templates/...
27
+
Collecting statics and assets...
28
+
Installing js dependencies...
29
+
Copying project statics and assets...
30
+
Symlinking assets/...
31
+
Building assets...
32
+
```
33
+
34
+
As a result, the Python dependencies for the project have been installed in
35
+
a new virtualenv for the application and many of the files in your project directory
36
+
have been symlinked inside it.
37
+
38
+
## Setup the database, Elasticsearch, Redis and RabbitMQ
39
+
40
+
We need to initialize the database, the indices and so on. For this, we can use
41
+
the `services` command. Note that this command is only needed once. Afterwards, you
42
+
can stop (not destroy) these services and start again, and your data will still be there.
43
+
44
+
```console
45
+
$ invenio-cli services
46
+
Making sure containers are up...
47
+
Creating database...
48
+
Creating indexes...
49
+
Creating files location...
50
+
Creating admin role...
51
+
Assigning superuser access to admin role...
52
+
```
53
+
54
+
In case you want to wipe out the data that was there (say to start fresh),
55
+
you can use `--force` and nuke the content!
56
+
57
+
```console
58
+
$ invenio-cli services --force
59
+
Making sure containers are up...
60
+
Flushing redis cache...
61
+
Deleting database...
62
+
Deleting indexes...
63
+
Purging queues...
64
+
Creating database...
65
+
Creating indexes...
66
+
Creating files location...
67
+
Creating admin role...
68
+
Assigning superuser access to admin role...
69
+
```
70
+
71
+
**Known issues**:
72
+
73
+
The Elasticsearch container might crash due to lack of memory. One solution is to increase the maximum allowed allocation per process (See more [here](https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docker.html)). Solving this issue depends on your OS:
74
+
75
+
On Linux, add the following to ``/etc/sysctl.conf`` on your local machine (host machine):
Copy file name to clipboardExpand all lines: docs/develop/run.md
+24-43Lines changed: 24 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,35 +1,15 @@
1
1
# Run it!
2
2
3
-
## Run the instance
4
-
5
-
Let's get it rolling!
6
-
7
-
Once the images have been built, they just need to run. For that, the `server` command is executed. **WARNING: It is the SERVER command, NOT the RUN command**.
3
+
Once the application is installed locally and the services are running, our
4
+
application just needs to run. For that, the `run` command is executed.
8
5
9
6
```console
10
-
(your-virtualenv)$ invenio-cli server --containers
11
-
Booting up server...
12
-
Starting docker containers. It might take up to a minute.
13
-
Containers started use --stop to stop server.
14
-
```
15
-
16
-
**Known issues**:
17
-
18
-
The Elasticsearch container might crash due to lack of memory. One solution is to increase the maximum allowed allocation per process (See more [here](https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docker.html)). Solving this issue depends on your OS:
19
-
20
-
On Linux, add the following to ``/etc/sysctl.conf`` on your local machine (host machine):
Navigate to https://localhost/search . Note that you might need to accept the SSL exception since it's using a test certificate.
156
+
Navigate to https://localhost:5000/search . Note that you might need to accept the SSL exception since it's using a test certificate.
177
157
And visit the record page for the newly created record. You will see it has no files associated with it. Let's change that!
178
158
179
-
### ** NEW **Upload a file to a record
159
+
### Upload a file to a record
180
160
181
161
For demonstration purposes, we will attach this scientific photo:
182
162
183
163

184
164
185
165
By <ahref="https://unsplash.com/@matyssik"target="_blank"rel="noopener noreferrer">Ian Matyssik</a>
186
166
187
-
188
167
Save it as `snow_doge.jpg` in your current directory. Then upload it to the record:
189
168
190
169
**WARNING** Change `pv1dx-rwa61` in the URLs below for the recid of your record.
191
170
192
171
```
193
-
$ curl -k -X PUT https://localhost/api/records/pv1dx-rwa61/files/snow_doge.jpg \
172
+
$ curl -k -X PUT https://localhost:5000/api/records/pv1dx-rwa61/files/snow_doge.jpg \
194
173
-H "Content-Type: application/octet-stream" \
195
174
--data-binary @snow_doge.jpg
196
175
```
@@ -202,5 +181,7 @@ This file can then be previewed on the record page and even downloaded.
202
181
We have reached the end of this journey, we are going to stop the instance. Nonetheless you can keep testing and playing around with configurations!
203
182
204
183
```console
205
-
(your-virtualenv)$ invenio-cli server --containers --stop
0 commit comments