Skip to content

Commit

Permalink
Release (#598)
Browse files Browse the repository at this point in the history
* bump code version

* ci: add function to generate changelog for release body

* bump faabric code

* cli: bump jinja2 version to avoid import error

* docker: add missing directories in the runtime root dir
  • Loading branch information
csegarragonz committed Feb 25, 2022
1 parent e97e23d commit 8cb02cd
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FAASM_VERSION=0.8.0
FAASM_CLI_IMAGE=faasm/cli:0.8.0
FAASM_VERSION=0.8.1
FAASM_CLI_IMAGE=faasm/cli:0.8.1

CPP_VERSION=0.1.4
CPP_CLI_IMAGE=faasm/cpp-sysroot:0.1.4
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
container:
image: faasm/cli:0.8.0
image: faasm/cli:0.8.1
steps:
# Get the code
- name: "Fetch ref"
Expand All @@ -40,7 +40,7 @@ jobs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
container:
image: faasm/cli:0.8.0
image: faasm/cli:0.8.1
steps:
- name: "Fetch ref"
run: git fetch origin ${GITHUB_REF}:ci-branch
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
container:
image: faasm/cli:0.8.0
image: faasm/cli:0.8.1
steps:
- name: "Conan cache"
uses: faasm/conan-cache-action@v1
Expand Down Expand Up @@ -140,14 +140,14 @@ jobs:
TSAN_OPTIONS: "halt_on_error=1:suppressions=/usr/local/code/faasm/thread-sanitizer-ignorelist.txt:history_size=7:second_deadlock_stack=1"
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
container:
image: faasm/cli:0.8.0
image: faasm/cli:0.8.1
services:
redis:
image: faasm/redis:0.8.0
image: faasm/redis:0.8.1
ports:
- 6379:6379
minio:
image: faasm/minio:0.8.0
image: faasm/minio:0.8.1
env:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.0
0.8.1
57 changes: 57 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# configuration file for git-cliff (0.1.0)

[changelog]
# changelog header
header = """
Here is what has changed since last release:
"""
# template for the changelog body
# https://tera.netlify.app/docs/#introduction
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [unreleased]
{% endif %}\
{% for commit in commits %} * {{ commit.message | upper_first | split(pat="\n") | first }}
{% endfor %}
"""
# remove the leading and trailing whitespace from the template
trim = true
# changelog footer
footer = """
<!-- generated by git-cliff -->
"""

[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = false
# filter out the commits that are not conventional
filter_unconventional = false
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^feat", group = "Features"},
{ message = "^fix", group = "Bug Fixes"},
{ message = "^doc", group = "Documentation"},
{ message = "^perf", group = "Performance"},
{ message = "^refactor", group = "Refactor"},
{ message = "^style", group = "Styling"},
{ message = "^test", group = "Testing"},
{ message = "^chore\\(release\\): prepare for", skip = true},
{ message = "^chore", group = "Miscellaneous Tasks"},
{ body = ".*security", group = "Security"},
]
# filter out the commits that are not matched by commit parsers
filter_commits = false
# glob pattern for matching git tags
tag_pattern = "v[0-9]*"
# regex for skipping tags
skip_tags = "v0.1.0-beta.1"
# regex for ignoring tags
ignore_tags = ""
# sort the tags chronologically
date_order = true
# sort the commits inside sections by oldest/newest order
sort_commits = "newest"
2 changes: 1 addition & 1 deletion deploy/k8s/minio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
spec:
containers:
- name: minio-main
image: faasm/minio:0.8.0
image: faasm/minio:0.8.1
env:
- name: MINIO_ROOT_USER
value: "minio"
Expand Down
4 changes: 2 additions & 2 deletions deploy/k8s/redis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
spec:
containers:
- name: master
image: faasm/redis:0.8.0
image: faasm/redis:0.8.1
ports:
- containerPort: 6379

Expand All @@ -28,7 +28,7 @@ metadata:
spec:
containers:
- name: master
image: faasm/redis:0.8.0
image: faasm/redis:0.8.1
ports:
- containerPort: 6379

Expand Down
2 changes: 1 addition & 1 deletion deploy/k8s/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
spec:
containers:
- name: upload
image: faasm/upload:0.8.0
image: faasm/upload:0.8.1
ports:
- containerPort: 8002
- containerPort: 5000
Expand Down
2 changes: 1 addition & 1 deletion deploy/k8s/worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
weight: 100

containers:
- image: faasm/worker:0.8.0
- image: faasm/worker:0.8.1
env:
- name: REDIS_STATE_HOST
value: "redis-state"
Expand Down
2 changes: 2 additions & 0 deletions docker/base.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ RUN mkdir -p /usr/local/faasm/runtime_root/etc
RUN cp deploy/conf/hosts /usr/local/faasm/runtime_root/etc/
RUN cp deploy/conf/resolv.conf /usr/local/faasm/runtime_root/etc/
RUN cp deploy/conf/passwd /usr/local/faasm/runtime_root/etc/
RUN mkdir -p /usr/local/faasm/runtime_root/tmp
RUN mkdir -p /usr/local/faasm/runtime_root/share

# Out of tree build
WORKDIR /build/faasm
Expand Down
2 changes: 1 addition & 1 deletion faabric
35 changes: 23 additions & 12 deletions faasmcli/faasmcli/tasks/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,8 @@ def _get_current_branch_name():
def _get_release():
r = _get_repo()
rels = r.get_releases()
tag_name = _get_tag()

rel = rels[0]
if rel.tag_name != tag_name:
print(
"Expected latest release to have tag {} but had {}".format(
tag_name, rel.tag_name
)
)
exit(1)

return rel
return rels[0]


def _get_github_instance():
Expand Down Expand Up @@ -148,6 +138,27 @@ def tag(ctx, force=False):
_create_tag(tag_name, force=force)


def get_release_body():
"""
Generate body for release with detailed changelog
"""
docker_cmd = [
"docker run -t -v",
"{}:/app/".format(PROJ_ROOT),
"orhunp/git-cliff:latest",
"--config cliff.toml",
"--repository .",
"{}..v{}".format(_get_release().tag_name, get_faasm_version()),
]

cmd = " ".join(docker_cmd)
print("Generating release body...")
print(cmd)
result = run(cmd, shell=True, stdout=PIPE, stderr=PIPE)

return result.stdout.decode("utf-8")


@task
def create(ctx):
"""
Expand All @@ -162,7 +173,7 @@ def create(ctx):
r.create_git_release(
tag_name,
"Faasm {}".format(faasm_ver),
"Release {}\n".format(faasm_ver),
get_release_body(),
draft=True,
)

Expand Down
2 changes: 1 addition & 1 deletion faasmcli/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gunicorn==20.1.0
hiredis==2.0.0
invoke==1.5.0
myst-parser==0.16.1
Jinja2==2.11.3
Jinja2==3.0.3
matplotlib==3.3.4
networkx==2.5.1
numpy==1.21.0
Expand Down

0 comments on commit 8cb02cd

Please sign in to comment.