This repository has been archived by the owner on May 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from open-ness/openness_rel_2003
Openness rel 2003
- Loading branch information
Showing
69 changed files
with
5,176 additions
and
1,186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,137 +1,150 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright (c) 2019 Intel Corporation | ||
# Copyright (c) 2019-2020 Intel Corporation | ||
|
||
export GO111MODULE = on | ||
|
||
.PHONY: build appliance eaa interfaceservice edgedns clean build-docker lint test help build-docker-hddl hddllog build-docker-fpga-cfg build-docker-fpga-opae | ||
TMP_DIR:=$(shell mktemp -d) | ||
BUILD_DIR ?=dist | ||
.PHONY: \ | ||
onprem-nts onprem-ovncni \ | ||
appliance appliance-cni appliance-nts \ | ||
run-onprem-nts clean \ | ||
eaa edgednssvr nts edalibs ovncni hddllog syslog-ng \ | ||
networkedge networkedge-kubeovn \ | ||
interfaceservice biosfw fpga-cfg fpga-opae \ | ||
lint test help build pull-syslog | ||
COPY_DOCKERFILES := $(shell /usr/bin/cp -rfT ./build/ ./dist/) | ||
VER ?= 1.0 | ||
RTE_SDK ?= /opt/dpdk-18.11.2 | ||
|
||
VER:=1.0 | ||
help: | ||
@echo "Please use \`make <target>\` where <target> is one of" | ||
@echo "" | ||
@echo "Build all the required Docker images for OpenNESS' deployment mode:" | ||
@echo " onprem-nts to build components of On-Premises with NTS dataplane (EAA, Edge DNS Service, Appliance, NTS)" | ||
@echo " onprem-ovncni to build components of On-Premises with OVN CNI dataplane (EAA, Edge DNS Service, Appliance)" | ||
@echo " networkedge to build components of Network Edge deployment (EAA, Edge DNS Service)" | ||
@echo " networkedge-kubeovn to build components of Kube-OVN Network Edge deployment (EAA, Edge DNS Service, Interface Service)" | ||
@echo " common-services to build component common for both On-Premises and Network Edge deployments" | ||
@echo "" | ||
@echo "Start On-Premises services:" | ||
@echo " run-onprem-nts to start components of On-Premises with NTS as a dataplane (EAA, Edge DNS Service, Appliance, NTS)" | ||
@echo "" | ||
@echo "Helper targets:" | ||
@echo " clean to clean build artifacts" | ||
@echo " lint to run linter on Go code" | ||
@echo " test to run tests on Go code" | ||
@echo " help to show this message" | ||
@echo " build to build all executables without images" | ||
@echo "" | ||
@echo "Single targets:" | ||
@echo " appliance-nts to build only docker image of the Appliance for NTS dataplane" | ||
@echo " appliance-cni to build only docker image of the Appliance for OVN CNI dataplane" | ||
@echo " eaa to build only docker image of the EAA" | ||
@echo " interfaceservice to build only docker image of the Interface Service" | ||
@echo " edgednssvr to build only docker image of the Edge DNS Service" | ||
@echo " nts to build only docker image of the NTS" | ||
@echo " edalibs to build EDA libs" | ||
@echo " ovncni to build only ovncni executable" | ||
@echo " hddllog to build only docker image of the HDDL Service" | ||
@echo " biosfw to build only docker image of the BIOSFW" | ||
@echo " fpga-cfg to build only docker image of the FPGA Config" | ||
@echo " fpga-opae to build only docker image of the FPGA OPAE" | ||
@echo " syslog-ng to build only docker image of the syslog-ng" | ||
@echo " pull-syslog to pull docker image of the syslog-ng" | ||
|
||
common-services: eaa edgednssvr syslog-ng | ||
|
||
onprem-nts: common-services appliance-nts | ||
|
||
onprem-ovncni: common-services appliance-cni | ||
|
||
networkedge: common-services | ||
|
||
networkedge-kubeovn: networkedge interfaceservice | ||
|
||
run-onprem-nts: | ||
VER=${VER} docker-compose up appliance nts eaa edgednssvr syslog-ng --no-build | ||
|
||
ifeq ($(KUBE_OVN_MODE), True) | ||
build: eaa interfaceservice edgedns | ||
else | ||
build: edalibs appliance eaa edgedns nts | ||
endif | ||
clean: | ||
rm -rf ./dist | ||
$(MAKE) clean -C internal/nts | ||
$(MAKE) clean -C internal/nts/eda_libs | ||
|
||
lint: edalibs | ||
golangci-lint run --build-tags=nts | ||
golangci-lint run --build-tags=cni | ||
|
||
test: edalibs | ||
http_proxy= https_proxy= HTTP_PROXY= HTTPS_PROXY= ginkgo -v -r --randomizeSuites --failOnPending --skipPackage=vendor,edants,wrappers,stubs | ||
|
||
appliance-nts: edalibs | ||
$(MAKE) appliance APPLIANCE_MODE=nts | ||
|
||
appliance-cni: | ||
$(MAKE) appliance APPLIANCE_MODE=cni | ||
|
||
APPLIANCE_MODE ?= nts | ||
appliance: | ||
mkdir -p "${BUILD_DIR}" | ||
GOOS=linux go build -o "${BUILD_DIR}/appliance" ./cmd/appliance | ||
GOOS=linux go build -tags ${APPLIANCE_MODE} -o ./dist/$@/$@ ./cmd/$@ | ||
ifndef SKIP_DOCKER_IMAGES | ||
cp ${RTE_SDK}/usertools/dpdk-devbind.py ./dist/$@/ | ||
VER=${VER} docker-compose build $@ | ||
endif | ||
|
||
eaa: | ||
mkdir -p "${BUILD_DIR}" | ||
GOOS=linux go build -o "${BUILD_DIR}/eaa" ./cmd/eaa | ||
GOOS=linux go build -o ./dist/$@/$@ ./cmd/$@ | ||
ifndef SKIP_DOCKER_IMAGES | ||
VER=${VER} docker-compose build $@ | ||
endif | ||
|
||
interfaceservice: | ||
mkdir -p "${BUILD_DIR}" | ||
GOOS=linux go build -o "${BUILD_DIR}/interfaceservice" ./cmd/interfaceservice | ||
GOOS=linux go build -o ./dist/$@/$@ ./cmd/$@ | ||
ifndef SKIP_DOCKER_IMAGES | ||
# This 'hack' will enable building without DPDK - ./dpdk-devbind.py will be copied if existing | ||
# but will also not fail if file will be not available | ||
-cp ${RTE_SDK}/usertools/dpdk-devbind.py ./dist/$@/ | ||
VER=${VER} docker-compose build $@ | ||
endif | ||
|
||
edgedns: | ||
mkdir -p "${BUILD_DIR}" | ||
GOOS=linux go build -a --ldflags '-extldflags "-static"' -tags netgo -installsuffix netgo -o "${BUILD_DIR}/edgednssvr" ./cmd/edgednssvr | ||
edgednssvr: | ||
GOOS=linux go build -a --ldflags '-extldflags "-static"' -tags netgo -installsuffix netgo -o ./dist/$@/$@ ./cmd/$@ | ||
ifndef SKIP_DOCKER_IMAGES | ||
VER=${VER} docker-compose build $@ | ||
endif | ||
|
||
syslog-ng: | ||
ifndef SKIP_DOCKER_IMAGES | ||
VER=${VER} docker-compose build $@ | ||
endif | ||
|
||
nts: | ||
make -C internal/nts | ||
$(MAKE) -C internal/nts | ||
ifndef SKIP_DOCKER_IMAGES | ||
VER=${VER} docker-compose build $@ | ||
endif | ||
|
||
edalibs: | ||
make -C internal/nts/eda_libs | ||
$(MAKE) -C internal/nts/eda_libs | ||
|
||
hddllog: | ||
mkdir -p "${BUILD_DIR}" | ||
GOOS=linux go build -o "${BUILD_DIR}/hddllog" ./cmd/hddllog | ||
ovncni: | ||
GOOS=linux go build -o ./dist/$@/$@ ./cmd/$@ | ||
|
||
clean: | ||
rm -rf "${BUILD_DIR}" | ||
make clean -C internal/nts | ||
make clean -C internal/nts/eda_libs | ||
|
||
build-docker: build | ||
cp docker-compose.yml "${TMP_DIR}" | ||
cp build/eaa/Dockerfile "${TMP_DIR}/Dockerfile_eaa" | ||
cp build/eaa/entrypoint_eaa.sh "${TMP_DIR}" | ||
cp "${BUILD_DIR}/eaa" "${TMP_DIR}" | ||
cp build/edgednssvr/Dockerfile "${TMP_DIR}/Dockerfile_edgednssvr" | ||
cp "${BUILD_DIR}/edgednssvr" "${TMP_DIR}" | ||
ifeq ($(KUBE_OVN_MODE), True) | ||
cp build/interfaceservice/Dockerfile "${TMP_DIR}/Dockerfile_interfaceservice" | ||
cp build/interfaceservice/entrypoint_interfaceservice.sh "${TMP_DIR}" | ||
cp "${BUILD_DIR}/interfaceservice" "${TMP_DIR}" | ||
cd "${TMP_DIR}" && VER=${VER} docker-compose build eaa interfaceservice edgednssvr syslog-ng | ||
else | ||
cp build/appliance/Dockerfile "${TMP_DIR}/Dockerfile_appliance" | ||
cp build/appliance/entrypoint.sh "${TMP_DIR}" | ||
cp /opt/dpdk-18.11.2/usertools/dpdk-devbind.py "${TMP_DIR}" | ||
cp "${BUILD_DIR}/appliance" "${TMP_DIR}" | ||
mkdir -p "${TMP_DIR}/nts" | ||
cp internal/nts/build/nes-daemon "${TMP_DIR}/nts" | ||
cp internal/nts/kni_docker_daemon.py "${TMP_DIR}/nts" | ||
cp internal/nts/ovs_docker_daemon.py "${TMP_DIR}/nts" | ||
cp internal/nts/entrypoint.sh "${TMP_DIR}/nts" | ||
cp internal/nts/build/libnes_api_shared.so "${TMP_DIR}/nts" | ||
cp internal/nts/Dockerfile "${TMP_DIR}/Dockerfile_nts" | ||
cd "${TMP_DIR}" && VER=${VER} docker-compose build appliance nts eaa edgednssvr syslog-ng | ||
endif | ||
ls "${TMP_DIR}" | ||
rm -rf "${TMP_DIR}" | ||
|
||
build-docker-hddl: hddllog | ||
cp build/hddlservice/Dockerfile "${TMP_DIR}/Dockerfile_hddlservice" | ||
cp build/hddlservice/start.sh "${TMP_DIR}" | ||
cp build/hddlservice/docker-compose.yml "${TMP_DIR}" | ||
cp "${BUILD_DIR}/hddllog" "${TMP_DIR}" | ||
cd "${TMP_DIR}" && VER=${VER} docker-compose build | ||
ls "${TMP_DIR}" | ||
rm -rf "${TMP_DIR}" | ||
|
||
build-docker-biosfw: | ||
cp build/biosfw/Dockerfile "${TMP_DIR}/Dockerfile_biosfw" | ||
cp build/biosfw/biosfw.sh "${TMP_DIR}" | ||
cp build/biosfw/syscfg_package.zip "${TMP_DIR}" | ||
cd "${TMP_DIR}" && docker build -t openness-biosfw -f Dockerfile_biosfw . | ||
rm -rf "${TMP_DIR}" | ||
|
||
build-docker-fpga-cfg: | ||
cp build/fpga_config/Dockerfile "${TMP_DIR}/Dockerfile_fpga" | ||
cp -r build/fpga_config/bbdev_config_service "${TMP_DIR}" | ||
cd "${TMP_DIR}" && docker build -t fpga-config-utility:1.0 -f Dockerfile_fpga . | ||
rm -rf "${TMP_DIR}" | ||
|
||
build-docker-fpga-opae: | ||
cp build/fpga_opae/Dockerfile "${TMP_DIR}/Dockerfile_opae" | ||
cp -r build/fpga_opae/n3000-1-3-5-beta-cfg-2x2x25g-setup.zip "${TMP_DIR}" | ||
cp -r build/fpga_opae/n3000-1-3-5-beta-rte-setup.zip "${TMP_DIR}" | ||
cp -r build/fpga_opae/expect_script.sh "${TMP_DIR}" | ||
cp -r build/fpga_opae/check_if_modules_loaded.sh "${TMP_DIR}" | ||
cd "${TMP_DIR}" && docker build -t fpga-opae-pacn3000:1.0 -f Dockerfile_opae . | ||
rm -rf "${TMP_DIR}" | ||
|
||
run-docker: | ||
ifeq ($(KUBE_OVN_MODE), False) | ||
VER=${VER} docker-compose up appliance nts eaa edgednssvr syslog-ng --no-build | ||
hddllog: | ||
GOOS=linux go build -o ./dist/hddlservice/$@ ./cmd/$@ | ||
ifndef SKIP_DOCKER_IMAGES | ||
VER=${VER} docker-compose -f dist/hddlservice/docker-compose.yml build | ||
endif | ||
|
||
lint: edalibs | ||
golangci-lint run | ||
biosfw: | ||
docker build -t openness-$@ -f ./dist/$@/Dockerfile ./dist/$@/ | ||
|
||
test: edalibs | ||
http_proxy= https_proxy= HTTP_PROXY= HTTPS_PROXY= ginkgo -v -r --randomizeSuites --failOnPending --skipPackage=vendor,edants,wrappers,stubs | ||
fpga-cfg: | ||
docker build -t fpga-config-utility:1.0 -f ./dist/fpga_config/Dockerfile ./dist/fpga_config/ | ||
|
||
help: | ||
@echo "Please use \`make <target>\` where <target> is one of" | ||
@echo " build to build the appliance application, EAA, edgedns server and NTS" | ||
@echo " appliance to build the appliance application" | ||
@echo " interfaceservice to build the interfaceservice" | ||
@echo " eaa to build the EAA" | ||
@echo " edgedns to build the edgedns server" | ||
@echo " nts to build the NTS" | ||
@echo " hddllog to build the log supporting hddl service" | ||
@echo " clean to clean up build artifacts and docker" | ||
@echo " build-docker to build the release docker image" | ||
@echo " build-docker-hddl to build optional docker image for hddl-service" | ||
@echo " build-docker-biosfw to build optional docker image for biosfw feature" | ||
@echo " build-docker-fpga-cfg to build optional docker image for bbdev configuration utility" | ||
@echo " build-docker-fpga-opae to build optional docker image for opae" | ||
@echo " run-docker to start containers" | ||
@echo " lint to run linters and static analysis on the code" | ||
@echo " test to run unit tests" | ||
fpga-opae: | ||
docker build -t fpga-opae-pacn3000:1.0 -f ./dist/fpga_opae/Dockerfile ./dist/fpga_opae/ | ||
|
||
build: | ||
$(MAKE) SKIP_DOCKER_IMAGES=1 common-services appliance-nts edalibs nts interfaceservice | ||
|
||
pull-syslog: | ||
docker-compose pull --quiet syslog-ng |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.