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: README.md
+18-10Lines changed: 18 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,25 @@
1
1
# BaseEvalutionFunctionLayer
2
-
Base docker image for evaluation functions coded in python. This layer cannot function alone, it needs to be extended in a specific way by evaluation function it supports.
3
2
4
-
This layer encompases all the behaviour that is universal to all evaluation functions:
3
+
Base docker image for evaluation functions coded in python. This layer cannot function alone, it needs to be extended in a specific way by evaluation function it supports.
4
+
5
+
This layer encompases all the behaviour that is universal to all evaluation functions:
6
+
5
7
- Request and response schema validation
6
8
- Unit testing setup
7
9
- Function commands:
8
-
-`eval`: calls the function in the user-defined `evaluation.py` file
10
+
-`eval`: calls the evaluation function in the user-defined `evaluation.py` file.
11
+
-`preview`: calls the preview function in the user-defined `preview.py` file.
9
12
-`healthcheck`: runs all unittests for schema testing as well as user-defined tests in `evaluation_tests.py`.
10
-
-`docs`: returns the `docs.md` user-defined file.
13
+
-`docs`: returns the `docs.md` user-defined file.
11
14
12
-
*Note: user-defined files are those provided by the evaluation function code meant to extend this layer*
15
+
_Note: user-defined files are those provided by the evaluation function code meant to extend this layer_
13
16
14
17
## Behaviour and Usage
15
-
Commands as passed in 'command' header from each request. By default (if not header is present), the function will run the `eval` command.
18
+
19
+
Commands as passed in 'command' header from each request. By default (if not header is present), the function will run the `eval` command.
16
20
17
21
## Requirements from the superseding layer
22
+
18
23
This function makes references to files and functions which don't exist yet in this layer - those need to be provided by the superseding layer. They're shown here in the way a dockerfile might be extending it.
19
24
20
25
```dockerfile
@@ -41,8 +46,8 @@ RUN chmod 755 $(find . -type d)
41
46
CMD [ "/app/app.handler" ]
42
47
```
43
48
44
-
45
49
### Operating Container Structure
50
+
46
51
Since this is only just a base layer for eval functions, the repo's file structure won't match the file structure inside the built image, which can get confusing at times. This is what the `/app/` directory (where all our data is contained) will look like for an operational function:
47
52
48
53
```
@@ -55,20 +60,25 @@ Since this is only just a base layer for eval functions, the repo's file structu
55
60
| |____requests.py
56
61
| |____responses.py
57
62
| |____handling.py
63
+
| |____commands.py
64
+
| |____docs.py
65
+
| |____parse.py
58
66
|____tools
59
67
| |______init__.py
68
+
| |____commands.py
60
69
| |____validate.py
61
70
| |____docs.py
62
71
| |____parse.py
63
72
| |____healthcheck.py
73
+
| |____utils.py
64
74
|____docs.md
65
75
|____handler.py
66
76
|____evaluation_tests.py
67
77
|____evaluation.py
68
78
```
69
79
70
-
71
80
## Dev Notes
81
+
72
82
Can run the following command to look around the container of a running function
73
83
74
84
```bash
@@ -80,5 +90,3 @@ From a container which exposes port 8080 to the real port 9000, requests can be
0 commit comments