Skip to content

Commit

Permalink
Merge tag '7.0.10rc1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarsakov committed Sep 25, 2024
2 parents c47858d + 67e6160 commit 75d48be
Show file tree
Hide file tree
Showing 11 changed files with 131 additions and 10 deletions.
9 changes: 5 additions & 4 deletions .env
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
CLICKHOUSE_IMAGE=clickhouse/clickhouse-server:23.8.2.7
POSTGRES_IMAGE=postgres:15.5
NGINX_IMAGE=nginx:1.24.0
INFINIMETRICS_IMAGE=infinidat/infinimetrics:7.0.0
CLICKHOUSE_IMAGE=clickhouse/clickhouse-server:23.8.16
POSTGRES_IMAGE=postgres:15.8
NGINX_IMAGE=nginx:1.26.1
BASE_PYTHON_IMAGE=python:3.11-slim
INFINIMETRICS_IMAGE=git.infinidat.com:4567/host-internal/infinimetrics/infinimetrics/master:7.0.10
POSTGRES_USER=infinimetrics
POSTGRES_PASSWORD=infinimetrics
PLATFORM_NAME=self-hosted
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Compose file and installation script to deploy containerized InfiniMetrics in a

Name | Minimal requirement
--- | --- |
Docker | 20.10.18+
Docker Compose | 2.17.0+
Docker | 20.10.18
Docker Compose | 2.17.0
Bash |
Container architecture | linux/x86_64

Expand Down Expand Up @@ -89,7 +89,6 @@ Start InfiniMetrics manually after the upgrade:
```
docker compose --env-file .env --env-file .env.user up -d
```

## Install.sh usage

```
Expand Down Expand Up @@ -166,3 +165,11 @@ In addition to the log tar file, also provide the output of docker_logs.sh scrip
./docker_logs.sh --since <date>

Where `<date>` is in YYYY-MM-DD format.

## Offline installation

In case this compose suite is deployed in an environment without Internet access to the public DockerHub, first load the provided images by first executing:

./image_load.sh

Then proceed with `install.sh` instructions from above.
4 changes: 4 additions & 0 deletions common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ services:
<<: [*common-env, *dot-env]
postgres:
container_name: infinimetrics_postgres
command: -c config_file=/etc/postgresql.conf
hostname: postgres
restart: always
build:
Expand All @@ -117,6 +118,9 @@ services:
- type: bind
source: ${POSTGRES_DIR:-./data/postgres}
target: /var/lib/postgresql/data
- type: bind
source: ./docker/conf/postgresql.conf
target: /etc/postgresql.conf
healthcheck:
test: [
"CMD-SHELL",
Expand Down
12 changes: 12 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ services:
condition: service_healthy
clickhouse:
condition: service_healthy
# For being able to read the real hostname
volumes:
- type: bind
source: /etc/hostname
target: /app/data/realhostname
read_only: true
web:
<<: *imx-image
extends:
Expand All @@ -55,6 +61,12 @@ services:
condition: service_healthy
collect_stats:
condition: service_healthy
# For being able to read the real hostname
volumes:
- type: bind
source: /etc/hostname
target: /app/data/realhostname
read_only: true

volumes:
infinimetrics-static:
16 changes: 16 additions & 0 deletions docker/conf/postgresql.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
listen_addresses = '*'
port = 5432
# For non-container environments (s.t RHEL), the following settings are found
# here: src/infinimetrics/scripts/database_config.py
# 256MB CONFIG FILE
max_connections = 300
shared_buffers = 80MB
effective_cache_size = 192MB
work_mem = 327kB
maintenance_work_mem = 16MB
checkpoint_completion_target = 0.7
wal_buffers = 1966kB
default_statistics_target = 100
ssl = false
min_wal_size = 512MB
max_wal_size = 1536MB
1 change: 1 addition & 0 deletions docker/offline/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.gz
25 changes: 25 additions & 0 deletions image_export.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -e
# Source the images from variables
. .env

OFFLINE_TAR_ARTIFACT="./docker/offline/images.tar.gz"

echo "INFO: Images to be loaded:"
echo
echo "CLICKHOUSE_IMAGE = ${CLICKHOUSE_IMAGE}"
echo "POSTGRES_IMAGE = ${CLICKHOUSE_IMAGE}"
echo "NGINX_IMAGE = ${NGINX_IMAGE}"
echo "INFINIMETRICS_IMAGE = ${INFINIMETRICS_IMAGE}"
echo

echo "INFO: starting loading..."

docker pull --platform linux/amd64 "$INFINIMETRICS_IMAGE"
docker pull --platform linux/amd64 "$POSTGRES_IMAGE"
docker pull --platform linux/amd64 "$CLICKHOUSE_IMAGE"
docker pull --platform linux/amd64 "$NGINX_IMAGE"

docker save "$POSTGRES_IMAGE" "$CLICKHOUSE_IMAGE" "$NGINX_IMAGE" "$INFINIMETRICS_IMAGE" | gzip > $OFFLINE_TAR_ARTIFACT

echo "INFO: done."
50 changes: 50 additions & 0 deletions image_load.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env bash
set -e

verify_image() {
docker image inspect "$1" >/dev/null 2>&1;
}

OFFLINE_TAR_ARTIFACT="./docker/offline/images.tar.gz"

# Verify minimum docker requirements
source "./install/check-min-req.sh"

# Source the images from variables
. .env

echo "INFO: Images to be loaded:"
echo
echo "CLICKHOUSE_IMAGE = ${CLICKHOUSE_IMAGE}"
echo "POSTGRES_IMAGE = ${CLICKHOUSE_IMAGE}"
echo "NGINX_IMAGE = ${NGINX_IMAGE}"
echo "INFINIMETRICS_IMAGE = ${INFINIMETRICS_IMAGE}"
echo

echo "INFO: starting loading..."

docker load < $OFFLINE_TAR_ARTIFACT

echo "INFO: Verifying loaded images"

if ! verify_image "$CLICKHOUSE_IMAGE"; then
echo "$CLICKHOUSE_IMAGE wasn't loaded"
exit 1
fi

if ! verify_image "$POSTGRES_IMAGE"; then
echo "$POSTGRES_IMAGE wasn't loaded"
exit 1
fi

if ! verify_image "$NGINX_IMAGE"; then
echo "$NGINX_IMAGE wasn't loaded"
exit 1
fi

if ! verify_image "$INFINIMETRICS_IMAGE"; then
echo "$INFINIMETRICS_IMAGE wasn't loaded"
exit 1
fi

echo "INFO: Loaded all the images successfully"
2 changes: 1 addition & 1 deletion infinimetrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if [[ "$cmd" == "restore" ]] && [[ ! "$nextarg" = "/tmp/infinimetrics/"* ]] ; t
exit 1
fi

if [[ "$cmd" == "add" ]] || [[ "$cmd" == "restore" ]] || [[ "$cmd" == "delete" ]] ; then
if [[ "$cmd" == "add" || "$cmd" == "restore" || "$cmd" == "delete" || "$cmd" == "migrate_over_ssh" ]] ; then
# Requires reloading gunicorn, so we must exec against a running service
exec $dc exec web infinimetrics "$@"
else
Expand Down
6 changes: 5 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/usr/bin/env bash
set -eE
set -u

INSTALLED_VERSION=""
ENV_USER=".env.user"
BASEDIR=$(dirname "$0")

source "$BASEDIR"/install/cli.sh
source "$BASEDIR"/install/check-min-req.sh
source "$BASEDIR"/install/init-data.sh

# Load the .env data
source "$BASEDIR"/.env

Expand Down Expand Up @@ -44,6 +46,8 @@ do
fi
done

echo "INFO: Initializing data directories ..."
source "$BASEDIR"/install/init-data.sh

# turn everything off
echo "INFO: Stopping containers ..."
Expand Down
3 changes: 2 additions & 1 deletion install/check-min-req.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ echo "INFO: Checking minimum requirements ..."

MIN_DOCKER_VERSION='20.10.18'
MIN_COMPOSE_VERSION='2.17.0'
IMX_DEBUG="${IMX_DEBUG:-0}"

vercomp() {
printf "%s\n%s" "$1" "$2" | sort --version-sort --check=quiet --reverse
Expand All @@ -24,7 +25,7 @@ fi
echo "INFO: Docker version is $DOCKER_VERSION"

DOCKER_ARCH=$(docker info --format '{{.Architecture}}')
if [[ -z "$IMX_DEBUG" && ! "$DOCKER_ARCH" = "x86_64" ]]; then
if [[ ! "$IMX_DEBUG" = "1" && ! "$DOCKER_ARCH" = "x86_64" ]]; then
echo "FAIL: Supported docker architecture is x86_64 but found $DOCKER_ARCH"
exit 1
fi
Expand Down

0 comments on commit 75d48be

Please sign in to comment.