Skip to content

Commit f4104e6

Browse files
Nano version 2.4.2 (#1)
* more modular code * better synchronization * consistent throughput calculation * iostat output display * structured output (detailed csv, aggregated csv), decoupling logging from results * more tests (cpu, random read from cache) * better documentation * object storage support * easier configuration * docker support * code quality improvements * persisting execution environment (parameters, kdb+ version, etc)
1 parent ffbcc28 commit f4104e6

38 files changed

+1164
-934
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
results/**
2+
logs/**
3+
qpbuild/**

.gitlab-ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
default:
2+
tags:
3+
- kxi-gitlab-runner
4+
5+
6+
stages:
7+
- build
8+
9+
.docker-beforescript:
10+
stage: build
11+
image: "docker:20.10.23"
12+
before_script:
13+
- |
14+
if [ -z "$DOCKER_AUTH_CONFIG" ]
15+
then
16+
echo "\$DOCKER_AUTH_CONFIG not set, unable to authenticate against container registries"
17+
exit 1
18+
fi
19+
20+
- mkdir -p $HOME/.docker && echo $DOCKER_AUTH_CONFIG > $HOME/.docker/config.json
21+
- echo ${INT_NEXUS_PASS_RW} | docker login ${INSIGHTS_DEV_NEXUS_REGISTRY} -u ${INT_NEXUS_USER_RW} --password-stdin
22+
script:
23+
- wget https://${INT_NEXUS_USER_RO}:${INT_NEXUS_PASS_RO}@ext-nexus.kxi-dev.kx.com/repository/kx-insights-packages/kdbInsightsCore/0.41.1/kdb-insights-core.tar
24+
- docker load < kdb-insights-core.tar
25+
- wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
26+
- chmod a+x /usr/local/bin/yq
27+
- IMAGE_URL="$INSIGHTS_DEV_NEXUS_REGISTRY/benchmarking/nano:$(yq -r ".${TARGET}" version.yaml)"
28+
- docker build -t "${IMAGE_URL}" .
29+
- docker push "${IMAGE_URL}"
30+
- docker rmi "${IMAGE_URL}"
31+
32+
docker-buildpub-push:
33+
variables:
34+
TARGET: "pub"
35+
extends:
36+
- .docker-beforescript
37+
rules:
38+
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
39+
40+
docker-builddev-push:
41+
variables:
42+
TARGET: "dev"
43+
extends:
44+
- .docker-beforescript
45+
rules:
46+
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'

Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM kdb-insights-core:0.41.1
2+
3+
WORKDIR /opt/kx/app
4+
5+
COPY src ./src
6+
COPY mthread.sh runSeveral.sh version.yaml ./
7+
COPY flush ./flush
8+
9+
ENV QBIN=/opt/kx/kdb/l64/q
10+
11+
ENV RESULTDIR=/appdir/results
12+
ENV LOGDIR=/appdir/logs
13+
ENV THREADNR=1
14+
ENV COMPRESS=""
15+
16+
ENV MEMUSAGETYPE=ratio
17+
ENV MEMUSAGEVALUE=0.6
18+
ENV RANDOMREADFILESIZETYPE=ratio
19+
ENV RANDOMREADFILESIZEVALUE=3
20+
ENV DBSIZE=full
21+
22+
ENV FLUSH=/opt/kx/app/flush/directmount.sh
23+
24+
RUN echo "/data" > ./partitions
25+
26+
RUN yum upgrade -y
27+
RUN yum install -y wget sysstat
28+
RUN wget https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_linux_386 -O /usr/bin/yq && chmod +x /usr/bin/yq
29+
30+
ENTRYPOINT [ "/bin/bash", "mthread.sh" ]

README.md

Lines changed: 186 additions & 114 deletions
Large diffs are not rendered by default.

build/build.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# make sure you did:
5+
# docker login ${REGISTRY}
6+
# that probably needs an access key
7+
8+
if [ $# -eq 0 ]; then
9+
TARGET=dev
10+
else
11+
TARGET=$1
12+
fi
13+
14+
IMAGENAME=nano
15+
VERSION=$(yq ".${TARGET}" version.yaml)
16+
echo "Building verion ${VERSION}"
17+
18+
docker build -t ${IMAGENAME}:${VERSION} .
19+
docker tag nano:${VERSION} nano:latest
20+
21+
IMAGE_URL=${REGISTRY}/${PROJECTDIR}/${IMAGENAME}:${VERSION}
22+
23+
docker tag nano:${VERSION} ${IMAGE_URL}
24+
docker push ${IMAGE_URL}
25+
26+
echo "$0 done"

build/gitlab

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export REGISTRY="registry.gitlab.com"
2+
export PROJECTDIR="kxdev/benchmarking/nano"

build/nexus

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export REGISTRY="ext-dev-registry.kxi-dev.kx.com"
2+
export PROJECTDIR="benchmarking"

config/env

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
export COMPRESS=""
3+
4+
# Number of threads each kdb+ process
5+
export THREADNR=1
6+
7+
export FLUSH=./flush/directmount.sh
8+
9+
##############
10+
# Settings for object storage
11+
# See this for more details: https://code.kx.com/insights/1.4/core/objstor/main.html
12+
export OBJSTORELOCTMPDIRBASE=/mnt/${USER}/OBJSTORETEST
13+
# Comment line below for testing without object storage cache
14+
export KX_OBJSTR_CACHE_PATH=/mnt/${USER}/OBJSTORECACHE
15+
16+
export AWS_REGION=eu-west-1
17+
export GCLOUD_PROJECT_ID=myproject
18+
export AZURE_STORAGE_ACCOUNT=mystorageaccount
19+
export AZURE_STORAGE_SHARED_KEY=mysharedkey
20+
21+
22+
###############################################
23+
#### You probably dont need to change this
24+
25+
export RESULTDIR="./results"
26+
export LOGDIR="./logs"
27+
28+
# Memory used for the sequential read/write tests. This determines the size of the vector created in memory.
29+
# You can specify an absolute value in MB or the ratio to the physical memory size.
30+
export MEMUSAGETYPE=ratio # Either ratio or abs
31+
export MEMUSAGEVALUE=0.6 # ratio to the physical memory
32+
33+
# Disk space used for the mid append and randome read tests.
34+
export RANDOMREADFILESIZETYPE=ratio
35+
export RANDOMREADFILESIZEVALUE=2
36+
37+
38+
# Mainly for testing, you can generate small or tiny data
39+
export DBSIZE=full
40+
41+

config/kdbenv

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
if ! command -v q &> /dev/null
2+
then
3+
export QHOME=$HOME/q # SET QHOME MANUALLY
4+
5+
if [ `uname -s` = "Darwin" ]; then
6+
QSUBDIR=w64
7+
else
8+
QSUBDIR=l64
9+
fi
10+
export QBIN="$QHOME/$QSUBDIR/q"
11+
else
12+
export QBIN=$(which q)
13+
fi
14+
15+
echo "QBIN is set to $QBIN"
16+

flush-directmount.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)