mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
Overhaul of build and packaging system:
- Build RPM packages for VILLASnode and dependencies with the ‚rpm‘, ‚rpm-villas‘, ‚rpm-livxil‘ and ‚rpm-libwebsockets‘ make targets - Upload new RPM packages to the repository with the ‚deploy‘ make target - Build a developer Docker image with the `docker-dev` target - Run the developer image with the `run-docker-dev` target - Build a production Docker image with the `docker` target This requires that all RPM packages have been build previously! - Use hard-coded default paths where applicable - Updated index website - Added some usage information and hints Documentation of the new system is still outstanding
This commit is contained in:
parent
3374b85d2d
commit
dbc1530727
27 changed files with 716 additions and 170 deletions
16
.distignore
Normal file
16
.distignore
Normal file
|
@ -0,0 +1,16 @@
|
|||
build
|
||||
thirdparty
|
||||
clients
|
||||
|
||||
.git
|
||||
.gitmodules
|
||||
.gitignore
|
||||
.dockerignore
|
||||
|
||||
.DS_Store
|
||||
*~
|
||||
|
||||
*.o
|
||||
*.d
|
||||
|
||||
villas-*
|
|
@ -1,4 +1,5 @@
|
|||
*
|
||||
!build/release/packaging/rpm/*
|
||||
!thirdparty/libxil/
|
||||
!thirdparty/criterion/
|
||||
!thirdparty/libwebsockets/
|
|
@ -17,7 +17,6 @@ stages:
|
|||
# Build docker image which is used to build & test VILLASnode
|
||||
docker-image:
|
||||
stage: prepare
|
||||
# Must match the docker version on the build machine!
|
||||
before_script:
|
||||
- git submodule sync --recursive
|
||||
- git submodule update --recursive --init
|
||||
|
@ -107,14 +106,25 @@ website:
|
|||
tags:
|
||||
- villas-deploy
|
||||
|
||||
packaging:
|
||||
stage: deploy
|
||||
script:
|
||||
- make rpm
|
||||
tags:
|
||||
- shell
|
||||
- fedora
|
||||
|
||||
deliver:
|
||||
stage: deploy
|
||||
script:
|
||||
- rsync -r build/release/doc/html/ $DEPLOY_PATH/doc/$CI_BUILD_REF_NAME/
|
||||
- rsync -r build/release-coverage/coverage/ $DEPLOY_PATH/coverage/$CI_BUILD_REF_NAME/
|
||||
- rsync -r build/release/packaging/rpm/RPMS $DEPLOY_PATH/../packages
|
||||
- createrepo $DEPLOY_PATH/../packages
|
||||
dependencies:
|
||||
- docs
|
||||
- coverage
|
||||
- packaging
|
||||
tags:
|
||||
- villas-deploy
|
||||
|
||||
|
|
101
Dockerfile
101
Dockerfile
|
@ -1,86 +1,37 @@
|
|||
# Dockerfile for VILLASnode development and testing
|
||||
# Dockerfile for VILLASnode dependencies.
|
||||
#
|
||||
# Use this Dockerfile running:
|
||||
# $ make docker
|
||||
# This Dockerfile builds an image which contains all library dependencies
|
||||
# and tools to build VILLASnode.
|
||||
# However, VILLASnode itself it not part of the image.
|
||||
#
|
||||
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
|
||||
# @copyright 2016, Institute for Automation of Complex Power Systems, EONERC
|
||||
# @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
|
||||
###################################################################################
|
||||
|
||||
FROM fedora:latest
|
||||
MAINTAINER Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
|
||||
|
||||
# Expose ports for HTTP and WebSocket frontend
|
||||
# Install dependencies
|
||||
RUN dnf -y update && \
|
||||
dnf -y install \
|
||||
libconfig \
|
||||
libnl3 \
|
||||
libcurl \
|
||||
jansson
|
||||
|
||||
# Some additional tools required for running VILLASnode
|
||||
RUN dnf -y update && \
|
||||
dnf -y install \
|
||||
iproute \
|
||||
openssl \
|
||||
kernel-modules-extra
|
||||
|
||||
# Install our own RPMs
|
||||
COPY build/release/packaging/rpm/RPMS/ /rpms/
|
||||
RUN rpm -i /rpms/x86_64/{libxil,libwebsockets,villas-node,villas-node-doc}-[0-9]*; rm -rf /rpms/
|
||||
|
||||
# For WebSocket / API access
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
# Toolchain & dependencies
|
||||
RUN dnf -y update && \
|
||||
dnf -y install \
|
||||
pkgconfig \
|
||||
gcc \
|
||||
make \
|
||||
wget \
|
||||
tar \
|
||||
cmake \
|
||||
openssl-devel \
|
||||
libconfig-devel \
|
||||
libnl3-devel \
|
||||
libcurl-devel \
|
||||
jansson-devel
|
||||
|
||||
# Tools for documentation
|
||||
RUN dnf -y update && \
|
||||
dnf -y install \
|
||||
doxygen \
|
||||
dia \
|
||||
graphviz
|
||||
|
||||
# Tools for deployment / packaging
|
||||
RUN dnf -y update && \
|
||||
dnf -y install \
|
||||
openssh-clients \
|
||||
rpmdevtools \
|
||||
rpm-build
|
||||
|
||||
# Tools to build dependencies
|
||||
RUN dnf -y update && \
|
||||
dnf -y install \
|
||||
git \
|
||||
gcc-c++ \
|
||||
autoconf \
|
||||
automake \
|
||||
autogen \
|
||||
libtool \
|
||||
flex \
|
||||
bison \
|
||||
texinfo
|
||||
|
||||
# Tools for coverage and profiling
|
||||
RUN dnf -y update && \
|
||||
dnf -y install \
|
||||
python-pip && \
|
||||
pip install \
|
||||
gcovr
|
||||
|
||||
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
|
||||
ENV LD_LIBRARY_PATH /usr/local/lib
|
||||
|
||||
# Build & Install libxil
|
||||
COPY thirdparty/libxil /tmp/libxil
|
||||
RUN mkdir -p /tmp/libxil/build && cd /tmp/libxil/build && cmake .. && make install
|
||||
|
||||
# Build & Install Criterion
|
||||
COPY thirdparty/criterion /tmp/criterion
|
||||
RUN mkdir -p /tmp/criterion/build && cd /tmp/criterion/build && cmake .. && make install
|
||||
|
||||
# Build & Install libwebsockets
|
||||
COPY thirdparty/libwebsockets /tmp/libwebsockets
|
||||
RUN mkdir -p /tmp/libwebsockets/build && cd /tmp/libwebsockets/build && cmake .. && make install
|
||||
|
||||
# Cleanup intermediate files from builds
|
||||
RUN rm -rf /tmp/*
|
||||
|
||||
WORKDIR /villas
|
||||
|
||||
ENTRYPOINT make clean && make install && villas node; bash
|
||||
ENTRYPOINT ["villas"]
|
85
Dockerfile.dev
Normal file
85
Dockerfile.dev
Normal file
|
@ -0,0 +1,85 @@
|
|||
# Dockerfile for VILLASnode development.
|
||||
#
|
||||
# This Dockerfile builds an image which contains all library dependencies
|
||||
# and tools to build VILLASnode.
|
||||
# However, VILLASnode itself it not part of the image.
|
||||
#
|
||||
# This image can be used for developing VILLASnode
|
||||
# by running:
|
||||
# make docker
|
||||
#
|
||||
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
|
||||
# @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
|
||||
###################################################################################
|
||||
|
||||
FROM fedora:latest
|
||||
MAINTAINER Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
|
||||
|
||||
# Toolchain
|
||||
RUN dnf -y update && \
|
||||
dnf -y install \
|
||||
gcc pkgconfig make cmake \
|
||||
git \
|
||||
gcc-c++ \
|
||||
autoconf automake autogen libtool \
|
||||
flex bison \
|
||||
texinfo
|
||||
|
||||
# Dependencies
|
||||
RUN dnf -y update && \
|
||||
dnf -y install \
|
||||
openssl \
|
||||
openssl-devel \
|
||||
libconfig-devel \
|
||||
libnl3-devel \
|
||||
libcurl-devel \
|
||||
jansson-devel
|
||||
|
||||
# Several tools only needed for developement and testing
|
||||
RUN dnf -y update && \
|
||||
dnf -y install \
|
||||
doxygen \
|
||||
dia \
|
||||
graphviz \
|
||||
openssh-clients \
|
||||
rpmdevtools \
|
||||
rpm-build \
|
||||
jq \
|
||||
iproute \
|
||||
python-pip \
|
||||
valgrind \
|
||||
gdb
|
||||
|
||||
# Tools for debugging, coverage, profiling
|
||||
RUN pip install \
|
||||
gcovr
|
||||
|
||||
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
|
||||
ENV LD_LIBRARY_PATH /usr/local/lib
|
||||
|
||||
# Build & Install libxil
|
||||
COPY thirdparty/libxil /tmp/libxil
|
||||
RUN mkdir -p /tmp/libxil/build && cd /tmp/libxil/build && cmake .. && make install
|
||||
|
||||
# Build & Install Criterion
|
||||
COPY thirdparty/criterion /tmp/criterion
|
||||
RUN mkdir -p /tmp/criterion/build && cd /tmp/criterion/build && cmake .. && make install
|
||||
|
||||
# Build & Install libwebsockets
|
||||
COPY thirdparty/libwebsockets /tmp/libwebsockets
|
||||
RUN mkdir -p /tmp/libwebsockets/build && cd /tmp/libwebsockets/build && cmake .. && make install
|
||||
|
||||
# Cleanup intermediate files from builds
|
||||
RUN rm -rf /tmp/*
|
||||
|
||||
# Expose ports for HTTP and WebSocket frontend
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
ADD https://villas.0l.de/packages/villas.repo /etc/yum.repos.d/
|
||||
|
||||
ENTRYPOINT villas
|
||||
|
||||
WORKDIR /villas
|
||||
|
||||
ENTRYPOINT bash
|
68
Makefile
68
Makefile
|
@ -15,7 +15,7 @@
|
|||
###################################################################################
|
||||
|
||||
# Project modules
|
||||
MODULES = lib plugins src tests thirdparty tools
|
||||
MODULES = lib plugins src tests thirdparty tools packaging doc etc web
|
||||
|
||||
# Default prefix for install target
|
||||
PREFIX ?= /usr/local
|
||||
|
@ -26,14 +26,12 @@ BUILDDIR ?= build
|
|||
# Default debug level for executables
|
||||
V ?= 2
|
||||
|
||||
# Version of VILLASnode
|
||||
VERSION = 0.7
|
||||
|
||||
# Common flags
|
||||
LDLIBS =
|
||||
CFLAGS += -std=c11 -Iinclude -Iinclude/villas -I. -MMD -mcx16
|
||||
CFLAGS += -I. -Iinclude -Iinclude/villas
|
||||
CFLAGS += @$(BUILDDIR)/defines
|
||||
CFLAGS += -std=c11 -MMD -mcx16
|
||||
CFLAGS += -Wall -Werror -fdiagnostics-color=auto
|
||||
CFLAGS += -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE=1 -DV=$(V)
|
||||
LDFLAGS += -L$(BUILDDIR)
|
||||
|
||||
# We must compile without optimizations for gcov!
|
||||
|
@ -63,25 +61,24 @@ ifdef COVERAGE
|
|||
VARIANTS += coverage
|
||||
endif
|
||||
|
||||
SPACE :=
|
||||
SPACE +=
|
||||
VARIANT = $(subst $(SPACE),-,$(strip $(VARIANTS)))
|
||||
EMPTY :=
|
||||
SPACE := $(EMPTY) $(EMPTY)
|
||||
|
||||
VARIANT = $(subst $(SPACE),-,$(strip $(VARIANTS)))
|
||||
BUILDDIR := $(BUILDDIR)/$(VARIANT)
|
||||
SRCDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
# Add git revision and build variant defines
|
||||
VERSION = $(shell git describe --tags --abbrev=0 --match v*)
|
||||
VERSION_NUM = $(shell VERSION=$(VERSION); echo $${VERSION:1})
|
||||
|
||||
ifdef CI
|
||||
GIT_REV = ${CI_BUILD_REF:0:7}
|
||||
VARIANT = ci-$(VARIANT)
|
||||
else
|
||||
ifneq ($(shell type -p git),)
|
||||
# GIT_REV = $(shell git describe --tags)
|
||||
GIT_REV = $(shell REV=$$(git rev-parse HEAD); echo $${REV:0:7})
|
||||
endif
|
||||
GIT_REV = $(shell REV=$$(git rev-parse HEAD); echo $${REV:0:7})
|
||||
endif
|
||||
|
||||
CFLAGS += -D_VERSION='$(VERSION)' -D_VARIANT='"$(VARIANT)"' -D_GIT_REV='"$(GIT_REV)"'
|
||||
|
||||
# pkg-config dependencies
|
||||
PKGS = libconfig
|
||||
|
@ -89,36 +86,47 @@ PKGS = libconfig
|
|||
######## Targets ########
|
||||
|
||||
# Add flags by pkg-config
|
||||
CFLAGS += $(addprefix -DWITH_, $(shell echo ${PKGS} | tr a-z- A-Z_ | tr -dc ' A-Z0-9_' ))
|
||||
CFLAGS += $(shell pkg-config --cflags ${PKGS})
|
||||
LDLIBS += $(shell pkg-config --libs ${PKGS})
|
||||
|
||||
all: src plugins | lib
|
||||
all: src plugins tools
|
||||
|
||||
# Build everything with different profiles: debug, coverage, ...
|
||||
# Build all variants: debug, coverage, ...
|
||||
everything:
|
||||
$(MAKE) RELEASE=1
|
||||
$(MAKE) DEBUG=1
|
||||
$(MAKE) COVERAGE=1
|
||||
$(MAKE) PROFILE=1
|
||||
|
||||
docker:
|
||||
docker build -t villas .
|
||||
docker run -it -p 80:80 -p 443:443 -p 1234:1234 --privileged --cap-add sys_nic --ulimit memlock=1073741824 --security-opt seccomp:unconfined -v $(PWD):/villas villas
|
||||
|
||||
doc: | $(BUILDDIR)/doc/
|
||||
( cat Doxyfile ; echo "OUTPUT_DIRECTORY=$(BUILDDIR)/doc/" ) | doxygen -
|
||||
|
||||
# Create non-existent directories
|
||||
.SECONDEXPANSION:
|
||||
.PRECIOUS: %/
|
||||
%/:
|
||||
mkdir -p $@
|
||||
|
||||
.PHONY: all everything clean install docker doc
|
||||
.PRECIOUS: %/
|
||||
.SECONDEXPANSION:
|
||||
define DEFINES
|
||||
-DV=$(V)
|
||||
|
||||
install: $(addprefix install-,$(filter-out thirdparty,$(MODULES)))
|
||||
clean: $(addprefix clean-,$(filter-out thirdparty,$(MODULES)))
|
||||
-DPLUGIN_PATH=\"$(PREFIX)/share/villas/node/plugins\"
|
||||
-DWEB_PATH=\"$(PREFIX)/share/villas/node/web\"
|
||||
-DSYSFS_PATH=\"/sys\"
|
||||
-DPROCFS_PATH=\"/proc\"
|
||||
-DBUILDID=\"$(VERSION)-$(GIT_REV)-$(VARIANT)\"
|
||||
|
||||
-D_POSIX_C_SOURCE=200809L
|
||||
-D_GNU_SOURCE=1
|
||||
endef
|
||||
export DEFINES
|
||||
|
||||
$(BUILDDIR)/defines: | $$(dir $$@)
|
||||
echo "$${DEFINES}" > $@
|
||||
echo -e "$(addprefix \n-DWITH_, $(shell echo ${PKGS} | tr a-z- A-Z_ | tr -dc ' A-Z0-9_' ))" >> $@
|
||||
echo -e "$(addprefix \n-DWITH_, $(shell echo ${LIB_PKGS} | tr a-z- A-Z_ | tr -dc ' A-Z0-9_' ))" >> $@
|
||||
|
||||
install: $(addprefix install-,$(filter-out thirdparty doc,$(MODULES)))
|
||||
clean: $(addprefix clean-,$(filter-out thirdparty doc,$(MODULES)))
|
||||
|
||||
.PHONY: all everything clean install
|
||||
|
||||
-include $(wildcard $(BUILDDIR)/**/*.d)
|
||||
-include $(addsuffix /Makefile.inc,$(MODULES))
|
||||
-include $(addsuffix /Makefile.inc,$(MODULES))
|
21
config.h
21
config.h
|
@ -10,9 +10,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
/** The version number of VILLASnode */
|
||||
#define VERSION_STR "v" XSTR(_VERSION) "-" _GIT_REV "-" _VARIANT
|
||||
|
||||
/** Default number of values in a sample */
|
||||
#define DEFAULT_VALUES 64
|
||||
#define DEFAULT_QUEUELEN 1024
|
||||
|
@ -31,26 +28,12 @@
|
|||
#define IPPROTO_VILLAS 137
|
||||
#define ETH_P_VILLAS 0xBABE
|
||||
|
||||
#define SYSFS_PATH "/sys"
|
||||
#define PROCFS_PATH "/proc"
|
||||
#define USER_AGENT "VILLASnode (" BUILDID ")"
|
||||
|
||||
#define USER_AGENT "VILLASnode " VERSION_STR
|
||||
|
||||
/* Required kernel version */
|
||||
/*ID Required kernel version */
|
||||
#define KERNEL_VERSION_MAJ 3
|
||||
#define KERNEL_VERSION_MIN 6
|
||||
|
||||
/* Some hard-coded configuration for the FPGA benchmarks */
|
||||
#define BENCH_DM 3
|
||||
// 1 FIFO
|
||||
// 2 DMA SG
|
||||
// 3 DMA Simple
|
||||
|
||||
#define BENCH_RUNS 3000000
|
||||
#define BENCH_WARMUP 100
|
||||
#define BENCH_DM_EXP_MIN 0
|
||||
#define BENCH_DM_EXP_MAX 20
|
||||
|
||||
/** PCIe BAR number of VILLASfpga registers */
|
||||
#define FPGA_PCI_BAR 0
|
||||
#define FPGA_PCI_VID_XILINX 0x10ee
|
||||
|
|
11
doc/Makefile.inc
Normal file
11
doc/Makefile.inc
Normal file
|
@ -0,0 +1,11 @@
|
|||
doc: | $(BUILDDIR)/doc/
|
||||
( cat Doxyfile ; echo "OUTPUT_DIRECTORY=$(BUILDDIR)/doc/" ) | doxygen -
|
||||
|
||||
install-doc: doc
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/share/villas/node/doc/
|
||||
cp -R $(BUILDDIR)/doc/html/* $(DESTDIR)$(PREFIX)/share/villas/node/doc/
|
||||
|
||||
clean-doc:
|
||||
rm -rf $(BUILDDIR)/doc/
|
||||
|
||||
.PHONY: doc install-doc clean-doc
|
8
etc/Makefile.inc
Normal file
8
etc/Makefile.inc
Normal file
|
@ -0,0 +1,8 @@
|
|||
etc:
|
||||
|
||||
install-etc:
|
||||
install -D -t $(DESTDIR)/etc/villas/node etc/*.conf
|
||||
|
||||
clean-etc:
|
||||
|
||||
.PHONY: etc install-etc clean-etc
|
|
@ -1,5 +1,7 @@
|
|||
# Libraries
|
||||
LIBS = $(BUILDDIR)/libvillas.so
|
||||
LIB_NAME = libvillas
|
||||
LIB_ABI_VERSION = 1
|
||||
|
||||
LIB = $(BUILDDIR)/$(LIB_NAME).so
|
||||
|
||||
# Object files for libvillas
|
||||
LIB_SRCS = $(addprefix lib/nodes/, file.c cbuilder.c) \
|
||||
|
@ -12,7 +14,7 @@ LIB_SRCS = $(addprefix lib/nodes/, file.c cbuilder.c) \
|
|||
|
||||
LIB_CFLAGS = $(CFLAGS) -fPIC
|
||||
LIB_LDFLAGS = -shared
|
||||
LIB_LDLIBS = $(LDLIBS) -ldl -lrt
|
||||
LIB_LDLIBS = $(LDLIBS) -ldl -lrt -Wl,-soname,$(LIB_NAME).so.$(LIB_ABI_VERSION)
|
||||
|
||||
-include lib/hooks/Makefile.inc
|
||||
-include lib/apis/Makefile.inc
|
||||
|
@ -74,30 +76,28 @@ endif
|
|||
endif
|
||||
|
||||
# Add flags by pkg-config
|
||||
LIB_CFLAGS += $(addprefix -DWITH_, $(shell echo ${LIB_PKGS} | tr a-z- A-Z_ | tr -dc ' A-Z0-9_' ))
|
||||
LIB_CFLAGS += $(shell pkg-config --cflags ${LIB_PKGS})
|
||||
LIB_LDLIBS += $(shell pkg-config --libs ${LIB_PKGS})
|
||||
|
||||
LIB_OBJS = $(patsubst %.c, $(BUILDDIR)/%.o, $(LIB_SRCS))
|
||||
|
||||
lib: $(LIBS)
|
||||
|
||||
# Compile
|
||||
$(BUILDDIR)/lib/%.o: lib/%.c | $$(dir $$@)
|
||||
$(CC) $(LIB_CFLAGS) -c $< -o $@
|
||||
lib: $(LIB)
|
||||
|
||||
# Link
|
||||
$(LIBS): $(LIB_OBJS)
|
||||
$(LIB): $(LIB_OBJS)
|
||||
$(CC) $(LIB_LDFLAGS) -o $@ $^ $(LIB_LDLIBS)
|
||||
|
||||
|
||||
# Compile
|
||||
$(BUILDDIR)/lib/%.o: lib/%.c $(BUILDDIR)/defines | $$(dir $$@)
|
||||
$(CC) $(LIB_CFLAGS) -c $< -o $@
|
||||
|
||||
# Install
|
||||
install-lib: lib
|
||||
install -m 0644 $(LIBS) $(PREFIX)/lib
|
||||
install -m 0755 -d $(PREFIX)/include/villas/
|
||||
install -m 0644 include/villas/*.h $(PREFIX)/include/villas/
|
||||
ldconfig
|
||||
install -m 0755 -D -T $(LIB) $(DESTDIR)$(PREFIX)/lib/$(LIB_NAME).so.$(LIB_ABI_VERSION)
|
||||
install -m 0644 -D -t $(DESTDIR)$(PREFIX)/include/villas/ include/villas/*.h
|
||||
ln -srf $(DESTDIR)$(PREFIX)/lib/$(LIB_NAME).so.$(LIB_ABI_VERSION) $(DESTDIR)$(PREFIX)/lib/$(LIB_NAME).so
|
||||
|
||||
clean-lib:
|
||||
rm -rf $(BUILDDIR)/lib $(LIBS)
|
||||
rm -rf $(BUILDDIR)/lib $(LIB)
|
||||
|
||||
.PHONY: lib lib-tests lib-tests
|
||||
.PHONY: lib install-lib clean-lib $(BUILDDIR)/lib/defines
|
||||
|
|
|
@ -63,9 +63,6 @@ int super_node_init(struct super_node *sn)
|
|||
sn->stats = 0;
|
||||
sn->hugepages = DEFAULT_NR_HUGEPAGES;
|
||||
|
||||
sn->web.port = 80;
|
||||
sn->web.htdocs = "/villas/web/socket/";
|
||||
|
||||
sn->state = STATE_INITIALIZED;
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
void print_copyright()
|
||||
{
|
||||
printf("VILLASnode %s (built on %s %s)\n",
|
||||
BLU(VERSION_STR), MAG(__DATE__), MAG(__TIME__));
|
||||
printf(" copyright 2014-2016, Institute for Automation of Complex Power Systems, EONERC\n");
|
||||
BLU(BUILDID), MAG(__DATE__), MAG(__TIME__));
|
||||
printf(" Copyright 2014-2017, Institute for Automation of Complex Power Systems, EONERC\n");
|
||||
printf(" Steffen Vogel <StVogel@eonerc.rwth-aachen.de>\n");
|
||||
}
|
||||
|
||||
|
|
42
packaging/Makefile.inc
Normal file
42
packaging/Makefile.inc
Normal file
|
@ -0,0 +1,42 @@
|
|||
TAROPTS = --exclude-ignore-recursive=.distignore --transform='s|^\.|villas-node-$(VERSION_NUM)|' --show-transformed-names
|
||||
|
||||
TAR_VILLAS = $(BUILDDIR)/packaging/villas-node-$(VERSION_NUM).tar.gz
|
||||
|
||||
DEPLOY_HOST = root@villas.0l.de
|
||||
DEPLOY_PATH = /var/www/villas
|
||||
|
||||
packaging: rpm dist
|
||||
|
||||
deploy: deploy-dist deploy-rpm
|
||||
|
||||
# Source tarballs
|
||||
dist: $(TAR_VILLAS)
|
||||
|
||||
$(TAR_VILLAS): | $$(dir $$@)
|
||||
tar $(TAROPTS) -C $(SRCDIR) -czf $@ .
|
||||
|
||||
deploy-dist: $(TAR_VILLAS)
|
||||
rsync $(TAR_VILLAS) $(DEPLOY_HOST):$(DEPLOY_PATH)/node/src
|
||||
|
||||
deploy-rpm:
|
||||
rsync -a --progress $(RPMDIR)/RPMS/ $(DEPLOY_HOST):$(DEPLOY_PATH)/packages/
|
||||
ssh $(DEPLOY_HOST) createrepo $(DEPLOY_PATH)/packages
|
||||
|
||||
# Docker targets
|
||||
run-docker-dev:
|
||||
docker run -it -p 80:80 -p 443:443 -p 1234:1234 --privileged --cap-add sys_nic --ulimit memlock=1073741824 --security-opt seccomp:unconfined -v $(PWD):/villas villas-dev
|
||||
|
||||
docker-dev:
|
||||
docker build -f Dockerfile.dev -t villas-dev $(SRCDIR)
|
||||
|
||||
docker:
|
||||
docker build -f Dockerfile -t villas $(SRCDIR)
|
||||
|
||||
clean-packaging:
|
||||
rm -f $(BUILDDIR)/packaging/villas-node-$(VERSION_NUM).tar.gz
|
||||
|
||||
install-packaging:
|
||||
|
||||
.PHONY: packaging install-packaging clean-packaging deploy deploy-dist deploy-rpm dist docker docker-dev run-docker-dev $(TAR_VILLAS)
|
||||
|
||||
-include packaging/rpm/Makefile.inc
|
37
packaging/rpm/Makefile.inc
Normal file
37
packaging/rpm/Makefile.inc
Normal file
|
@ -0,0 +1,37 @@
|
|||
RPMDIR = $(BUILDDIR)/packaging/rpm
|
||||
|
||||
SPEC_VILLAS = $(BUILDDIR)/packaging/rpm/villas-node.spec
|
||||
|
||||
# Increment this number for minor release bumps
|
||||
MINOR = 2
|
||||
|
||||
rpm: rpm-villas rpm-libwebsockets rpm-libxil
|
||||
|
||||
rpm-villas: $(TAR_VILLAS) $(SPEC_VILLAS) | $(RPMDIR)/SOURCES/
|
||||
cp $(BUILDDIR)/packaging/villas-node-$(VERSION_NUM).tar.gz $(RPMDIR)/SOURCES
|
||||
rpmbuild -ba --define="_topdir $$(pwd)/$(RPMDIR)" $(BUILDDIR)/packaging/rpm/villas-node.spec
|
||||
|
||||
rpm-libxil: $(BUILDDIR)/thirdparty/libxil/
|
||||
cmake -DCMAKE_INSTALL_PREFIX:PATH=$(PREFIX) \
|
||||
-H$(SRCDIR)/thirdparty/libxil \
|
||||
-B$(BUILDDIR)/thirdparty/libxil $(CMAKE_OPTS)
|
||||
make -C$(BUILDDIR)/thirdparty/libxil package_source
|
||||
cp $(BUILDDIR)/thirdparty/libxil/libxil-*.tar.gz $(RPMDIR)/SOURCES
|
||||
rpmbuild -ba --define="_topdir $$(pwd)/$(RPMDIR)" $(SRCDIR)/thirdparty/libxil/libxil.spec
|
||||
|
||||
rpm-libwebsockets: | $(RPMDIR)/RPMS $(BUILDDIR)/thirdparty/libwebsockets/
|
||||
cmake -DCMAKE_INSTALL_PREFIX:PATH=$(PREFIX) \
|
||||
-H$(SRCDIR)/thirdparty/libwebsockets \
|
||||
-B$(BUILDDIR)/thirdparty/libwebsockets $(CMAKE_OPTS)
|
||||
make -C$(BUILDDIR)/thirdparty/libwebsockets libwebsockets_rpm
|
||||
mv $(BUILDDIR)/thirdparty/libwebsockets/RPM/RPMS/x86_64/libwebsockets-*.rpm $(RPMDIR)/RPMS/x86_64/
|
||||
|
||||
# We patch version number and release fields of the spec file based on the current Git commit
|
||||
$(SPEC_VILLAS): $(SRCDIR)/packaging/rpm/villas-node.spec | $$(dir $$@)
|
||||
sed -e "s/§VERSION§/$(VERSION_NUM)/g" \
|
||||
-e "s/§RELEASE§/$(MINOR).$(VARIANT).$$(date +%Y%m%d)git$$(echo $(GIT_REV) | cut -b1-7)/g" < $^ > $@
|
||||
|
||||
clean-rpm:
|
||||
rm -rf $(RPMDIR)
|
||||
|
||||
.PHONY: rpm clean-rpm rpm-libwebsockets rpm-libxil
|
79
packaging/rpm/villas-node.spec
Normal file
79
packaging/rpm/villas-node.spec
Normal file
|
@ -0,0 +1,79 @@
|
|||
Name: villas-node
|
||||
Version: §VERSION§
|
||||
Vendor: Institute for Automation of Complex Power Systems
|
||||
Packager: Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
|
||||
Release: §RELEASE§%{?dist}
|
||||
Summary: This is VILLASnode, a gateway for processing and forwardning simulation data between real-time simulators.
|
||||
|
||||
License: LGPLv2
|
||||
URL: https://git.rwth-aachen.de/VILLASframework/VILLASnode
|
||||
Source0: villas-node-%{version}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
BuildRequires: gcc pkgconfig make
|
||||
|
||||
Requires: iproute kernel-modules-extra
|
||||
|
||||
BuildRequires: openssl-devel libconfig-devel libnl3-devel libcurl-devel jansson-devel libxil-devel libwebsockets-devel
|
||||
Requires: openssl libconfig libnl3 libcurl jansson libxil libwebsockets
|
||||
|
||||
%description
|
||||
|
||||
%package doc
|
||||
|
||||
Summary: HTML documentation for users and developers.
|
||||
Group: Documentation
|
||||
|
||||
%package devel
|
||||
|
||||
Summary: Headers and libraries for building apps that use libvillas.
|
||||
Group: Development/Libraries
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
|
||||
The development headers for libvillas.
|
||||
|
||||
%description doc
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
make PREFIX=/usr
|
||||
|
||||
%install
|
||||
rm -rf %{?buildroot}
|
||||
make PREFIX=/usr DESTDIR=%{?buildroot} install
|
||||
make PREFIX=/usr DESTDIR=%{?buildroot} install-doc
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
%clean
|
||||
rm -rf %{?buildroot}
|
||||
|
||||
%files
|
||||
/usr/bin/villas
|
||||
/usr/bin/villas-*
|
||||
/usr/bin/conf2json
|
||||
|
||||
/usr/lib/libvillas.so
|
||||
/usr/lib/libvillas.so.*
|
||||
|
||||
/usr/share/villas/node/web/
|
||||
/usr/share/villas/node/plugins/
|
||||
|
||||
%config /etc/villas/node/*.conf
|
||||
%license COPYING.md
|
||||
|
||||
%files doc
|
||||
%docdir /usr/share/villas/node/doc/
|
||||
/usr/share/villas/node/doc/
|
||||
|
||||
%files devel
|
||||
/usr/include/villas/
|
||||
|
||||
%changelog
|
||||
* Fri Mar 17 2017 Steffen Vogel <stvogel@eonerc.rwth-aachen.de
|
||||
- Initial RPM release
|
|
@ -19,7 +19,8 @@ $(PLUGINS):
|
|||
$(CC) $(LIB_LDFLAGS) -o $@ $^ $(LIB_LDLIBS)
|
||||
|
||||
# Plugins are not installed to the system for now...
|
||||
install-plugins:
|
||||
install-plugins: plugins
|
||||
install -D -t $(DESTDIR)$(PREFIX)/share/villas/node/plugins $(PLUGINS)
|
||||
|
||||
clean-plugins:
|
||||
rm -rf $(BUILDDIR)/plugins $(PLUGINS)
|
||||
|
|
|
@ -33,7 +33,7 @@ $(TARGETS): $(BUILDDIR)/villas-%: $(BUILDDIR)/src/%.o
|
|||
$(BUILDDIR)/villas-fpga: $(addprefix $(BUILDDIR)/src/,fpga-bench.o $(BENCH_OBJS))
|
||||
|
||||
# Compile executable objects
|
||||
$(BUILDDIR)/src/%.o: src/%.c | $$(dir $$@)
|
||||
$(BUILDDIR)/src/%.o: src/%.c $(BUILDDIR)/defines | $$(dir $$@)
|
||||
$(CC) $(SRC_CFLAGS) -c $< -o $@
|
||||
|
||||
# Link target executables
|
||||
|
@ -42,7 +42,7 @@ $(TARGETS): | $(LIBS)
|
|||
|
||||
# Install
|
||||
install-src: src
|
||||
install -m 0755 $(TARGETS) $(PREFIX)/bin
|
||||
install -m 0755 -D -t $(DESTDIR)$(PREFIX)/bin $(TARGETS)
|
||||
|
||||
clean-src:
|
||||
rm -rf $(BUILDDIR)/src $(TARGETS)
|
||||
|
|
|
@ -2,9 +2,10 @@ TOOLS = $(BUILDDIR)/conf2json
|
|||
|
||||
TOOLS_CFLAGS = $(CFLAGS)
|
||||
TOOLS_LDLIBS = -lconfig -ljansson -lvillas
|
||||
TOOLS_LDFLAGS = $(LDFLAGS) -Wl,-rpath,'$$ORIGIN'
|
||||
|
||||
# Compile executable objects
|
||||
$(BUILDDIR)/tools/%.o: tools/%.c | $$(dir $$@)
|
||||
$(BUILDDIR)/tools/%.o: tools/%.c $(BUILDDIR)/defines | $$(dir $$@)
|
||||
$(CC) $(TOOLS_CFLAGS) -c $< -o $@
|
||||
|
||||
# Link target executables
|
||||
|
@ -17,7 +18,7 @@ clean-tools:
|
|||
rm -rf $(BUILDDIR)/tools $(TOOLS)
|
||||
|
||||
install-tools: $(TOOLS)
|
||||
install -m 0755 tools/villas.sh $(PREFIX)/bin/villas
|
||||
install -m 0755 tools/villas.sh $(DESTDIR)$(PREFIX)/bin/villas
|
||||
install -m 0755 -D -t $(DESTDIR)$(PREFIX)/bin $(TOOLS)
|
||||
|
||||
.PHONY: tools clean-tools install-tools
|
|
@ -14,7 +14,7 @@
|
|||
PREFIX=villas
|
||||
|
||||
# Get a list of all available tools
|
||||
TOOLS=$(compgen -c | egrep "^$PREFIX-" | sort | cut -d- -f2- | paste -sd\|)
|
||||
TOOLS=$(compgen -c | egrep "^$PREFIX-" | sort -u | cut -d- -f2- | paste -sd'|')
|
||||
|
||||
# First argument to wrapper is the tool which should be started
|
||||
TOOL=$1
|
||||
|
@ -24,7 +24,14 @@ ARGS=${@:2}
|
|||
|
||||
# Check if tool is available
|
||||
if ! [[ "$TOOL" =~ $(echo ^\($TOOLS\)$) ]]; then
|
||||
echo "Usage villas ($TOOLS)" 1>&2
|
||||
echo "Usage: villas [TOOL]" 1>&2
|
||||
echo " TOOL is one of ${TOOLS}"
|
||||
echo
|
||||
echo "For detailed documentation, please run 'villas node'"
|
||||
echo " and point your web browser to http://localhost:80"
|
||||
echo
|
||||
# Show VILLASnode copyright and contact info
|
||||
villas-node --help | tail -n3
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
6
web/Makefile.inc
Normal file
6
web/Makefile.inc
Normal file
|
@ -0,0 +1,6 @@
|
|||
install-web:
|
||||
cp -R web $(DESTDIR)$(PREFIX)/share/villas/node
|
||||
|
||||
clean-web:
|
||||
|
||||
.PHONY: web install-web clean-web
|
267
web/acs_eonerc_logo.svg
Normal file
267
web/acs_eonerc_logo.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 66 KiB |
1
web/doc
Symbolic link
1
web/doc
Symbolic link
|
@ -0,0 +1 @@
|
|||
../doc/
|
|
@ -2,21 +2,57 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>VILLASnode</title>
|
||||
<title>VILLASnode: Connecting real-time power grid simulation equipment</title>
|
||||
<style>
|
||||
body {
|
||||
margin: 5em;
|
||||
}
|
||||
h2 {
|
||||
margin-bottom: 2em;
|
||||
text-align: center;
|
||||
}
|
||||
h2 > a {
|
||||
margin:; 1em;
|
||||
padding: 0.5em;
|
||||
border: 1px solid black;
|
||||
border-radius: 8px;
|
||||
background-color: lightgrey;
|
||||
}
|
||||
* {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
a:visited {
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<img style="float: right;" src="http://www.acs.eonerc.rwth-aachen.de/global/show_picture.asp?id=aaaaaaaaaakevlz&meta=0" alt="ACS Logo" width="375" height="110" />
|
||||
<h1 style="margin-bottom: 2em">VILLASnode: Connecting real-time power grid simulation equipment</h1>
|
||||
|
||||
<h2><a href="socket/">WebSocket Mockup</a></h2>
|
||||
<h2><a href="doc/">Documentation</a></h2>
|
||||
|
||||
<h1 style="text-align: center;">VILLASnode</h1>
|
||||
|
||||
<h3>Source Code</h3>
|
||||
|
||||
<ul>
|
||||
<li><a href="http://git.rwth-aachen.de/acs/VILLASnode">RWTH GitLab</a></li>
|
||||
</ul>
|
||||
|
||||
<h3><a href="doc/">Documentation</a></h3>
|
||||
<h3><a href="coverage/">Coverage</a></h3>
|
||||
<h3><a href="socket/">WebSocket demo</a></h3>
|
||||
<!-- <p>
|
||||
<ul>
|
||||
<li>Source Code: <a href="http://git.rwth-aachen.de/VILLASframework/VILLASnode">RWTH GitLab</a></li>
|
||||
<li><a href="doc/">Documentation</a></li>
|
||||
<li><a href="coverage/">Coverage</a></li>
|
||||
<li><a href="socket/">WebSocket demo</a></li>
|
||||
</ul>
|
||||
</p>
|
||||
-->
|
||||
<h3>Contact</h3>
|
||||
<p>
|
||||
|
||||
<ul>
|
||||
<li><a href="https://villas.0l.de">VILLASframework Website</a></li>
|
||||
<li><a href="http://www.acs.eonerc.rwth-aachen.de">Institute for Automation of Complex Power Systems</a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="mailto:stvogel@eonerc.rwth-aachen.de">Steffen Vogel</a></li>
|
||||
<li><a href="mailto:mstevic@eonerc.rwth-aachen.de">Marija Stevic</a></li>
|
||||
</ul>
|
||||
<img src="acs_eonerc_logo.svg" alt="ACS Logo" width="375" height="110" />
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
1
web/socket/acs_eonerc_logo.svg
Symbolic link
1
web/socket/acs_eonerc_logo.svg
Symbolic link
|
@ -0,0 +1 @@
|
|||
../acs_eonerc_logo.svg
|
|
@ -1 +0,0 @@
|
|||
../../doc/html
|
|
@ -17,7 +17,7 @@
|
|||
<body>
|
||||
<div id="wrapper">
|
||||
<div id="header">
|
||||
<img class="logo" alt="EONERC" src="logo.svg" />
|
||||
<img class="logo" alt="EONERC" src="acs_eonerc_logo.svg" />
|
||||
<h1>VILLASweb Mockup</h1>
|
||||
</div>
|
||||
<div id="container">
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
../../doc/pictures/acs_eonerc_logo.svg
|
Loading…
Add table
Reference in a new issue