Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alert history #3191

Merged
merged 17 commits into from
Apr 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# CHANGELOG

## Release 2.9.0 (in development)
### Features Added
- [#3180](https://github.com/scality/metalk8s/issues/3180) - All alerts from
Alertmanager are now stored in Loki database for persistence
(PR[#3191](https://github.com/scality/metalk8s/pull/))

### Enhancements
- Bump Kubernetes version to 1.20.4 (PR[#3139](https://github.com/scality/metalk8s/pull/3139))

Expand Down
1 change: 1 addition & 0 deletions buildchain/buildchain/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def git_ref() -> Optional[str]:
STORAGE_OPERATOR_SOURCES: FrozenSet[Path] = frozenset(
filepath for filepath in STORAGE_OPERATOR_ROOT.rglob("*.go")
)
GO_SOURCES: FrozenSet[Path] = frozenset(filepath for filepath in ROOT.rglob("*.go"))

# For mypy, see `--no-implicit-reexport` documentation.
__all__ = ["ROOT"]
7 changes: 3 additions & 4 deletions buildchain/buildchain/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ def task_format() -> Iterator[types.TaskDict]:

def format_go() -> types.TaskDict:
"""Format Go code using gofmt."""
cwd = constants.STORAGE_OPERATOR_ROOT
cmd = " ".join(
map(
shlex.quote,
[
config.ExtCommand.GOFMT.value,
"-s",
"-w",
*tuple(constants.STORAGE_OPERATOR_FMT_ARGS),
*tuple(str(path) for path in constants.GO_SOURCES),
],
)
)
Expand All @@ -40,9 +39,9 @@ def format_go() -> types.TaskDict:
"name": "go",
"title": utils.title_with_subtask_name("FORMAT"),
"doc": format_go.__doc__,
"actions": [doit.action.CmdAction(cmd, cwd=cwd)],
"actions": [doit.action.CmdAction(cmd, cwd=constants.ROOT).execute],
"task_dep": ["check_for:gofmt"],
"file_dep": list(constants.STORAGE_OPERATOR_SOURCES),
"file_dep": list(constants.GO_SOURCES),
}


Expand Down
3 changes: 3 additions & 0 deletions buildchain/buildchain/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ def _operator_image(name: str, **kwargs: Any) -> targets.OperatorImage:
# }}}
# Container images to build {{{
TO_BUILD: Tuple[targets.LocalImage, ...] = (
_local_image(
name="metalk8s-alert-logger",
),
_local_image(
name="salt-master",
build_args={"SALT_VERSION": versions.SALT_VERSION},
Expand Down
7 changes: 3 additions & 4 deletions buildchain/buildchain/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,13 @@ def lint_sls() -> types.TaskDict:

def check_go_fmt() -> Optional[doit.exceptions.TaskError]:
"""Check if Go code is properly formatted."""
cwd = constants.STORAGE_OPERATOR_ROOT
cmd = [
config.ExtCommand.GOFMT.value,
"-s",
"-d",
*tuple(constants.STORAGE_OPERATOR_FMT_ARGS),
*tuple(str(path) for path in constants.GO_SOURCES),
]
diff = subprocess.check_output(cmd, cwd=cwd)
diff = subprocess.check_output(cmd, cwd=constants.ROOT)
if diff:
return doit.exceptions.TaskError(
msg="badly formatted Go code, please run `doit.sh format:go`"
Expand Down Expand Up @@ -181,7 +180,7 @@ def lint_go() -> types.TaskDict:
"doc": lint_go.__doc__,
"actions": [check_go_fmt, check_go_codegen],
"task_dep": ["check_for:gofmt", "check_for:operator-sdk", "check_for:git"],
"file_dep": list(constants.STORAGE_OPERATOR_SOURCES),
"file_dep": list(constants.GO_SOURCES),
}


Expand Down
3 changes: 3 additions & 0 deletions buildchain/buildchain/salt_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ def _get_parts(self) -> Iterator[str]:
data=versions.SALT_VERSIONS_JSON,
renderer=targets.Renderer.JSON,
),
Path("salt/metalk8s/addons/alert-logger/deployed/deployment.sls"),
Path("salt/metalk8s/addons/alert-logger/deployed/init.sls"),
Path("salt/metalk8s/addons/alert-logger/deployed/service.sls"),
Path("salt/metalk8s/addons/dex/ca/init.sls"),
Path("salt/metalk8s/addons/dex/ca/installed.sls"),
Path("salt/metalk8s/addons/dex/ca/advertised.sls"),
Expand Down
5 changes: 5 additions & 0 deletions buildchain/buildchain/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ def _version_prefix(version: str, prefix: str = "v") -> str:
digest="sha256:240b10b07e15e95c3009da938e3abb8bef2fa47ea1f719ae58f7dd116bcb2f10",
),
# Local images
Image(
name="metalk8s-alert-logger",
version=VERSION,
digest=None,
),
Image(
name="metalk8s-ui",
version=VERSION,
Expand Down
6 changes: 3 additions & 3 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# NOTE: the MetalK8s repository root is supposed to be mounted at
# `/usr/src/metalk8s` when running the container

FROM docker.io/ubuntu:18.04
FROM docker.io/ubuntu:20.04

RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
Expand All @@ -16,8 +16,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
make \
plantuml \
graphviz \
python3.6 \
python3-buildbot-worker \
python3 \
python3-pip \
python3-setuptools \
texlive-fonts-extra \
Expand All @@ -30,7 +30,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \

# NOTE: the tox package available is too old; we want tox >= 3.4, for the
# `commands_pre` syntax
RUN python3.6 -m pip install six==1.14.0 tox==3.14.3 && \
RUN python3 -m pip install six==1.14.0 tox==3.14.3 && \
rm -rf ~/.cache/pip

WORKDIR /usr/src/metalk8s
Expand Down
Loading