Skip to content

Commit

Permalink
Bump CPP and Faasm (#18)
Browse files Browse the repository at this point in the history
* git: add task to bump version

* gh: bump faasm version

* gh: bump cpp version

* git: remove .env file

* docs: update readme

* gitmodules: move from ssh to https

* gha: add planner

* compose: add planner too

* compose: don't expose ports as we don't really need too
  • Loading branch information
csegarragonz authored Jun 1, 2023
1 parent b8bb9bb commit 5998fcc
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 19 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
container:
image: faasm.azurecr.io/examples-build:0.2.5_0.2.5
image: faasm.azurecr.io/examples-build:0.2.7_0.2.5
credentials:
username: ${{ secrets.ACR_SERVICE_PRINCIPAL_ID }}
password: ${{ secrets.ACR_SERVICE_PRINCIPAL_PASSWORD }}
Expand Down Expand Up @@ -88,28 +88,32 @@ jobs:
LOG_LEVEL: info
NETNS_MODE: off
OVERRIDE_CPU_COUNT: 30
PLANNER_HOST: planner
PLANNER_PORT: 8080
REDIS_QUEUE_HOST: redis
REDIS_STATE_HOST: redis
WASM_VM: ${{ matrix.wasm_vm }}
container:
image: faasm.azurecr.io/examples-run:0.9.6
image: faasm.azurecr.io/examples-run:0.9.9
credentials:
username: ${{ secrets.ACR_SERVICE_PRINCIPAL_ID }}
password: ${{ secrets.ACR_SERVICE_PRINCIPAL_PASSWORD }}
services:
redis:
image: faasm.azurecr.io/redis:0.9.6
image: faasm.azurecr.io/redis:0.9.9
credentials:
username: ${{ secrets.ACR_SERVICE_PRINCIPAL_ID }}
password: ${{ secrets.ACR_SERVICE_PRINCIPAL_PASSWORD }}
minio:
image: faasm.azurecr.io/minio:0.9.6
image: faasm.azurecr.io/minio:0.9.9
credentials:
username: ${{ secrets.ACR_SERVICE_PRINCIPAL_ID }}
password: ${{ secrets.ACR_SERVICE_PRINCIPAL_PASSWORD }}
env:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
planner:
image: faasm.azurecr.io/planner:0.4.4
steps:
- name: "Download examples wasm"
uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
branch = faasm-migration
[submodule "examples/polybench"]
path = examples/polybench
url = git@github.com:faasm/polybench.git
url = https://github.com/faasm/polybench.git
2 changes: 1 addition & 1 deletion FAASM_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.6
0.9.9
37 changes: 26 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ This WASM file is ready to be uploaded to a Faasm cluster using the HTTP API.
## List of examples

| Project Name | WAVM | WAMR | WAMR + SGX |
| --- | --- | --- |
| [FFmpeg](https://github.com/faasm/FFmpeg) | C, C++ | Static library |
| [Kernels](https://github.com/faasm/Kernels) | C, C++ | OpenMP, MPI |
| [LAMMPS](https://github.com/faasm/lammps) | C++ | MPI |
| [libpng](https://github.com/faasm/libpng) | C | Static library |
| [ImageMagick](https://github.com/faasm/ImageMagick) | C++ | Needs libpng |
| [LULESH](https://github.com/faasm/LULESH) | C++ | OpenMP |
| [Tensorflow](https://github.com/faasm/tensorflow) | C++ | Static library |
| --- | --- | --- | --- |
| [FFmpeg](https://github.com/faasm/FFmpeg) | :white_check_mark: | :white_check_mark: | :x: |
| [Kernels](https://github.com/faasm/Kernels) | :white_check_mark: | :x: | :x: |
| [LAMMPS](https://github.com/faasm/lammps) | :white_check_mark: | :white_check_mark: | :x: |
| [libpng](https://github.com/faasm/libpng) | :white_check_mark: | :white_check_mark: | :x: |
| [ImageMagick](https://github.com/faasm/ImageMagick) | :white_check_mark: | :white_check_mark: | :x: |
| [LULESH](https://github.com/faasm/LULESH) | :white_check_mark: | :x: | :x: |
| [PolyBench/C](https://github.com/faasm/polybench) | :white_check_mark: | :white_check_mark: | :x: |
| [Tensorflow](https://github.com/faasm/tensorflow) | :white_check_mark: | :white_check_mark: | :x: |

## Bumping C++, Python, or Faasm's version

Expand All @@ -58,11 +59,25 @@ https://github.com/faasm/faasm). As a consequence, it is versioned with the
versions of the previous.

If you want to upgrade the Python or C++ tag, you must update the submodule
and the GHA file. If you want to update the Faasm tag, you must update the
`FAASM_VERSION` file, and the GHA file. Then, re-build the container images
with:
and the files that track either version. You can do:

```bash
cd cpp
git pull origin main
cd ..
inv git.bump cpp
```

Similarly, for Faasm you can just do:

```bash
inv git.bump faasm [--ver=<specific_version>]
```

Then, tag the new version and re-build the docker images:

```bash
inv git.tag
inv docker.build -c build -c run --nocache --push
```

Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ services:
redis:
image: faasm.azurecr.io/redis:${EXAMPLES_RUN_VERSION}

planner:
image: faasm.azurecr.io/planner:0.4.4
environment:
- LOG_LEVEL=info
- PLANNER_PORT=8081

minio:
image: faasm.azurecr.io/minio:${EXAMPLES_RUN_VERSION}
environment:
Expand Down
57 changes: 56 additions & 1 deletion tasks/git.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
from invoke import task
from subprocess import run
from tasks.env import PROJ_ROOT, get_version
from tasks.env import (
EXAMPLES_BUILD_IMAGE_NAME,
PROJ_ROOT,
get_faasm_version,
get_version,
)

VERSIONED_FILES = {
"faasm": ["FAASM_VERSION", ".github/workflows/tests.yml"],
"cpp": [".github/workflows/tests.yml"],
"python": [".github/workflows/tests.yml"],
}


@task
Expand All @@ -23,3 +34,47 @@ def tag(ctx, force=False):
check=True,
cwd=PROJ_ROOT,
)


@task
def bump(ctx, submodule, ver=None):
"""
Bump a submodule's dependency: `faasm`, `cpp`, or `python`
"""
allowed_submodules = ["faasm", "cpp", "python"]
if submodule not in allowed_submodules:
print("Unrecognised submodule: {}".format(allowed_submodules))
print("Submodule must be one in: {}".format(allowed_submodules))
raise RuntimeError("Unrecognised submodule")

if submodule == "faasm":
old_ver = get_faasm_version()
if ver:
new_ver = ver
else:
# Just bump the last minor version part
new_ver_parts = old_ver.split(".")
new_ver_minor = int(new_ver_parts[-1]) + 1
new_ver_parts[-1] = str(new_ver_minor)
new_ver = ".".join(new_ver_parts)

# Replace version in all files
for f in VERSIONED_FILES["faasm"]:
sed_cmd = "sed -i 's/{}/{}/g' {}".format(old_ver, new_ver, f)
run(sed_cmd, shell=True, check=True)
else:
new_ver = get_version("build")
grep_cmd = "grep '{}' .github/workflows/tests.yml".format(
EXAMPLES_BUILD_IMAGE_NAME
)
old_ver = (
run(grep_cmd, shell=True, cwd=PROJ_ROOT, capture_output=True)
.stdout.decode("utf-8")
.strip()
.split(":")[-1]
)

# Replace version in all files
for f in VERSIONED_FILES[submodule]:
sed_cmd = "sed -i 's/{}/{}/g' {}".format(old_ver, new_ver, f)
run(sed_cmd, shell=True, check=True)

0 comments on commit 5998fcc

Please sign in to comment.