Skip to content

Commit 114c1f0

Browse files
authored
Add py perf bench function (#15)
* Add py perf bench function * Port bench function to new format * Version bump * Update docs * Tweaks to dockerfile
1 parent 535fbb4 commit 114c1f0

File tree

5 files changed

+26
-23
lines changed

5 files changed

+26
-23
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
if: github.event.pull_request.draft == false
1313
runs-on: ubuntu-20.04
1414
container:
15-
image: faasm/cpython:0.0.12
15+
image: faasm/cpython:0.1.0
1616
defaults:
1717
run:
1818
working-directory: /code/python
@@ -42,7 +42,7 @@ jobs:
4242
REDIS_QUEUE_HOST: redis
4343
REDIS_STATE_HOST: redis
4444
container:
45-
image: faasm/cpython:0.0.12
45+
image: faasm/cpython:0.1.0
4646
defaults:
4747
run:
4848
working-directory: /code/python

Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM faasm/cpp-sysroot:0.0.24
1+
FROM faasm/cpp-sysroot:0.1.0
22
ARG FAASM_PYTHON_VERSION
33

44
RUN apt install -y \
@@ -24,9 +24,6 @@ RUN git clone \
2424
WORKDIR /code/python
2525
RUN git submodule update --init
2626

27-
# Install pyfaasm natively
28-
RUN inv pyfaasm.native
29-
3027
# Build CPython to wasm
3128
RUN inv cpython
3229

README.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@ It also provides a [small Python library](pyfaasm/) which uses `ctypes` to
77
support calls to the [Faasm host
88
interface](https://github.com/faasm/faasm/blob/master/docs/host_interface.md).
99

10-
## Set-up and development
10+
## Development
1111

12-
This repo is developed using the Faasm development environment, set up according
13-
to [the docs](https://github.com/faasm/faasm/blob/master/docs/development.md).
12+
Most use of this project is via the Faasm [development
13+
environment](https://github.com/faasm/faasm/blob/master/docs/development.md).
14+
15+
You should only need the instructions below if you want to:
16+
17+
- Modify the Faasm CPython runner.
18+
- Change the Faasm Python host interface (`pyfaasm`).
19+
- Add Python libraries to the Faasm environment.
20+
21+
### Building CPython and libraries
1422

1523
To set up your local environment, run the `python` CLI as per the Faasm docs,
1624
then:
@@ -73,19 +81,6 @@ new version, you can:
7381
- Check the release build has run
7482
- Create a pull request
7583

76-
## PyFaasm
77-
78-
To build and test this natively using the Faasm emulator (from inside the
79-
development container):
80-
81-
```bash
82-
# Build natively
83-
inv pyfaasm.native
84-
85-
# Run tests
86-
inv pyfaasm.test
87-
```
88-
8984
## Set-up notes
9085

9186
We highly recommend using the containerised approach above. Everything

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.12
1+
0.1.0

func/python/bench_deltablue.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from pyperformance.benchmarks.bm_deltablue import delta_blue
2+
3+
4+
def faasm_main():
5+
print("Running deltablue python benchmark")
6+
7+
delta_blue(100)
8+
9+
print("Deltablue python benchmark complete")
10+
11+
return 0

0 commit comments

Comments
 (0)