Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.
Draft
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
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ services:

env:
matrix:
- TYPE=pmemkv-master OS=ubuntu OS_VER=19.10 PUSH_IMAGE=1
- TYPE=pmemkv-stable-1.0 OS=ubuntu OS_VER=19.10
- TYPE=pmemkv-stable-1.1 OS=ubuntu OS_VER=19.10
- TYPE=pmemkv-master OS=fedora OS_VER=31 PUSH_IMAGE=1
- TYPE=pmemkv-stable-1.0 OS=fedora OS_VER=31
- TYPE=pmemkv-stable-1.1 OS=fedora OS_VER=31
- TYPE=pmemkv-master OS=ubuntu OS_VER=20.04 PUSH_IMAGE=1
- TYPE=pmemkv-stable-1.0 OS=ubuntu OS_VER=20.04
- TYPE=pmemkv-stable-1.1 OS=ubuntu OS_VER=20.04
- TYPE=pmemkv-master OS=fedora OS_VER=33 PUSH_IMAGE=1
- TYPE=pmemkv-stable-1.0 OS=fedora OS_VER=33
- TYPE=pmemkv-stable-1.1 OS=fedora OS_VER=33

before_install:
- echo $TRAVIS_COMMIT_RANGE
Expand Down
75 changes: 75 additions & 0 deletions examples/interactive_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Copyright 2021, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Usage:
# insert element: 'interactive_example.py --path path_to_db --insert key value'
# lookup element: 'interactive_example.py --path path_to_db --lookup key'
# print all elements: 'interactive_example.py --path path_to_db --iterate'

import pmemkv
import argparse

def callback_kv(key, value):
print("key: ", memoryview(key).tobytes().decode(), " value: ", memoryview(value).tobytes().decode())

def callback_v(value):
print(memoryview(value).tobytes().decode())

parser = argparse.ArgumentParser()
parser.add_argument('--path', help='Path to the database')

group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('--lookup', nargs=1, metavar=('key'),
help='Print element with specified key')
group.add_argument('--insert', nargs=2, metavar=('key', 'value'),
help='Insert element with specified key and value')
group.add_argument('--iterate', action='store_true',
help='Print all elements')

args = parser.parse_args()

print("Configuring engine")
config = {}
config["path"] = args.path
config["size"] = 10485760
config["create_if_missing"] = 1

print(f"Starting engine with config: {config}")
db = pmemkv.Database("cmap", config)

if args.lookup:
db.get(args.lookup[0], callback_v)
elif args.insert:
db.put(args.insert[0], args.insert[1])
elif args.iterate:
db.get_all(callback_kv)

print("Stopping engine")
db.stop()
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2016-2020, Intel Corporation
# Copyright 2016-2021, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -35,12 +35,12 @@
#

# Pull base image
FROM fedora:31
FROM fedora:33
MAINTAINER szymon.romik@intel.com

# Set required environment variables
ENV OS fedora
ENV OS_VER 31
ENV OS_VER 33
ENV PACKAGE_MANAGER rpm
ENV NOTTY 1

Expand Down Expand Up @@ -74,6 +74,7 @@ RUN dnf update -y \
wget \
which \
python3-pip \
libatomic \
&& dnf clean all

RUN pip3 install pytest setuptools wheel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
#

# Pull base image
FROM ubuntu:19.10
FROM ubuntu:20.04
MAINTAINER szymon.romik@intel.com

# Set required environment variables
ENV OS ubuntu
ENV OS_VER 19.10
ENV OS_VER 20.04
ENV PACKAGE_MANAGER deb
ENV NOTTY 1

Expand Down
8 changes: 4 additions & 4 deletions utils/docker/images/install-libpmemobj-cpp.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Copyright 2019, Intel Corporation
# Copyright 2019-2021, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -40,8 +40,8 @@ set -e
PREFIX=/usr
PACKAGE_TYPE=$1

# master: Merge pull request #652 from ldorau/Create-separate-Docker-images-for-v1.10-branch
LIBPMEMOBJ_CPP_VERSION="006137044243981f4760ae220101a43cf97bcf2d"
# master: Merge pull request #1062 from igchor/fix_parallel_xexec
LIBPMEMOBJ_CPP_VERSION='485353b9c2fdbaf57607dcd83551664cbc3cd963'

git clone https://github.com/pmem/libpmemobj-cpp --shallow-since=2019-10-02
cd libpmemobj-cpp
Expand All @@ -50,7 +50,7 @@ git checkout $LIBPMEMOBJ_CPP_VERSION
mkdir build
cd build

cmake .. -DCPACK_GENERATOR="$PACKAGE_TYPE" -DCMAKE_INSTALL_PREFIX=$PREFIX
cmake .. -DCPACK_GENERATOR="$PACKAGE_TYPE" -DCMAKE_INSTALL_PREFIX=$PREFIX -DTESTS_USE_VALGRIND=0

if [ "$PACKAGE_TYPE" = "" ]; then
make -j$(nproc) install
Expand Down
6 changes: 3 additions & 3 deletions utils/docker/images/install-pmdk.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Copyright 2019, Intel Corporation
# Copyright 2019-2021, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -39,8 +39,8 @@ set -e
PREFIX=/usr
PACKAGE_TYPE=$1

# stable-1.8: common: fix build on GitHub Actions
PMDK_VERSION="eeb8fd86c6c72f4607a22a1e9d9f7da31be8af2a"
# 1.10
PMDK_VERSION="b661e50ac7b2a6c6b153f1a52309a0e4149eb2a2"

git clone https://github.com/pmem/pmdk --shallow-since=2019-09-26
cd pmdk
Expand Down
6 changes: 3 additions & 3 deletions utils/docker/images/prepare-pmemkv.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Copyright 2019, Intel Corporation
# Copyright 2019-2021, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -39,8 +39,8 @@ set -e
PREFIX=/usr
PACKAGE_TYPE=$1

# master: Merge pull request #602 from ldorau/Fix-setting-compilers--do-not-mix-gcc-with-clang
current_pmemkv_version="5aff9f197e2e3eaae7f419c04ab9e2fc98309eed"
# master: Merge pull request #985 from JanDorniak99/add_test_case_with_zero_filled_string
current_pmemkv_version="e57429f4640278b7eead80f89832ba1136356c81"
# stable-1.0: Merge pull request #528 from ldorau/Do-not-add-pmemkv_config...; 14.11.2019
stable_1_pmemkv_version="a3735b5393f0d5411ef8a2468b36d2a1ed00c0a1"
# stable-1.1: Version 1.1
Expand Down