From 981dbaf7648b84def44a7948041241a0f9162b97 Mon Sep 17 00:00:00 2001 From: mittachaitu Date: Fri, 4 Sep 2020 21:09:52 +0530 Subject: [PATCH 1/5] chore(build): remove build process from repo Signed-off-by: mittachaitu --- .travis.yml | 22 +-- build_image.sh | 124 --------------- cmd/Makefile.am | 2 +- cmd/zrepl/.gitignore | 1 - cmd/zrepl/Makefile.am | 27 ---- cmd/zrepl/zrepl.c | 211 ------------------------- configure.ac | 1 - docker/Dockerfile | 24 --- docker/Dockerfile.arm64 | 24 --- docker/Dockerfile.base | 32 ---- docker/Dockerfile.base.arm64 | 32 ---- docker/entrypoint-poolimage.sh | 39 ----- include/Makefile.am | 1 + {cmd/zrepl => include}/zfs_events.h | 0 lib/libzfs/Makefile.am | 4 + {cmd/zrepl => lib/libzfs}/zfs_events.c | 3 +- 16 files changed, 10 insertions(+), 537 deletions(-) delete mode 100755 build_image.sh delete mode 100644 cmd/zrepl/.gitignore delete mode 100644 cmd/zrepl/Makefile.am delete mode 100644 cmd/zrepl/zrepl.c delete mode 100644 docker/Dockerfile delete mode 100644 docker/Dockerfile.arm64 delete mode 100644 docker/Dockerfile.base delete mode 100644 docker/Dockerfile.base.arm64 delete mode 100644 docker/entrypoint-poolimage.sh rename {cmd/zrepl => include}/zfs_events.h (100%) rename {cmd/zrepl => lib/libzfs}/zfs_events.c (99%) diff --git a/.travis.yml b/.travis.yml index 8a4f91d3e5a8..73fee8e1a8ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,28 +28,14 @@ jobs: - RUN_UZFS_TESTS=0 - RUN_ZTESTS=1 - RELEASE_TAG_DOWNSTREAM=0 - - os: linux - arch: arm64 - env: - - ZFS_BUILD_TAGS=1 - - RUN_UZFS_TESTS=0 - - RUN_ZTESTS=0 - - RELEASE_TAG_DOWNSTREAM=0 - before_install: - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - sudo apt-get update -qq - sudo apt-get install --yes -qq gcc-6 g++-6 - sudo apt-get install --yes -qq build-essential autoconf libtool gawk alien fakeroot libaio-dev jq - # linux-header package name is different on arm. - - if [ "$TRAVIS_CPU_ARCH" == "arm64" ]; then - sudo apt-get install --yes -qq linux-headers-generic; - else - sudo apt-get install --yes -qq linux-headers-$(uname -r); - fi + - sudo apt-get install --yes -qq linux-headers-$(uname -r); - sudo apt-get install --yes -qq zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev libssl-dev libjson-c-dev - sudo apt-get install --yes -qq lcov libjemalloc-dev - # packages for tests - only on amd64 - if [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then sudo apt-get install --yes -qq parted lsscsi ksh attr acl nfs-kernel-server fio; fi @@ -90,7 +76,7 @@ install: sudo dpkg -i *.deb; fi - cd .. - # Build libcstor for uzfs feature + # Clone libcstor for uzfs feature - git clone https://github.com/openebs/libcstor.git - cd libcstor - if [ ${TRAVIS_BRANCH} == "develop" ]; then git checkout master; else git checkout ${TRAVIS_BRANCH} || git checkout master; fi @@ -123,9 +109,7 @@ script: sudo /sbin/modprobe zfs; travis_wait 10 /sbin/ztest || travis_terminate 1; fi - - if [ $ZFS_BUILD_TAGS = 1 ]; then - ./build_image.sh || travis_terminate 1; - fi + # If this build is running due to travis release tag, and # this job indicates to push the release downstream, then # go ahead and tag the dependent repo. diff --git a/build_image.sh b/build_image.sh deleted file mode 100755 index a3f4e2b274cc..000000000000 --- a/build_image.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/bash -set -e - -pwd - -# Determine the arch/os we're building for -ARCH=$(uname -m) - -# Build libcstor -cd ../libcstor -make clean -sh autogen.sh -./configure --with-zfs-headers=$PWD/../cstor/include --with-spl-headers=$PWD/../cstor/lib/libspl/include -make -j4 -sudo make install -sudo ldconfig - -# Build cstor -cd ../cstor -make clean -sh autogen.sh -./configure --enable-uzfs=yes --with-config=user --with-jemalloc --with-libcstor=$PWD/../libcstor/include -make clean -make - -# The images can be pushed to any docker/image registeries -# like docker hub, quay. The registries are specified in -# the `build/push` script. -# -# The images of a project or company can then be grouped -# or hosted under a unique organization key like `openebs` -# -# Each component (container) will be pushed to a unique -# repository under an organization. -# Putting all this together, an unique uri for a given -# image comprises of: -# //: -# -# IMAGE_ORG can be used to customize the organization -# under which images should be pushed. -# By default the organization name is `openebs`. - -if [ -z "${IMAGE_ORG}" ]; then - IMAGE_ORG="openebs" -fi - -# Specify the date of build -DBUILD_DATE=$(date +'%Y-%m-%dT%H:%M:%SZ') - -# Specify the docker arg for repository url -if [ -z "${DBUILD_REPO_URL}" ]; then - DBUILD_REPO_URL="https://github.com/openebs/cstor" -fi - -# Specify the docker arg for website url -if [ -z "${DBUILD_SITE_URL}" ]; then - DBUILD_SITE_URL="https://openebs.io" -fi - -DBUILD_ARGS="--build-arg DBUILD_DATE=${DBUILD_DATE} --build-arg DBUILD_REPO_URL=${DBUILD_REPO_URL} --build-arg DBUILD_SITE_URL=${DBUILD_SITE_URL} --build-arg ARCH=${ARCH}" - - -if [ "${ARCH}" = "x86_64" ]; then - REPO_NAME="$IMAGE_ORG/cstor-base" - DOCKERFILE_BASE="Dockerfile.base" - DOCKERFILE="Dockerfile" -elif [ "${ARCH}" = "aarch64" ]; then - REPO_NAME="$IMAGE_ORG/cstor-base-arm64" - DOCKERFILE_BASE="Dockerfile.base.arm64" - DOCKERFILE="Dockerfile.arm64" -else - echo "${ARCH} is not supported" - exit 1 -fi - -mkdir -p ./docker/zfs/bin -mkdir -p ./docker/zfs/lib - -cp cmd/zrepl/.libs/zrepl ./docker/zfs/bin -cp cmd/zpool/.libs/zpool ./docker/zfs/bin -cp cmd/zfs/.libs/zfs ./docker/zfs/bin -cp cmd/zstreamdump/.libs/zstreamdump ./docker/zfs/bin - -cp lib/libzpool/.libs/*.so* ./docker/zfs/lib -cp lib/libuutil/.libs/*.so* ./docker/zfs/lib -cp lib/libnvpair/.libs/*.so* ./docker/zfs/lib -cp lib/libzfs/.libs/*.so* ./docker/zfs/lib -cp lib/libzfs_core/.libs/*.so* ./docker/zfs/lib -cp ../libcstor/src/.libs/*.so* ./docker/zfs/lib - -sudo docker version -sudo docker build --help - -curl --fail https://raw.githubusercontent.com/openebs/charts/gh-pages/scripts/release/buildscripts/push > ./docker/push -chmod +x ./docker/push - -## Building image for cstor-base -echo "Build image ${REPO_NAME}:ci with BUILD_DATE=${DBUILD_DATE}" -cd docker && \ - sudo docker build -f ${DOCKERFILE_BASE} -t ${REPO_NAME}:ci ${DBUILD_ARGS} . && \ - DIMAGE=${REPO_NAME} ./push && \ - cd .. -if [ $? -ne 0 ]; then - echo "Failed to run push script for ${REPO_NAME}" - exit 1 -fi - -if [ "${ARCH}" = "x86_64" ]; then - REPO_NAME="$IMAGE_ORG/cstor-pool" -elif [ "${ARCH}" = "aarch64" ]; then - REPO_NAME="$IMAGE_ORG/cstor-pool-arm64" -fi - -echo "Build image ${REPO_NAME}:ci with BUILD_DATE=${DBUILD_DATE}" -cd docker && \ - sudo docker build -f ${DOCKERFILE} -t ${REPO_NAME}:ci ${DBUILD_ARGS} . && \ - DIMAGE=${REPO_NAME} ./push && \ - cd .. -if [ $? -ne 0 ]; then - echo "Failed to run push script for ${REPO_NAME}" - exit 1 -fi - -rm -rf ./docker/zfs diff --git a/cmd/Makefile.am b/cmd/Makefile.am index 1ccfafef0f65..9a24299e2f25 100644 --- a/cmd/Makefile.am +++ b/cmd/Makefile.am @@ -3,6 +3,6 @@ SUBDIRS += mount_zfs fsck_zfs zvol_id vdev_id arcstat dbufstat zed SUBDIRS += arc_summary raidz_test zgenhostid if ENABLE_UZFS -SUBDIRS += zrepl uzfs_test +SUBDIRS += uzfs_test endif diff --git a/cmd/zrepl/.gitignore b/cmd/zrepl/.gitignore deleted file mode 100644 index 6ba2b052ce3a..000000000000 --- a/cmd/zrepl/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/zrepl diff --git a/cmd/zrepl/Makefile.am b/cmd/zrepl/Makefile.am deleted file mode 100644 index 966acbb543c8..000000000000 --- a/cmd/zrepl/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -include $(top_srcdir)/config/Rules.am - -# -Wnoformat-truncation to get rid of compiler warning for unchecked -# truncating snprintfs on gcc 7.1.1. -AM_CFLAGS += $(FRAME_LARGER_THAN) $(NO_FORMAT_TRUNCATION) -# Dynamic symbol table is needed for printing symbol names in stack trace -AM_LDFLAGS = -rdynamic - -DEFAULT_INCLUDES += \ - -I$(libcstordir) \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/lib/libspl/include - -sbin_PROGRAMS = zrepl - -zrepl_SOURCES = \ - zrepl.c \ - zfs_events.c - -zrepl_LDADD = \ - $(top_builddir)/lib/libnvpair/libnvpair.la \ - $(top_builddir)/lib/libuutil/libuutil.la \ - $(top_builddir)/lib/libzpool/libzpool.la \ - $(top_builddir)/lib/libzfs/libzfs.la \ - $(top_builddir)/lib/libzfs_core/libzfs_core.la - -zrepl_LDADD += ${UZFS_LIB} diff --git a/cmd/zrepl/zrepl.c b/cmd/zrepl/zrepl.c deleted file mode 100644 index 48adf9e16a08..000000000000 --- a/cmd/zrepl/zrepl.c +++ /dev/null @@ -1,211 +0,0 @@ -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "zfs_events.h" - -#define ZAP_UPDATE_TIME_INTERVAL 2 - -extern unsigned long zfs_arc_max; -extern unsigned long zfs_arc_min; -extern int zfs_autoimport_disable; -extern int zfs_do_write_coalesce; - -#if DEBUG -inject_error_t inject_error; -#endif - -kthread_t *conn_accpt_thread; -kthread_t *uzfs_timer_thread; -kthread_t *mgmt_conn_thread; - -static void -zrepl_svc_run(void) -{ - mgmt_conn_thread = zk_thread_create(NULL, 0, - uzfs_zvol_mgmt_thread, NULL, 0, NULL, - TS_RUN, 0, PTHREAD_CREATE_DETACHED); - VERIFY3P(mgmt_conn_thread, !=, NULL); - - conn_accpt_thread = zk_thread_create(NULL, 0, - uzfs_zvol_io_conn_acceptor, NULL, 0, NULL, TS_RUN, - 0, PTHREAD_CREATE_DETACHED); - VERIFY3P(conn_accpt_thread, !=, NULL); - - uzfs_timer_thread = zk_thread_create(NULL, 0, - (thread_func_t)uzfs_zvol_timer_thread, NULL, 0, NULL, TS_RUN, - 0, PTHREAD_CREATE_DETACHED); - VERIFY3P(uzfs_timer_thread, !=, NULL); -} - -/* - * Print a stack trace before program exits. - */ -static void -fatal_handler(int sig) -{ - void *array[20]; - size_t size; - - fprintf(stderr, "Fatal signal received: %d\n", sig); - fprintf(stderr, "Stack trace:\n"); - - size = backtrace(array, 20); - backtrace_symbols_fd(array, size, STDERR_FILENO); - - /* - * Hand over the sig for default processing to system to generate - * a coredump - */ - signal(sig, SIG_DFL); - kill(getpid(), sig); -} - -/* - * We would like to do a graceful shutdown here to avoid recovery actions - * when pool is imported next time. However we don't want to call export - * which does a bunch of other things which are not necessary (freeing - * memory resources etc.), since we run in userspace. - * - * mutex_enter(&spa_namespace_lock); - * while ((spa = spa_next(NULL)) != NULL) { - * strlcpy(spaname, spa_name(spa), sizeof (spaname)); - * mutex_exit(&spa_namespace_lock); - * LOG_INFO("Exporting pool %s", spaname); - * spa_export(spaname, NULL, B_TRUE, B_FALSE); - * mutex_enter(&spa_namespace_lock); - * } - * mutex_exit(&spa_namespace_lock); - * - * For now we keep it simple and just exit. - */ -static void -exit_handler(int sig) -{ - LOG_INFO("Caught SIGTERM. Exiting..."); - exit(0); -} - -/* - * Main function for replica. - */ -int -main(int argc, char **argv) -{ - int rc; - char *env; - int fd = open(LOCK_FILE, O_CREAT | O_RDWR, 0644); - if (fd < 0) { - fprintf(stderr, "%s open failed: %s\n", LOCK_FILE, - strerror(errno)); - return (-1); - } - if (flock(fd, LOCK_EX) < 0) { - fprintf(stderr, "flock failed: %s\n", strerror(errno)); - return (-1); - } - - /* Use opt parsing lib if we have more options */ - zrepl_log_level = LOG_LEVEL_INFO; - if (argc == 3 && strcmp(argv[1], "-l") == 0) { - if (strcmp(argv[2], "debug") == 0) - zrepl_log_level = LOG_LEVEL_DEBUG; - else if (strcmp(argv[2], "info") == 0) - zrepl_log_level = LOG_LEVEL_INFO; - else if (strcmp(argv[2], "error") == 0) - zrepl_log_level = LOG_LEVEL_ERR; - else { - fprintf(stderr, "Log level should be one of " - "\"debug\", \"info\" or \"error\"\n"); - return (-1); - } - } - - if (getenv("CONFIG_LOAD_ENABLE") != NULL) { - LOG_INFO("auto importing pools by reading zpool.cache files"); - zfs_autoimport_disable = 0; - } else { - LOG_INFO("disabled auto import (reading of zpool.cache)"); - zfs_autoimport_disable = 1; - } - - zfs_do_write_coalesce = 1; - env = getenv("DISABLE_WRITE_COALESCE"); - if (env != NULL) { - if (strcmp(env, "1") == 0) { - LOG_INFO("Disabling write IOs coalescing"); - zfs_do_write_coalesce = 0; - } - } - - uzfs_write_size = 0; - env = getenv("UZFS_WRITE_SIZE"); - if (env != NULL) { - uzfs_write_size = atoi(env); - LOG_INFO("uzfs write size = %d", uzfs_write_size); - } - - SLIST_INIT(&uzfs_mgmt_conns); - mutex_init(&conn_list_mtx, NULL, MUTEX_DEFAULT, NULL); - mutex_init(&async_tasks_mtx, NULL, MUTEX_DEFAULT, NULL); - - zinfo_create_hook = &zinfo_create_cb; - zinfo_destroy_hook = &zinfo_destroy_cb; - - io_server_port = IO_SERVER_PORT; - rebuild_io_server_port = REBUILD_IO_SERVER_PORT; - - io_receiver = uzfs_zvol_io_receiver; - rebuild_scanner = uzfs_zvol_rebuild_scanner; - dw_replica_fn = uzfs_zvol_rebuild_dw_replica; - - SLIST_INIT(&uzfs_mgmt_conns); - - rc = uzfs_init(); - if (rc != 0) { - LOG_ERR("initialization errored: %d", rc); - return (-1); - } - - /* Ignore SIGPIPE signal */ - signal(SIGPIPE, SIG_IGN); - signal(SIGTERM, exit_handler); - signal(SIGABRT, fatal_handler); - signal(SIGFPE, fatal_handler); - signal(SIGSEGV, fatal_handler); - signal(SIGBUS, fatal_handler); - signal(SIGILL, fatal_handler); - - if (libuzfs_ioctl_init() < 0) { - LOG_ERR("Failed to initialize libuzfs ioctl"); - goto initialize_error; - } - - SLIST_INIT(&uzfs_mgmt_conns); - mutex_init(&conn_list_mtx, NULL, MUTEX_DEFAULT, NULL); - mutex_init(&async_tasks_mtx, NULL, MUTEX_DEFAULT, NULL); - zrepl_svc_run(); - zrepl_monitor_errors(); - -initialize_error: - uzfs_fini(); - return (-1); -} diff --git a/configure.ac b/configure.ac index 9ead6ac08cb8..d226645fd9fa 100644 --- a/configure.ac +++ b/configure.ac @@ -108,7 +108,6 @@ AC_CONFIG_FILES([ cmd/zpool/Makefile cmd/zstreamdump/Makefile cmd/ztest/Makefile - cmd/zrepl/Makefile cmd/mount_zfs/Makefile cmd/fsck_zfs/Makefile cmd/zvol_id/Makefile diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index f85d5c0b19ed..000000000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# -# This Dockerfile builds cstor main container running zrepl from base image -# - -FROM openebs/cstor-base:ci - -COPY entrypoint-poolimage.sh /usr/local/bin/ - -RUN chmod +x /usr/local/bin/entrypoint-poolimage.sh - -ARG ARCH -ARG DBUILD_DATE -ARG DBUILD_REPO_URL -ARG DBUILD_SITE_URL - -LABEL org.label-schema.name="cstor" -LABEL org.label-schema.description="OpenEBS cStor" -LABEL org.label-schema.schema-version="1.0" -LABEL org.label-schema.build-date=$DBUILD_DATE -LABEL org.label-schema.vcs-url=$DBUILD_REPO_URL -LABEL org.label-schema.url=$DBUILD_SITE_URL - -ENTRYPOINT entrypoint-poolimage.sh -EXPOSE 7676 diff --git a/docker/Dockerfile.arm64 b/docker/Dockerfile.arm64 deleted file mode 100644 index d5fb56ab2df4..000000000000 --- a/docker/Dockerfile.arm64 +++ /dev/null @@ -1,24 +0,0 @@ -# -# This Dockerfile builds cstor main container running zrepl from base image -# - -FROM openebs/cstor-base-arm64:ci - -COPY entrypoint-poolimage.sh /usr/local/bin/ - -RUN chmod +x /usr/local/bin/entrypoint-poolimage.sh - -ARG ARCH -ARG DBUILD_DATE -ARG DBUILD_REPO_URL -ARG DBUILD_SITE_URL - -LABEL org.label-schema.name="cstor" -LABEL org.label-schema.description="OpenEBS cStor" -LABEL org.label-schema.schema-version="1.0" -LABEL org.label-schema.build-date=$DBUILD_DATE -LABEL org.label-schema.vcs-url=$DBUILD_REPO_URL -LABEL org.label-schema.url=$DBUILD_SITE_URL - -ENTRYPOINT entrypoint-poolimage.sh -EXPOSE 7676 diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base deleted file mode 100644 index 3755b0e8592d..000000000000 --- a/docker/Dockerfile.base +++ /dev/null @@ -1,32 +0,0 @@ -# -# This Dockerfile builds a recent base image containing cstor binaries and -# libraries. -# - -FROM openebs/cstor-ubuntu:xenial-20190515 - -RUN apt-get clean && \ - rm -rf /var/lib/apt/lists/* && \ - apt-get update && apt-get install -y \ - curl tcpdump dnsutils iputils-ping \ - libaio1 libaio-dev \ - libkqueue-dev libssl1.0.0 rsyslog net-tools gdb apt-utils \ - sed libjemalloc-dev -RUN apt-get -y install apt-file && apt-file update - -COPY zfs/bin/* /usr/local/bin/ -COPY zfs/lib/* /usr/lib/ - -ARG ARCH -ARG DBUILD_DATE -ARG DBUILD_REPO_URL -ARG DBUILD_SITE_URL - -LABEL org.label-schema.name="cstor" -LABEL org.label-schema.description="OpenEBS cStor" -LABEL org.label-schema.schema-version="1.0" -LABEL org.label-schema.build-date=$DBUILD_DATE -LABEL org.label-schema.vcs-url=$DBUILD_REPO_URL -LABEL org.label-schema.url=$DBUILD_SITE_URL - -EXPOSE 7676 diff --git a/docker/Dockerfile.base.arm64 b/docker/Dockerfile.base.arm64 deleted file mode 100644 index 33d7a57d5871..000000000000 --- a/docker/Dockerfile.base.arm64 +++ /dev/null @@ -1,32 +0,0 @@ -# -# This Dockerfile builds a recent base image containing cstor binaries and -# libraries. -# - -FROM openebs/arm64v8-ubuntu:xenial-20200326 - -RUN apt-get clean && \ - rm -rf /var/lib/apt/lists/* && \ - apt-get update && apt-get install -y \ - curl tcpdump dnsutils iputils-ping \ - libaio1 libaio-dev \ - libssl1.0.0 rsyslog net-tools gdb apt-utils \ - sed libjemalloc-dev -RUN apt-get -y install apt-file && apt-file update - -COPY zfs/bin/* /usr/local/bin/ -COPY zfs/lib/* /usr/lib/ - -ARG ARCH -ARG DBUILD_DATE -ARG DBUILD_REPO_URL -ARG DBUILD_SITE_URL - -LABEL org.label-schema.name="cstor" -LABEL org.label-schema.description="OpenEBS cStor" -LABEL org.label-schema.schema-version="1.0" -LABEL org.label-schema.build-date=$DBUILD_DATE -LABEL org.label-schema.vcs-url=$DBUILD_REPO_URL -LABEL org.label-schema.url=$DBUILD_SITE_URL - -EXPOSE 7676 diff --git a/docker/entrypoint-poolimage.sh b/docker/entrypoint-poolimage.sh deleted file mode 100644 index be8ced03e1d9..000000000000 --- a/docker/entrypoint-poolimage.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -set -o errexit -trap 'call_exit $LINE_NO' EXIT - -call_exit() -{ -echo "at call_exit.." -echo "exit code:" $? -echo "reference: " $0 -} - - -if [ -z "$LOGLEVEL" ]; then - LOGLEVEL=info -fi - -# Disabling coredumps by default in the shell where zrepl runs -if [ -z "$ENABLE_COREDUMP" ]; then - echo "Disabling dumping core" - ulimit -c 0 -else - echo "Enabling coredumps" - ulimit -c unlimited - ## /var/openebs is mounted as persistent directory on - ## host machine - cd /var/openebs/cstor-pool || exit - mkdir -p core - cd core - -fi -# ulimit being shell specific, ulimit -c in container shows as unlimited - - -echo "sleeping for 2 sec" -sleep 2 -ARCH=$(uname -m) -export LD_PRELOAD=/usr/lib/${ARCH}-linux-gnu/libjemalloc.so -exec /usr/local/bin/zrepl -l $LOGLEVEL diff --git a/include/Makefile.am b/include/Makefile.am index 47657526b9e3..8717b145fbc4 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -14,6 +14,7 @@ USER_H = \ $(top_srcdir)/include/libuutil.h \ $(top_srcdir)/include/libuutil_impl.h \ $(top_srcdir)/include/libzfs.h \ + $(top_srcdir)/include/zfs_events.h \ $(top_srcdir)/include/libzfs_core.h \ $(top_srcdir)/include/libzfs_impl.h diff --git a/cmd/zrepl/zfs_events.h b/include/zfs_events.h similarity index 100% rename from cmd/zrepl/zfs_events.h rename to include/zfs_events.h diff --git a/lib/libzfs/Makefile.am b/lib/libzfs/Makefile.am index 4d0df60fa7e0..071b8d72ff21 100644 --- a/lib/libzfs/Makefile.am +++ b/lib/libzfs/Makefile.am @@ -28,6 +28,10 @@ USER_C = \ libzfs_status.c \ libzfs_util.c +if ENABLE_UZFS +USER_C += zfs_events.c +endif + KERNEL_C = \ zfs_ioctl.c \ zfs_vfsops.c \ diff --git a/cmd/zrepl/zfs_events.c b/lib/libzfs/zfs_events.c similarity index 99% rename from cmd/zrepl/zfs_events.c rename to lib/libzfs/zfs_events.c index 6f53be8b29a5..c28a4872fad2 100644 --- a/cmd/zrepl/zfs_events.c +++ b/lib/libzfs/zfs_events.c @@ -28,8 +28,7 @@ #include #include #include - -#include "zfs_events.h" +#include /* * Print vdev state change event in user friendly way. From a333359bd047e2bbe322dc4f1447ef86c7a6c2ab Mon Sep 17 00:00:00 2001 From: mittachaitu Date: Sat, 5 Sep 2020 11:48:31 +0530 Subject: [PATCH 2/5] This commit fixes the commpilation issue in Travis Signed-off-by: mittachaitu --- .travis.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.travis.yml b/.travis.yml index 73fee8e1a8ef..f5b7108e7558 100644 --- a/.travis.yml +++ b/.travis.yml @@ -96,6 +96,17 @@ install: make --no-print-directory -s pkg-utils pkg-kmod || travis_terminate 1; sudo dpkg -i *.deb || travis_terminate 1; fi + # Return to libcstor code to complie zrepl which contains main and to run lint checks + # save the current location to get back + - pushd . + - cd .. + - cd libcstor + # Go to zrepl directory to build zrepl related targets + - cd cmd/zrepl + - make + - cd ../../ + # return to cstor code + - popd before_script: - make cstyle; script: From 6aa524ea8fbc18e2ea6e344f9cdcaf5f1c2fa4e8 Mon Sep 17 00:00:00 2001 From: mittachaitu Date: Tue, 8 Sep 2020 17:50:25 +0530 Subject: [PATCH 3/5] This commit updates the path to zrepl in test case and Travis Signed-off-by: mittachaitu --- .travis.yml | 12 ++++++------ tests/cstor/gtest/gtest_utils.cc | 9 ++++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index f5b7108e7558..d684715e7f09 100644 --- a/.travis.yml +++ b/.travis.yml @@ -60,7 +60,7 @@ install: # we need fio repo to build zfs replica fio engine - git clone https://github.com/axboe/fio - cd fio - - git checkout fio-3.7 + - git checkout fio-3.9 - ./configure - make -j4 - cd .. @@ -76,7 +76,7 @@ install: sudo dpkg -i *.deb; fi - cd .. - # Clone libcstor for uzfs feature + # Clone and build libcstor for uzfs feature - git clone https://github.com/openebs/libcstor.git - cd libcstor - if [ ${TRAVIS_BRANCH} == "develop" ]; then git checkout master; else git checkout ${TRAVIS_BRANCH} || git checkout master; fi @@ -96,12 +96,12 @@ install: make --no-print-directory -s pkg-utils pkg-kmod || travis_terminate 1; sudo dpkg -i *.deb || travis_terminate 1; fi - # Return to libcstor code to complie zrepl which contains main and to run lint checks - # save the current location to get back + # Return to libcstor code to complie zrepl which is responsible for uZFS feature. + # Save the current location to get back - pushd . - cd .. - cd libcstor - # Go to zrepl directory to build zrepl related targets + # Go to zrepl directory to build zrepl - cd cmd/zrepl - make - cd ../../ @@ -164,7 +164,7 @@ script: REL_BRANCH=$(echo $(echo "$TRAVIS_TAG" | cut -d'-' -f1 | rev | cut -d'.' -f2- | rev).x$REL_SUFFIX); - ./buildscripts/git-release "$REPO_ORG/istgt" "$TRAVIS_TAG" "$REL_BRANCH" || travis_terminate 1; + ./buildscripts/git-release "$REPO_ORG/libcstor" "$TRAVIS_TAG" "$REL_BRANCH" || travis_terminate 1; fi after_failure: - find /var/tmp/test_results/current/log -type f -name '*' -printf "%f\n" -exec cut -c -$ZFS_TEST_TRAVIS_LOG_MAX_LENGTH {} \; diff --git a/tests/cstor/gtest/gtest_utils.cc b/tests/cstor/gtest/gtest_utils.cc index d247c6e55a5e..bb36812b2b8e 100644 --- a/tests/cstor/gtest/gtest_utils.cc +++ b/tests/cstor/gtest/gtest_utils.cc @@ -64,7 +64,14 @@ std::string GtestUtils::getCmdPath(std::string zfsCmd) { std::string cmdPath; const char *srcPath = std::getenv("SRC_PATH"); - if (srcPath == nullptr) { + // Since the zrepl has been moved from cstor + // to libcstor base path of zrepl will be ../libcstor + + // NOTE: It is assumed that cstor and libcstor will + // exist in same parent directory + if (zfsCmd == "zrepl" ) { + cmdPath = "../libcstor"; + } else if (srcPath == nullptr) { cmdPath += "."; } else { cmdPath = srcPath; From 6cceca72257f6abfea53f0d6427196be4dc019f7 Mon Sep 17 00:00:00 2001 From: mittachaitu Date: Wed, 9 Sep 2020 13:25:05 +0530 Subject: [PATCH 4/5] This commit incorporate review comments Signed-off-by: mittachaitu --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d684715e7f09..62e8249065de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -99,12 +99,9 @@ install: # Return to libcstor code to complie zrepl which is responsible for uZFS feature. # Save the current location to get back - pushd . - - cd .. - - cd libcstor # Go to zrepl directory to build zrepl - - cd cmd/zrepl + - cd ../libcstor/cmd/zrepl - make - - cd ../../ # return to cstor code - popd before_script: From d3e7046e2cf64c2a7f70afae1f37e1d7e70a72be Mon Sep 17 00:00:00 2001 From: mittachaitu Date: Wed, 9 Sep 2020 14:02:49 +0530 Subject: [PATCH 5/5] This commit adds changelog file Signed-off-by: mittachaitu --- changelogs/unreleased/319-mittachaitu | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/319-mittachaitu diff --git a/changelogs/unreleased/319-mittachaitu b/changelogs/unreleased/319-mittachaitu new file mode 100644 index 000000000000..49bfc9dbcb4f --- /dev/null +++ b/changelogs/unreleased/319-mittachaitu @@ -0,0 +1 @@ +chore(build): remove build process from repo