This commit is contained in:
Олег Бородин
2023-09-21 14:33:19 +02:00
parent 375930eaac
commit 5b94c7459b
21 changed files with 362 additions and 149 deletions

1
.gitignore vendored
View File

@@ -1,5 +1,6 @@
cworker cworker
configure configure
config.status
libtool libtool
Makefile Makefile
config.h config.h

16
Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM debian:bullseye AS builder
WORKDIR /app/src/
RUN apt-get -y -q update
RUN apt-get -y -q install make binutils gcc libc-dev
COPY . .
RUN ./configure --prefix=/app
RUN make clean all install clean
FROM debian:bullseye
WORKDIR /app
COPY --from=builder /app /app
USER daemon:daemon
ENTRYPOINT ["/app/sbin/cworker"]

108
Makefile
View File

@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am. # Makefile.in generated by automake 1.16.3 from Makefile.am.
# Makefile. Generated from Makefile.in by configure. # Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994-2018 Free Software Foundation, Inc. # Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -170,8 +170,8 @@ am__recursive_targets = \
$(am__extra_recursive_targets) $(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir distdir-am dist dist-all distcheck cscope distdir distdir-am dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
$(LISP)defines.h.in defines.h.in
# Read a list of newline-separated strings from the standard input, # Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is # and print each of them once, without duplicates. Input order is
# *not* preserved. # *not* preserved.
@@ -233,34 +233,38 @@ am__relativize = \
DIST_ARCHIVES = $(distdir).tar.gz DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best GZIP_ENV = --best
DIST_TARGETS = dist-gzip DIST_TARGETS = dist-gzip
# Exists only to be overridden by the user if desired.
AM_DISTCHECK_DVI_TARGET = dvi
distuninstallcheck_listfiles = find . -type f -print distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print
ACLOCAL = ${SHELL} /dat2/home/ziggi/Projects/cworker/missing aclocal ACLOCAL = ${SHELL} '/dat2/home/ziggi/Projects/cworker/missing' aclocal-1.16
AMTAR = $${TAR-tar} AMTAR = $${TAR-tar}
AM_DEFAULT_VERBOSITY = 1 AM_DEFAULT_VERBOSITY = 1
APP_CACHEDIR = /dat2/home/ziggi/Projects/cworker/cache APP_CACHEDIR = /var/cache/cworker
APP_CONFIGDIR = /dat2/home/ziggi/Projects/cworker/ APP_CONFIGDIR = /app/etc/cworker
APP_DATABASEDIR = /dat2/home/ziggi/Projects/cworker/data APP_DATABASEDIR = /var/db/cworker
APP_LIBDIR = /dat2/home/ziggi/Projects/cworker/lib APP_LIBDIR = /app/lib/cworker
APP_LOGDIR = /dat2/home/ziggi/Projects/cworker/log APP_LOGDIR = /var/log/cworker
APP_RUNDIR = /dat2/home/ziggi/Projects/cworker/run APP_RUNDIR = /var/run/cworker
APP_USER = ziggi APP_USER = www-data
AR = ar AR = ar
AUTOCONF = ${SHELL} /dat2/home/ziggi/Projects/cworker/missing autoconf AUTOCONF = ${SHELL} '/dat2/home/ziggi/Projects/cworker/missing' autoconf
AUTOHEADER = ${SHELL} /dat2/home/ziggi/Projects/cworker/missing autoheader AUTOHEADER = ${SHELL} '/dat2/home/ziggi/Projects/cworker/missing' autoheader
AUTOMAKE = ${SHELL} /dat2/home/ziggi/Projects/cworker/missing automake AUTOMAKE = ${SHELL} '/dat2/home/ziggi/Projects/cworker/missing' automake-1.16
AWK = gawk AWK = gawk
CC = clang CC = clang
CCDEPMODE = depmode=none CCDEPMODE = depmode=none
CFLAGS = -g -O2 CFLAGS = -g -O2
CP = CP =
CPP = clang -E
CPPFLAGS = CPPFLAGS =
CYGPATH_W = echo CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps DEPDIR = .deps
DLLTOOL = false DLLTOOL = false
DOCKER = /bin/podman
DSYMUTIL = DSYMUTIL =
DUMPBIN = DUMPBIN =
ECHO_C = ECHO_C =
@@ -271,11 +275,13 @@ EXEEXT =
FGREP = /bin/grep -F FGREP = /bin/grep -F
GREP = /bin/grep GREP = /bin/grep
HAVE_CP = true HAVE_CP = true
HELM = /bin/helm
INSTALL = /bin/install -c INSTALL = /bin/install -c
INSTALL_DATA = ${INSTALL} -m 644 INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL} INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL} INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
KUBECTL = /bin/kubectl
LD = /bin/ld -m elf_x86_64 LD = /bin/ld -m elf_x86_64
LDFLAGS = LDFLAGS =
LIBOBJS = LIBOBJS =
@@ -286,7 +292,7 @@ LIPO =
LN_S = ln -s LN_S = ln -s
LTLIBOBJS = LTLIBOBJS =
LT_SYS_LIBRARY_PATH = LT_SYS_LIBRARY_PATH =
MAKEINFO = ${SHELL} /dat2/home/ziggi/Projects/cworker/missing makeinfo MAKEINFO = ${SHELL} '/dat2/home/ziggi/Projects/cworker/missing' makeinfo
MANIFEST_TOOL = : MANIFEST_TOOL = :
MKDIR_P = /bin/mkdir -p MKDIR_P = /bin/mkdir -p
NM = /bin/nm -B NM = /bin/nm -B
@@ -322,14 +328,14 @@ am__leading_dot = .
am__quote = am__quote =
am__tar = $${TAR-tar} chof - "$$tardir" am__tar = $${TAR-tar} chof - "$$tardir"
am__untar = $${TAR-tar} xf - am__untar = $${TAR-tar} xf -
app_cachedir = /dat2/home/ziggi/Projects/cworker/cache app_cachedir = /var/cache/cworker
app_configdir = /dat2/home/ziggi/Projects/cworker/ app_configdir = /app/etc/cworker
app_databasedir = /dat2/home/ziggi/Projects/cworker/data app_databasedir = /var/db/cworker
app_libdir = /dat2/home/ziggi/Projects/cworker/lib app_libdir = /app/lib/cworker
app_logdir = /dat2/home/ziggi/Projects/cworker/log app_logdir = /var/log/cworker
app_name = cworker app_name = cworker
app_rundir = /dat2/home/ziggi/Projects/cworker/run app_rundir = /var/run/cworker
app_user = ziggi app_user = www-data
bindir = ${exec_prefix}/bin bindir = ${exec_prefix}/bin
build = x86_64-pc-linux-gnu build = x86_64-pc-linux-gnu
build_alias = build_alias =
@@ -359,7 +365,7 @@ mandir = ${datarootdir}/man
mkdir_p = $(MKDIR_P) mkdir_p = $(MKDIR_P)
oldincludedir = /usr/include oldincludedir = /usr/include
pdfdir = ${docdir} pdfdir = ${docdir}
prefix = /usr/local prefix = /app
program_transform_name = s,x,x, program_transform_name = s,x,x,
psdir = ${docdir} psdir = ${docdir}
runstatedir = ${localstatedir}/run runstatedir = ${localstatedir}/run
@@ -378,6 +384,11 @@ AM_CFLAGS = -Wall -I./clib -std=gnu99
AM_LDFLAGS = -pthread AM_LDFLAGS = -pthread
cworker_SOURCES = main.c cworker.c cworker.h cworker_SOURCES = main.c cworker.c cworker.h
cworker_LDADD = clib/libcworker.la cworker_LDADD = clib/libcworker.la
IMAGE_REPO = docker.io/onborodin
IMAGE_TAG = latest
IMAGE_NAME = cworker
RELEASE_NAMESPACE = cworker
RELEASE_NAME = cworker
all: defines.h all: defines.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive $(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -697,6 +708,10 @@ dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir) $(am__post_remove_distdir)
dist-zstd: distdir
tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
$(am__post_remove_distdir)
dist-tarZ: distdir dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \ @echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2 "legacy program 'compress' is deprecated." >&2
@@ -739,6 +754,8 @@ distcheck: dist
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \ *.zip*) \
unzip $(distdir).zip ;;\ unzip $(distdir).zip ;;\
*.tar.zst*) \
zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
esac esac
chmod -R a-w $(distdir) chmod -R a-w $(distdir)
chmod u+w $(distdir) chmod u+w $(distdir)
@@ -754,7 +771,7 @@ distcheck: dist
$(DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \ --srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
&& $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
@@ -922,18 +939,19 @@ uninstall-am: uninstall-sbinPROGRAMS
clean-libtool clean-local clean-sbinPROGRAMS cscope \ clean-libtool clean-local clean-sbinPROGRAMS cscope \
cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
distcheck distclean distclean-compile distclean-generic \ dist-zstd distcheck distclean distclean-compile \
distclean-hdr distclean-libtool distclean-tags distcleancheck \ distclean-generic distclean-hdr distclean-libtool \
distdir distuninstallcheck dvi dvi-am html html-am info \ distclean-tags distcleancheck distdir distuninstallcheck dvi \
info-am install install-am install-data install-data-am \ dvi-am html html-am info info-am install install-am \
install-dvi install-dvi-am install-exec install-exec-am \ install-data install-data-am install-dvi install-dvi-am \
install-html install-html-am install-info install-info-am \ install-exec install-exec-am install-html install-html-am \
install-man install-pdf install-pdf-am install-ps \ install-info install-info-am install-man install-pdf \
install-ps-am install-sbinPROGRAMS install-strip installcheck \ install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \
installcheck-am installdirs installdirs-am maintainer-clean \ install-strip installcheck installcheck-am installdirs \
maintainer-clean-generic mostlyclean mostlyclean-compile \ installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ mostlyclean mostlyclean-compile mostlyclean-generic \
tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am uninstall-sbinPROGRAMS
.PRECIOUS: Makefile .PRECIOUS: Makefile
@@ -944,6 +962,22 @@ uninstall-am: uninstall-sbinPROGRAMS
run: $(sbin_PROGRAMS) run: $(sbin_PROGRAMS)
./cworker --port=9002 --nofork=true ./cworker --port=9002 --nofork=true
image:
$(DOCKER) build -t $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG) -f Dockerfile .
push:
$(DOCKER) push $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
kinstall:
$(HELM) install --create-namespace --namespace $(RELEASE_NAMESPACE) \
--set cworker.image.path=$(IMAGE_REPO) \
--set cworker.image.name=$(IMAGE_NAME) \
--set cworker.image.tag=$(IMAGE_TAG) \
$(RELEASE_NAME) ./chart
kuninstall:
$(HELM) uninstall --namespace $(RELEASE_NAMESPACE) $(RELEASE_NAME)
#install-data-local: #install-data-local:
# test -z $(DESTDIR)$(APP_LIBDIR) || $(MKDIR_P) $(DESTDIR)$(APP_LIBDIR) # test -z $(DESTDIR)$(APP_LIBDIR) || $(MKDIR_P) $(DESTDIR)$(APP_LIBDIR)
# test -z $(DESTDIR)$(APP_CONFDIR) || $(MKDIR_P) $(DESTDIR)$(APP_CONFDIR) # test -z $(DESTDIR)$(APP_CONFDIR) || $(MKDIR_P) $(DESTDIR)$(APP_CONFDIR)

View File

@@ -20,6 +20,32 @@ cworker_LDADD = clib/libcworker.la
run: $(sbin_PROGRAMS) run: $(sbin_PROGRAMS)
./cworker --port=9002 --nofork=true ./cworker --port=9002 --nofork=true
IMAGE_REPO = docker.io/onborodin
IMAGE_TAG = latest
IMAGE_NAME = cworker
image:
$(DOCKER) build -t $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG) -f Dockerfile .
push:
$(DOCKER) push $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
RELEASE_NAMESPACE = cworker
RELEASE_NAME = cworker
kinstall:
$(HELM) install --create-namespace --namespace $(RELEASE_NAMESPACE) \
--set cworker.image.path=$(IMAGE_REPO) \
--set cworker.image.name=$(IMAGE_NAME) \
--set cworker.image.tag=$(IMAGE_TAG) \
$(RELEASE_NAME) ./chart
kuninstall:
$(HELM) uninstall --namespace $(RELEASE_NAMESPACE) $(RELEASE_NAME)
#install-data-local: #install-data-local:
# test -z $(DESTDIR)$(APP_LIBDIR) || $(MKDIR_P) $(DESTDIR)$(APP_LIBDIR) # test -z $(DESTDIR)$(APP_LIBDIR) || $(MKDIR_P) $(DESTDIR)$(APP_LIBDIR)

View File

@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am. # Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc. # Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -170,8 +170,8 @@ am__recursive_targets = \
$(am__extra_recursive_targets) $(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir distdir-am dist dist-all distcheck cscope distdir distdir-am dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
$(LISP)defines.h.in defines.h.in
# Read a list of newline-separated strings from the standard input, # Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is # and print each of them once, without duplicates. Input order is
# *not* preserved. # *not* preserved.
@@ -233,6 +233,8 @@ am__relativize = \
DIST_ARCHIVES = $(distdir).tar.gz DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best GZIP_ENV = --best
DIST_TARGETS = dist-gzip DIST_TARGETS = dist-gzip
# Exists only to be overridden by the user if desired.
AM_DISTCHECK_DVI_TARGET = dvi
distuninstallcheck_listfiles = find . -type f -print distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
@@ -256,11 +258,13 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
CP = @CP@ CP = @CP@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@ CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@ CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@ DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@ DLLTOOL = @DLLTOOL@
DOCKER = @DOCKER@
DSYMUTIL = @DSYMUTIL@ DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@ DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@ ECHO_C = @ECHO_C@
@@ -271,11 +275,13 @@ EXEEXT = @EXEEXT@
FGREP = @FGREP@ FGREP = @FGREP@
GREP = @GREP@ GREP = @GREP@
HAVE_CP = @HAVE_CP@ HAVE_CP = @HAVE_CP@
HELM = @HELM@
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KUBECTL = @KUBECTL@
LD = @LD@ LD = @LD@
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
@@ -378,6 +384,11 @@ AM_CFLAGS = -Wall -I./clib -std=gnu99
AM_LDFLAGS = -pthread AM_LDFLAGS = -pthread
cworker_SOURCES = main.c cworker.c cworker.h cworker_SOURCES = main.c cworker.c cworker.h
cworker_LDADD = clib/libcworker.la cworker_LDADD = clib/libcworker.la
IMAGE_REPO = docker.io/onborodin
IMAGE_TAG = latest
IMAGE_NAME = cworker
RELEASE_NAMESPACE = cworker
RELEASE_NAME = cworker
all: defines.h all: defines.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive $(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -697,6 +708,10 @@ dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir) $(am__post_remove_distdir)
dist-zstd: distdir
tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
$(am__post_remove_distdir)
dist-tarZ: distdir dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \ @echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2 "legacy program 'compress' is deprecated." >&2
@@ -739,6 +754,8 @@ distcheck: dist
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \ *.zip*) \
unzip $(distdir).zip ;;\ unzip $(distdir).zip ;;\
*.tar.zst*) \
zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
esac esac
chmod -R a-w $(distdir) chmod -R a-w $(distdir)
chmod u+w $(distdir) chmod u+w $(distdir)
@@ -754,7 +771,7 @@ distcheck: dist
$(DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \ --srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
&& $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
@@ -922,18 +939,19 @@ uninstall-am: uninstall-sbinPROGRAMS
clean-libtool clean-local clean-sbinPROGRAMS cscope \ clean-libtool clean-local clean-sbinPROGRAMS cscope \
cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
distcheck distclean distclean-compile distclean-generic \ dist-zstd distcheck distclean distclean-compile \
distclean-hdr distclean-libtool distclean-tags distcleancheck \ distclean-generic distclean-hdr distclean-libtool \
distdir distuninstallcheck dvi dvi-am html html-am info \ distclean-tags distcleancheck distdir distuninstallcheck dvi \
info-am install install-am install-data install-data-am \ dvi-am html html-am info info-am install install-am \
install-dvi install-dvi-am install-exec install-exec-am \ install-data install-data-am install-dvi install-dvi-am \
install-html install-html-am install-info install-info-am \ install-exec install-exec-am install-html install-html-am \
install-man install-pdf install-pdf-am install-ps \ install-info install-info-am install-man install-pdf \
install-ps-am install-sbinPROGRAMS install-strip installcheck \ install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \
installcheck-am installdirs installdirs-am maintainer-clean \ install-strip installcheck installcheck-am installdirs \
maintainer-clean-generic mostlyclean mostlyclean-compile \ installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ mostlyclean mostlyclean-compile mostlyclean-generic \
tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am uninstall-sbinPROGRAMS
.PRECIOUS: Makefile .PRECIOUS: Makefile
@@ -944,6 +962,22 @@ uninstall-am: uninstall-sbinPROGRAMS
run: $(sbin_PROGRAMS) run: $(sbin_PROGRAMS)
./cworker --port=9002 --nofork=true ./cworker --port=9002 --nofork=true
image:
$(DOCKER) build -t $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG) -f Dockerfile .
push:
$(DOCKER) push $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
kinstall:
$(HELM) install --create-namespace --namespace $(RELEASE_NAMESPACE) \
--set cworker.image.path=$(IMAGE_REPO) \
--set cworker.image.name=$(IMAGE_NAME) \
--set cworker.image.tag=$(IMAGE_TAG) \
$(RELEASE_NAME) ./chart
kuninstall:
$(HELM) uninstall --namespace $(RELEASE_NAMESPACE) $(RELEASE_NAME)
#install-data-local: #install-data-local:
# test -z $(DESTDIR)$(APP_LIBDIR) || $(MKDIR_P) $(DESTDIR)$(APP_LIBDIR) # test -z $(DESTDIR)$(APP_LIBDIR) || $(MKDIR_P) $(DESTDIR)$(APP_LIBDIR)
# test -z $(DESTDIR)$(APP_CONFDIR) || $(MKDIR_P) $(DESTDIR)$(APP_CONFDIR) # test -z $(DESTDIR)$(APP_CONFDIR) || $(MKDIR_P) $(DESTDIR)$(APP_CONFDIR)

63
aclocal.m4 vendored
View File

@@ -1,6 +1,6 @@
# generated automatically by aclocal 1.16.1 -*- Autoconf -*- # generated automatically by aclocal 1.16.3 -*- Autoconf -*-
# Copyright (C) 1996-2018 Free Software Foundation, Inc. # Copyright (C) 1996-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -14,13 +14,13 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION], m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
[m4_warning([this file was generated for autoconf 2.71. [m4_warning([this file was generated for autoconf 2.69.
You have another version of autoconf. It may work, but is not guaranteed to. You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely. If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])]) To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# Copyright (C) 2002-2018 Free Software Foundation, Inc. # Copyright (C) 2002-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.16' [am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro. dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.16.1], [], m4_if([$1], [1.16.3], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
]) ])
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.16.1])dnl [AM_AUTOMAKE_VERSION([1.16.3])dnl
m4_ifndef([AC_AUTOCONF_VERSION], m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*- # AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2018 Free Software Foundation, Inc. # Copyright (C) 2001-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*- # AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2018 Free Software Foundation, Inc. # Copyright (C) 1997-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]]) Usually this means the macro was only invoked conditionally.]])
fi])]) fi])])
# Copyright (C) 1999-2018 Free Software Foundation, Inc. # Copyright (C) 1999-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -332,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*- # Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2018 Free Software Foundation, Inc. # Copyright (C) 1999-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -371,7 +371,9 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
done done
if test $am_rc -ne 0; then if test $am_rc -ne 0; then
AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. Try re-running configure with the for automatic dependency tracking. If GNU make was not used, consider
re-running the configure script with MAKE="gmake" (or whatever is
necessary). You can also try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build '--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).]) the package (albeit without support for automatic dependency tracking).])
fi fi
@@ -398,7 +400,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*- # Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2018 Free Software Foundation, Inc. # Copyright (C) 1996-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -475,9 +477,9 @@ _AM_IF_OPTION([no-define],,
# Some tools Automake needs. # Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG([ACLOCAL], [aclocal]) AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOCONF], [autoconf])
AM_MISSING_PROG([AUTOMAKE], [automake]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([AUTOHEADER], [autoheader])
AM_MISSING_PROG([MAKEINFO], [makeinfo]) AM_MISSING_PROG([MAKEINFO], [makeinfo])
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
@@ -595,7 +597,7 @@ for _am_header in $config_headers :; do
done done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2018 Free Software Foundation, Inc. # Copyright (C) 2001-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -616,7 +618,7 @@ if test x"${install_sh+set}" != xset; then
fi fi
AC_SUBST([install_sh])]) AC_SUBST([install_sh])])
# Copyright (C) 2003-2018 Free Software Foundation, Inc. # Copyright (C) 2003-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -637,7 +639,7 @@ AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*- # Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2018 Free Software Foundation, Inc. # Copyright (C) 2001-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -680,7 +682,7 @@ AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2018 Free Software Foundation, Inc. # Copyright (C) 1997-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -701,12 +703,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then if test x"${MISSING+set}" != xset; then
case $am_aux_dir in MISSING="\${SHELL} '$am_aux_dir/missing'"
*\ * | *\ *)
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
*)
MISSING="\${SHELL} $am_aux_dir/missing" ;;
esac
fi fi
# Use eval to expand $SHELL # Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then if eval "$MISSING --is-lightweight"; then
@@ -719,7 +716,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*- # Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2018 Free Software Foundation, Inc. # Copyright (C) 2001-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -748,7 +745,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION], AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 1999-2018 Free Software Foundation, Inc. # Copyright (C) 1999-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -795,7 +792,7 @@ AC_LANG_POP([C])])
# For backward compatibility. # For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
# Copyright (C) 2001-2018 Free Software Foundation, Inc. # Copyright (C) 2001-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -814,7 +811,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*- # Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2018 Free Software Foundation, Inc. # Copyright (C) 1996-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -895,7 +892,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file rm -f conftest.file
]) ])
# Copyright (C) 2009-2018 Free Software Foundation, Inc. # Copyright (C) 2009-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -955,7 +952,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
]) ])
# Copyright (C) 2001-2018 Free Software Foundation, Inc. # Copyright (C) 2001-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -983,7 +980,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])]) AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2018 Free Software Foundation, Inc. # Copyright (C) 2006-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -1002,7 +999,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*- # Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2018 Free Software Foundation, Inc. # Copyright (C) 2004-2020 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,

1
chart/.helmignore Normal file
View File

@@ -0,0 +1 @@
*~

7
chart/Chart.yaml Normal file
View File

@@ -0,0 +1,7 @@
apiVersion: v2
name: cworker
description: Sample service
type: application
version: 0.1
appVersion: "0.1"

View File

@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
namespace: {{ .Release.Namespace }}
name: cworker-config
data:
cworker.conf: |-
port = {{ .Values.cworker.service.port }}

View File

@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: cworker
namespace: {{ .Release.Namespace }}
labels:
app: cworker
spec:
serviceName: cworker
replicas: 1
selector:
matchLabels:
app: cworker
template:
metadata:
labels:
app: cworker
spec:
restartPolicy: Always
containers:
- securityContext:
privileged: true
image: {{ .Values.cworker.image.path }}/{{ .Values.cworker.image.name }}:{{ .Values.cworker.image.tag }}
imagePullPolicy: {{ .Values.cworker.imagePullPolicy }}
name: cworker
ports:
- containerPort: {{ .Values.cworker.service.port }}
protocol: TCP
volumeMounts:
- name: config-volume
mountPath: /app/etc/cworker
volumes:
- name: config-volume
configMap:
name: cworker-config

View File

@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: cworker
namespace: {{ .Release.Namespace }}
labels:
app: cworker
spec:
selector:
app: cworker
ports:
- port: {{ .Values.cworker.service.port }}
protocol: TCP
targetPort: {{ .Values.cworker.service.targetPort }}
name: rpc
type: {{ .Values.cworker.service.type }}

12
chart/values.yaml Normal file
View File

@@ -0,0 +1,12 @@
cworker:
namespace: cworker
image:
path: docker.io/onborodin
name: cworker
tag: latest
imagePullPolicy: Always
service:
name: cworker
type: LoadBalancer
port: 9002
targetPort: 9002

View File

@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am. # Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc. # Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -274,11 +274,13 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
CP = @CP@ CP = @CP@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@ CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@ CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@ DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@ DLLTOOL = @DLLTOOL@
DOCKER = @DOCKER@
DSYMUTIL = @DSYMUTIL@ DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@ DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@ ECHO_C = @ECHO_C@
@@ -289,11 +291,13 @@ EXEEXT = @EXEEXT@
FGREP = @FGREP@ FGREP = @FGREP@
GREP = @GREP@ GREP = @GREP@
HAVE_CP = @HAVE_CP@ HAVE_CP = @HAVE_CP@
HELM = @HELM@
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KUBECTL = @KUBECTL@
LD = @LD@ LD = @LD@
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@

View File

@@ -41,7 +41,7 @@ int jparser_parse(jparser_t * parser) {
char* key = ""; char* key = "";
while ((type = jlexer_gettoken(lex, token)) != JLEXTOK_END) { while ((type = jlexer_gettoken(lex, token)) != JLEXTOK_END) {
//printf("pos %d tok 0x%02x: %s\n", pos, type, token); //log_debug("pos %d tok 0x%02x: %s\n", pos, type, token);
switch (pos) { switch (pos) {
// POS 0 // POS 0
case 0:{ case 0:{
@@ -112,7 +112,7 @@ int jparser_parse(jparser_t * parser) {
jkval_t* kv = &(parser->kvalarr[parser->kvalsize]); jkval_t* kv = &(parser->kvalarr[parser->kvalsize]);
kv->key = strcopy(key); kv->key = strcopy(key);
log_debug("parser added key %s", kv->key); //log_debug("Parser added key %s", kv->key);
if (type == JLEXTOK_NUMB) { if (type == JLEXTOK_NUMB) {
kv->type = JVALTYPE_NUM; kv->type = JVALTYPE_NUM;
char* eptr = NULL; char* eptr = NULL;
@@ -162,7 +162,7 @@ int jparser_bind(jparser_t* parser, int type, char* key, void* ref) {
for (int i = 0; i < parser->kvalsize; i++) { for (int i = 0; i < parser->kvalsize; i++) {
jkval_t* kv = &(parser->kvalarr[i]); jkval_t* kv = &(parser->kvalarr[i]);
log_debug("find equal keys: kv->key = %s, key = %s", kv->key, key); //log_debug("Find equal keys: kv->key = %s, key = %s", kv->key, key);
if (strcmp(kv->key, key) == 0) { if (strcmp(kv->key, key) == 0) {
if (kv->type == JVALTYPE_STR) { if (kv->type == JVALTYPE_STR) {
*(char**)(ref) = strcopy(kv->str); *(char**)(ref) = strcopy(kv->str);

View File

@@ -2,8 +2,8 @@
#ifndef CONFIG_H_QWER #ifndef CONFIG_H_QWER
#define CONFIG_H_QWER #define CONFIG_H_QWER
static const char *srv_runpath = "/dat2/home/ziggi/Projects/cworker/run/cworker.pid"; static const char *srv_runpath = "/var/run/cworker/cworker.pid";
static const char *srv_logpath = "/dat2/home/ziggi/Projects/cworker/log/cworker.log"; static const char *srv_logpath = "/var/log/cworker/cworker.log";
static const char *srv_configpath = "/dat2/home/ziggi/Projects/cworker//cworker.conf"; static const char *srv_configpath = "/app/etc/cworker/cworker.conf";
#endif #endif

View File

@@ -427,7 +427,7 @@ $config_commands
Report bugs to the package provider." Report bugs to the package provider."
ac_cs_config="'--enable-devel-mode'" ac_cs_config="'--prefix=/app'"
ac_cs_version="\ ac_cs_version="\
cworker config.status 0.0.1 cworker config.status 0.0.1
configured by ./configure, generated by GNU Autoconf 2.69, configured by ./configure, generated by GNU Autoconf 2.69,
@@ -519,7 +519,7 @@ if $ac_cs_silent; then
fi fi
if $ac_cs_recheck; then if $ac_cs_recheck; then
set X /bin/bash './configure' '--enable-devel-mode' $ac_configure_extra_args --no-create --no-recursion set X /bin/bash './configure' '--prefix=/app' $ac_configure_extra_args --no-create --no-recursion
shift shift
$as_echo "running CONFIG_SHELL=/bin/bash $*" >&6 $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6
CONFIG_SHELL='/bin/bash' CONFIG_SHELL='/bin/bash'
@@ -821,20 +821,20 @@ S["am__EXEEXT_FALSE"]=""
S["am__EXEEXT_TRUE"]="#" S["am__EXEEXT_TRUE"]="#"
S["LTLIBOBJS"]="" S["LTLIBOBJS"]=""
S["app_name"]="cworker" S["app_name"]="cworker"
S["app_cachedir"]="/dat2/home/ziggi/Projects/cworker/cache" S["app_cachedir"]="/var/cache/cworker"
S["APP_CACHEDIR"]="/dat2/home/ziggi/Projects/cworker/cache" S["APP_CACHEDIR"]="/var/cache/cworker"
S["app_databasedir"]="/dat2/home/ziggi/Projects/cworker/data" S["app_databasedir"]="/var/db/cworker"
S["APP_DATABASEDIR"]="/dat2/home/ziggi/Projects/cworker/data" S["APP_DATABASEDIR"]="/var/db/cworker"
S["app_user"]="ziggi" S["app_user"]="www-data"
S["APP_USER"]="ziggi" S["APP_USER"]="www-data"
S["app_libdir"]="/dat2/home/ziggi/Projects/cworker/lib" S["app_libdir"]="/app/lib/cworker"
S["APP_LIBDIR"]="/dat2/home/ziggi/Projects/cworker/lib" S["APP_LIBDIR"]="/app/lib/cworker"
S["app_rundir"]="/dat2/home/ziggi/Projects/cworker/run" S["app_rundir"]="/var/run/cworker"
S["APP_RUNDIR"]="/dat2/home/ziggi/Projects/cworker/run" S["APP_RUNDIR"]="/var/run/cworker"
S["app_logdir"]="/dat2/home/ziggi/Projects/cworker/log" S["app_logdir"]="/var/log/cworker"
S["APP_LOGDIR"]="/dat2/home/ziggi/Projects/cworker/log" S["APP_LOGDIR"]="/var/log/cworker"
S["app_configdir"]="/dat2/home/ziggi/Projects/cworker/" S["app_configdir"]="/app/etc/cworker"
S["APP_CONFIGDIR"]="/dat2/home/ziggi/Projects/cworker/" S["APP_CONFIGDIR"]="/app/etc/cworker"
S["SYSTEMD_FALSE"]="#" S["SYSTEMD_FALSE"]="#"
S["SYSTEMD_TRUE"]="" S["SYSTEMD_TRUE"]=""
S["LINUX_OS_FALSE"]="#" S["LINUX_OS_FALSE"]="#"
@@ -873,6 +873,9 @@ S["build_vendor"]="pc"
S["build_cpu"]="x86_64" S["build_cpu"]="x86_64"
S["build"]="x86_64-pc-linux-gnu" S["build"]="x86_64-pc-linux-gnu"
S["LIBTOOL"]="$(SHELL) $(top_builddir)/libtool" S["LIBTOOL"]="$(SHELL) $(top_builddir)/libtool"
S["KUBECTL"]="/bin/kubectl"
S["HELM"]="/bin/helm"
S["DOCKER"]="/bin/podman"
S["HAVE_VALGRIND_FALSE"]="" S["HAVE_VALGRIND_FALSE"]=""
S["HAVE_VALGRIND_TRUE"]="#" S["HAVE_VALGRIND_TRUE"]="#"
S["VALGRIND"]="/bin/valgrind" S["VALGRIND"]="/bin/valgrind"
@@ -910,11 +913,11 @@ S["MKDIR_P"]="/bin/mkdir -p"
S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s" S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s"
S["STRIP"]="strip" S["STRIP"]="strip"
S["install_sh"]="${SHELL} /dat2/home/ziggi/Projects/cworker/install-sh" S["install_sh"]="${SHELL} /dat2/home/ziggi/Projects/cworker/install-sh"
S["MAKEINFO"]="${SHELL} /dat2/home/ziggi/Projects/cworker/missing makeinfo" S["MAKEINFO"]="${SHELL} '/dat2/home/ziggi/Projects/cworker/missing' makeinfo"
S["AUTOHEADER"]="${SHELL} /dat2/home/ziggi/Projects/cworker/missing autoheader" S["AUTOHEADER"]="${SHELL} '/dat2/home/ziggi/Projects/cworker/missing' autoheader"
S["AUTOMAKE"]="${SHELL} /dat2/home/ziggi/Projects/cworker/missing automake" S["AUTOMAKE"]="${SHELL} '/dat2/home/ziggi/Projects/cworker/missing' automake-1.16"
S["AUTOCONF"]="${SHELL} /dat2/home/ziggi/Projects/cworker/missing autoconf" S["AUTOCONF"]="${SHELL} '/dat2/home/ziggi/Projects/cworker/missing' autoconf"
S["ACLOCAL"]="${SHELL} /dat2/home/ziggi/Projects/cworker/missing aclocal" S["ACLOCAL"]="${SHELL} '/dat2/home/ziggi/Projects/cworker/missing' aclocal-1.16"
S["VERSION"]="0.0.1" S["VERSION"]="0.0.1"
S["PACKAGE"]="cworker" S["PACKAGE"]="cworker"
S["CYGPATH_W"]="echo" S["CYGPATH_W"]="echo"
@@ -951,7 +954,7 @@ S["libexecdir"]="${exec_prefix}/libexec"
S["sbindir"]="${exec_prefix}/sbin" S["sbindir"]="${exec_prefix}/sbin"
S["bindir"]="${exec_prefix}/bin" S["bindir"]="${exec_prefix}/bin"
S["program_transform_name"]="s,x,x," S["program_transform_name"]="s,x,x,"
S["prefix"]="/usr/local" S["prefix"]="/app"
S["exec_prefix"]="${prefix}" S["exec_prefix"]="${prefix}"
S["PACKAGE_URL"]="" S["PACKAGE_URL"]=""
S["PACKAGE_BUGREPORT"]="" S["PACKAGE_BUGREPORT"]=""
@@ -1049,13 +1052,13 @@ D["HAVE_MEMSET"]=" 1"
D["HAVE_MKDIR"]=" 1" D["HAVE_MKDIR"]=" 1"
D["HAVE_SETLOCALE"]=" 1" D["HAVE_SETLOCALE"]=" 1"
D["HAVE_SOCKET"]=" 1" D["HAVE_SOCKET"]=" 1"
D["APP_CONFIGDIR"]=" \"/dat2/home/ziggi/Projects/cworker/\"" D["APP_CONFIGDIR"]=" \"/app/etc/cworker\""
D["APP_LOGDIR"]=" \"/dat2/home/ziggi/Projects/cworker/log\"" D["APP_LOGDIR"]=" \"/var/log/cworker\""
D["APP_RUNDIR"]=" \"/dat2/home/ziggi/Projects/cworker/run\"" D["APP_RUNDIR"]=" \"/var/run/cworker\""
D["APP_LIBDIR"]=" \"/dat2/home/ziggi/Projects/cworker/lib\"" D["APP_LIBDIR"]=" \"/app/lib/cworker\""
D["APP_USER"]=" \"ziggi\"" D["APP_USER"]=" \"www-data\""
D["APP_DATABASEDIR"]=" \"/dat2/home/ziggi/Projects/cworker/data\"" D["APP_DATABASEDIR"]=" \"/var/db/cworker\""
D["APP_CACHEDIR"]=" \"/dat2/home/ziggi/Projects/cworker/cache\"" D["APP_CACHEDIR"]=" \"/var/cache/cworker\""
for (key in D) D_is_set[key] = 1 for (key in D) D_is_set[key] = 1
FS = "" FS = ""
} }
@@ -1461,7 +1464,9 @@ $as_echo X/"$am_mf" |
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Something went wrong bootstrapping makefile fragments as_fn_error $? "Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. Try re-running configure with the for automatic dependency tracking. If GNU make was not used, consider
re-running the configure script with MAKE=\"gmake\" (or whatever is
necessary). You can also try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build '--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking). the package (albeit without support for automatic dependency tracking).
See \`config.log' for more details" "$LINENO" 5; } See \`config.log' for more details" "$LINENO" 5; }

View File

@@ -22,6 +22,15 @@ AC_STRUCT_TIMEZONE
AC_PATH_PROG([VALGRIND],[valgrind true]) AC_PATH_PROG([VALGRIND],[valgrind true])
AM_CONDITIONAL(HAVE_VALGRIND, [test "x$VALGRIND" = "xvalgrind"]) AM_CONDITIONAL(HAVE_VALGRIND, [test "x$VALGRIND" = "xvalgrind"])
AC_PATH_PROGS([DOCKER],[podman docker true])
dnl if test -z "$DOCKER"; then
dnl AC_MSG_ERROR([Requested program docker or podman not found])
dnl fi
AC_PATH_PROGS([HELM],[helm true])
AC_PATH_PROGS([KUBECTL],[kubectl true])
LT_INIT([disable-shared]) LT_INIT([disable-shared])
AC_SUBST([LIBTOOL_DEPS]) AC_SUBST([LIBTOOL_DEPS])
AC_CONFIG_MACRO_DIRS([m4]) AC_CONFIG_MACRO_DIRS([m4])

View File

@@ -45,7 +45,7 @@
#include <cworker.h> #include <cworker.h>
#include <logger.h> #include <logger.h>
static const int64_t default_port = 9701; static const int64_t default_port = 9002;
static cworker_t* pworker = NULL; static cworker_t* pworker = NULL;
static int mkdirall(const char* path, mode_t mode); static int mkdirall(const char* path, mode_t mode);
@@ -288,11 +288,16 @@ int cworker_handler(const cworker_t* worker, int socket) {
} }
int64_t id = 0; int64_t id = 0;
int64_t timeout = 0;
char* name = "none"; char* name = "none";
if (jparser_bind(&parser, JVALTYPE_NUM, "id", (void *)&id) < 0) { if (jparser_bind(&parser, JVALTYPE_NUM, "id", (void *)&id) < 0) {
log_error("Cannot bind id"); log_error("Cannot bind id");
} }
if (jparser_bind(&parser, JVALTYPE_NUM, "timeout", (void *)&timeout) < 0) {
log_error("Cannot bind timeout");
}
if (jparser_bind(&parser, JVALTYPE_STR, "name", (void *)&name) < 0) { if (jparser_bind(&parser, JVALTYPE_STR, "name", (void *)&name) < 0) {
log_error("Cannot bind name"); log_error("Cannot bind name");
} }
@@ -306,7 +311,12 @@ int cworker_handler(const cworker_t* worker, int socket) {
jblock_addstr(&jb, "message", msg); jblock_addstr(&jb, "message", msg);
jblock_addbool(&jb, "error", false); jblock_addbool(&jb, "error", false);
jblock_addint(&jb, "id", id); jblock_addint(&jb, "id", id);
jblock_addint(&jb, "timeout", timeout);
for (int64_t i = 0; i < timeout; i++) {
log_debug("The handler slept for %ld second from %ld", i + 1, timeout);
sleep(1);
}
char* jsonstr = NULL; char* jsonstr = NULL;
jblock_outjson(&jb, &jsonstr); jblock_outjson(&jb, &jsonstr);

View File

@@ -1,2 +1,2 @@
port = 9001 # listen port port = 9002 # listen port

View File

@@ -2,25 +2,25 @@
/* defines.h.in. Generated from configure.ac by autoheader. */ /* defines.h.in. Generated from configure.ac by autoheader. */
/* location of cache dir */ /* location of cache dir */
#define APP_CACHEDIR "/dat2/home/ziggi/Projects/cworker/cache" #define APP_CACHEDIR "/var/cache/cworker"
/* location of configuration files for ${PACKAGE} */ /* location of configuration files for ${PACKAGE} */
#define APP_CONFIGDIR "/dat2/home/ziggi/Projects/cworker/" #define APP_CONFIGDIR "/app/etc/cworker"
/* location of database dir */ /* location of database dir */
#define APP_DATABASEDIR "/dat2/home/ziggi/Projects/cworker/data" #define APP_DATABASEDIR "/var/db/cworker"
/* location of libs */ /* location of libs */
#define APP_LIBDIR "/dat2/home/ziggi/Projects/cworker/lib" #define APP_LIBDIR "/app/lib/cworker"
/* location of ${PACKAGE} logdir */ /* location of ${PACKAGE} logdir */
#define APP_LOGDIR "/dat2/home/ziggi/Projects/cworker/log" #define APP_LOGDIR "/var/log/cworker"
/* location of pid file */ /* location of pid file */
#define APP_RUNDIR "/dat2/home/ziggi/Projects/cworker/run" #define APP_RUNDIR "/var/run/cworker"
/* effective user */ /* effective user */
#define APP_USER "ziggi" #define APP_USER "www-data"
/* Define to 1 if you have the <arpa/inet.h> header file. */ /* Define to 1 if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1 #define HAVE_ARPA_INET_H 1
@@ -57,6 +57,9 @@
to 0 otherwise. */ to 0 otherwise. */
#define HAVE_MALLOC 1 #define HAVE_MALLOC 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `memset' function. */ /* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1 #define HAVE_MEMSET 1
@@ -75,9 +78,6 @@
/* Define to 1 if you have the <stdint.h> header file. */ /* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1 #define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdio.h> header file. */
/* #undef HAVE_STDIO_H */
/* Define to 1 if you have the <stdlib.h> header file. */ /* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1 #define HAVE_STDLIB_H 1
@@ -155,9 +155,7 @@
/* Define to the version of this package. */ /* Define to the version of this package. */
#define PACKAGE_VERSION "0.0.1" #define PACKAGE_VERSION "0.0.1"
/* Define to 1 if all of the C90 standard headers exist (not just the ones /* Define to 1 if you have the ANSI C header files. */
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#define STDC_HEADERS 1 #define STDC_HEADERS 1
/* Define to 1 if your <sys/time.h> declares `struct tm'. */ /* Define to 1 if your <sys/time.h> declares `struct tm'. */
@@ -175,7 +173,7 @@
/* Define to `int' if <sys/types.h> does not define. */ /* Define to `int' if <sys/types.h> does not define. */
/* #undef mode_t */ /* #undef mode_t */
/* Define as a signed integer type capable of holding a process identifier. */ /* Define to `int' if <sys/types.h> does not define. */
/* #undef pid_t */ /* #undef pid_t */
/* Define to `int' if <sys/types.h> does not define. */ /* Define to `int' if <sys/types.h> does not define. */

View File

@@ -56,6 +56,9 @@
to 0 otherwise. */ to 0 otherwise. */
#undef HAVE_MALLOC #undef HAVE_MALLOC
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */ /* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET #undef HAVE_MEMSET
@@ -74,9 +77,6 @@
/* Define to 1 if you have the <stdint.h> header file. */ /* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H #undef HAVE_STDINT_H
/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H
/* Define to 1 if you have the <stdlib.h> header file. */ /* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H #undef HAVE_STDLIB_H
@@ -154,9 +154,7 @@
/* Define to the version of this package. */ /* Define to the version of this package. */
#undef PACKAGE_VERSION #undef PACKAGE_VERSION
/* Define to 1 if all of the C90 standard headers exist (not just the ones /* Define to 1 if you have the ANSI C header files. */
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#undef STDC_HEADERS #undef STDC_HEADERS
/* Define to 1 if your <sys/time.h> declares `struct tm'. */ /* Define to 1 if your <sys/time.h> declares `struct tm'. */
@@ -174,7 +172,7 @@
/* Define to `int' if <sys/types.h> does not define. */ /* Define to `int' if <sys/types.h> does not define. */
#undef mode_t #undef mode_t
/* Define as a signed integer type capable of holding a process identifier. */ /* Define to `int' if <sys/types.h> does not define. */
#undef pid_t #undef pid_t
/* Define to `int' if <sys/types.h> does not define. */ /* Define to `int' if <sys/types.h> does not define. */