Skip to content

Commit 358deb1

Browse files
committed
Updated readme
1 parent fcb1763 commit 358deb1

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
# 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.
32

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+
57
- Request and response schema validation
68
- Unit testing setup
79
- 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.
912
- `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.
1114

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_
1316

1417
## 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.
1620

1721
## Requirements from the superseding layer
22+
1823
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.
1924

2025
```dockerfile
@@ -41,8 +46,8 @@ RUN chmod 755 $(find . -type d)
4146
CMD [ "/app/app.handler" ]
4247
```
4348

44-
4549
### Operating Container Structure
50+
4651
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:
4752

4853
```
@@ -55,20 +60,25 @@ Since this is only just a base layer for eval functions, the repo's file structu
5560
| |____requests.py
5661
| |____responses.py
5762
| |____handling.py
63+
| |____commands.py
64+
| |____docs.py
65+
| |____parse.py
5866
|____tools
5967
| |______init__.py
68+
| |____commands.py
6069
| |____validate.py
6170
| |____docs.py
6271
| |____parse.py
6372
| |____healthcheck.py
73+
| |____utils.py
6474
|____docs.md
6575
|____handler.py
6676
|____evaluation_tests.py
6777
|____evaluation.py
6878
```
6979

70-
7180
## Dev Notes
81+
7282
Can run the following command to look around the container of a running function
7383

7484
```bash
@@ -80,5 +90,3 @@ From a container which exposes port 8080 to the real port 9000, requests can be
8090
```
8191
http://localhost:9000/2015-03-31/functions/function/invocations
8292
```
83-
84-

handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def handler(event: JsonType, _: JsonType = {}) -> HandlerResponse:
7373
except Exception as e:
7474
error = ErrorResponse(
7575
message="An exception was raised while "
76-
"executing the preview function.",
76+
"executing the evaluation function.",
7777
detail=(str(e) if str(e) != "" else repr(e)),
7878
)
7979

0 commit comments

Comments
 (0)