1
1
# B2SHARE Monitoring probe for ARGO
2
2
3
3
## Setting up environment
4
- This probe has been written for Python 3 and tested with Python 3.5.2
5
- You may need to install (using e.g. ` pip ` ) the following Python modules as
4
+ This probe has been written for Python 3 and tested with Python 3.9
5
+ You may need to install (using e.g. ` pip3 ` ) the following Python modules as
6
6
they do not come with original distribution:
7
7
- requests
8
8
- jsonschema
9
- - validators
10
- - enum (in case lower than Python 3.4)
11
9
12
10
## Overview
13
- The B2SHARE probe for ARGO does the following interaction
11
+ The B2SHARE probe for ARGO does the following interaction
14
12
with B2SHARE REST API:
15
13
16
14
- Search for records
17
15
- Fetch record's metadata from search results
18
16
- Fetch record's metadata schema
19
17
- Validate record's metadata agains record's metadata schema
20
- - If a record with file is available, check that a file
18
+ - If a record with file is available, check that a file
21
19
should be able to be downloaded (HTTP HEAD request)
22
20
23
21
B2SHARE ARGO probe:
@@ -27,6 +25,30 @@ B2SHARE ARGO probe:
27
25
## Pre-requisites:
28
26
- None
29
27
28
+
29
+ ## Package dependences
30
+
31
+ Python modules "requests" and "jsonschema" have the following dependencies:
32
+
33
+ ``` python
34
+ requests== 2.31 .0
35
+ ├── certifi [required: >= 2017.4 .17, installed: 2024.2 .2]
36
+ ├── charset- normalizer [required: >= 2 ,< 4 , installed: 3.3 .2]
37
+ ├── idna [required: >= 2.5 ,< 4 , installed: 3.6 ]
38
+ └── urllib3 [required: >= 1.21 .1,< 3 , installed: 2.2 .1]
39
+
40
+
41
+ jsonschema== 4.21 .1
42
+ ├── attrs [required: >= 22.2 .0, installed: 23.2 .0]
43
+ ├── jsonschema- specifications [required: >= 2023.03 .6, installed: 2023.12 .1]
44
+ │ └── referencing [required: >= 0.31 .0, installed: 0.34 .0]
45
+ │ ├── attrs [required: >= 22.2 .0, installed: 23.2 .0]
46
+ │ └── rpds- py [required: >= 0.7 .0, installed: 0.18 .0]
47
+ ├── referencing [required: >= 0.28 .4, installed: 0.34 .0]
48
+ │ ├── attrs [required: >= 22.2 .0, installed: 23.2 .0]
49
+ │ └── rpds- py [required: >= 0.7 .0, installed: 0.18 .0]
50
+ └── rpds- py [required: >= 0.7 .1, installed: 0.18 .0]
51
+ ```
30
52
## How it works?
31
53
32
54
```
@@ -50,7 +72,7 @@ optional arguments:
50
72
51
73
Example
52
74
53
- ` $ python check_b2share.py -u https://b2share.eudat.eu:443 -t 15 -vv `
75
+ ` $ python3 check_b2share.py -u https://b2share.eudat.eu:443 -t 15 -vv `
54
76
55
77
```
56
78
TLS certificate verification: OFF
@@ -70,6 +92,16 @@ Fetching first file of the bucket.
70
92
---------------------------
71
93
OK, records, metadata schemas and files are accessible.
72
94
```
95
+ # How to run the code in a conatiner
96
+
97
+ In the root folder of the project, build the container:
98
+ ``` bash
99
+ docker build -t < name_of_the_image> :< tag_of_the_image> .
100
+ ```
101
+ Then run the code in the container
102
+ ``` bash
103
+ docker run -it --rm < name_of_the_image> :< tag_of_the_image> python3 check_b2share.py -u https://b2share.eudat.eu:443 -t 15 -vv
104
+ ```
73
105
74
106
## Credits
75
107
This code is based on [ EUDAT-B2ACCESS/b2access-probe] ( https://github.com/EUDAT-B2ACCESS/b2access-probe )
0 commit comments