Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/160 fmuproxy integration #162

Merged
merged 83 commits into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
79c4384
Add thrift and explicit openssl dependency
Jan 29, 2019
738ebfe
Add find_package(Thrift)
Jan 29, 2019
df4c839
Add auto-generated thrift classes
Jan 29, 2019
1909809
Basic fmu-proxy implementation in place
Jan 30, 2019
71be466
Merge remote-tracking branch 'origin/master' into feature/160-fmuprox…
Jan 30, 2019
7d9739c
Fix warning about NOMINMAX macro redefinition
Jan 30, 2019
f213e03
Remember to open transport!
Jan 30, 2019
1dc70b5
Add fmuproxy_test
Jan 30, 2019
e01fab7
Update fmuproxy_test
Jan 30, 2019
3c0d50f
Make fmuproxy integration optional
Jan 30, 2019
cd0cd19
Cleanup
Jan 30, 2019
7b064b5
Add error handling
Jan 30, 2019
f423673
Implement get and set variables
Jan 30, 2019
f855566
Update fmuproxy_test
Jan 30, 2019
76de2da
Fix getType not always returning the correct type
Jan 31, 2019
e931387
Merge remote-tracking branch 'origin/master' into feature/160-fmuprox…
Jan 31, 2019
5dce31e
Add missing fmuproxy headers
Feb 1, 2019
c1b87a7
Fix compile under gcc
markaren Feb 5, 2019
a911b17
Update test
markaren Feb 5, 2019
22cbed2
Add concurrency support and misc refactor
Feb 6, 2019
c9fd2c0
Make using the concurrent client optional
Feb 6, 2019
fbfafc1
Add sanity checks. See #166
Feb 6, 2019
23f4762
Update fmuproxy_test
Feb 6, 2019
ea14b57
Add conan remote for thrift
Feb 6, 2019
b1173dd
Suppress warning C4245
Feb 6, 2019
44e57c9
Only include thread test on Windows and use program arguments
Feb 6, 2019
df18633
Add conan remote also for linux build
Feb 6, 2019
99e5ad7
Update FindThrift
markaren Feb 7, 2019
abe6064
Fix slaves not being terminated using execution API
markaren Feb 7, 2019
98ed327
Merge branch 'feature/160-fmuproxy-integration' of github.com:open-si…
markaren Feb 7, 2019
214b16e
Merge remote-tracking branch 'origin/master' into feature/160-fmuprox…
markaren Feb 7, 2019
72b800b
Let the destructor call terminate on slave instance
markaren Feb 7, 2019
a93d4a5
Try fix jenkins error
markaren Feb 7, 2019
22348d2
Try fix jenkins error attempt 2
markaren Feb 7, 2019
d29dcd0
explicitly set terminated_ to false
markaren Feb 8, 2019
86218a4
Link pthread on linux
markaren Feb 8, 2019
b06ae5b
Using chrono to measure time
markaren Feb 8, 2019
50934c6
Fix MSCV warning about shadowing and cleanup
markaren Feb 8, 2019
e6d0521
Fix wrong header search path
markaren Feb 8, 2019
c6a6708
Add missing guard
markaren Feb 8, 2019
a9d54f8
Fix serial test reusing (and incrementing!) startTime
markaren Feb 8, 2019
523c107
Cleanup fmuproxy_test
markaren Feb 9, 2019
a1fde04
implement client-side load(url)
markaren Feb 11, 2019
6943a39
remove unused header
markaren Feb 11, 2019
57a179e
Merge remote-tracking branch 'origin/master' into feature/160-fmuprox…
markaren Feb 11, 2019
7e26b50
fix merge with master
markaren Feb 11, 2019
a20d82d
remove unnecessary linking
markaren Feb 11, 2019
0d67ace
use make_background_slave
markaren Feb 11, 2019
3e9e020
switch to binary protocol (from compact)
markaren Feb 11, 2019
f272f95
Only supress C4245 with fmuproxy and supress C4706 as well
markaren Feb 11, 2019
97b1d65
Fix unused parameter warning and apply clang-tidy suggestions
markaren Feb 11, 2019
33e836a
Remove -DNOMINMAX definitions
markaren Feb 11, 2019
d497ce5
Fix redefinition warning for NOMINMAX macro
markaren Feb 11, 2019
16f3257
Make sure header guards are and will be unique in the future
markaren Feb 11, 2019
46d2ea4
Refactor
markaren Feb 11, 2019
d6cf5c1
Improve header guards
markaren Feb 12, 2019
625809a
Refactor
markaren Feb 12, 2019
88c1944
make sure slaves are terminated
markaren Feb 12, 2019
003ecbe
make sure test setups are comparable
markaren Feb 12, 2019
4b6102a
Fix recursive call
markaren Feb 12, 2019
47a76a2
Fix winsock issue on windows
markaren Feb 12, 2019
20744ac
Load test fmu from URL
markaren Feb 12, 2019
06ca685
Fix serial test appending time
markaren Feb 12, 2019
6dee55c
Merge remote-tracking branch 'origin/master' into feature/160-fmuprox…
markaren Feb 20, 2019
0a36f63
Make fmuproxy a conan option
markaren Feb 21, 2019
3212314
Merge remote-tracking branch 'origin/master' into feature/160-fmuprox…
Feb 27, 2019
35436a3
Update auto-generated thrift files
Feb 27, 2019
7f1bb2f
Update auto-generated thrift files
Feb 27, 2019
8e3724a
Update thrift helper
Feb 27, 2019
2b97735
Fix step no longer takes any arguments
Feb 27, 2019
daf2762
Merge remote-tracking branch 'origin/master' into feature/160-fmuprox…
Mar 2, 2019
08e5831
Update thrift generated files, and implement from_file
Mar 2, 2019
f170655
Formatted with ClangFormat. Skipped @generated files.
Mar 20, 2019
be462e2
empty string -> default value and snake_case
markaren Mar 20, 2019
8f389ea
snake_case and fix -werror unused variable
markaren Mar 20, 2019
50ea538
Merge branch 'master' into feature/160-fmuproxy-integration
markaren Mar 25, 2019
4be103f
snake_case
markaren Mar 25, 2019
2ab7c15
fix indentation
markaren Mar 25, 2019
ac37b29
Build fmuproxy with jenkins
markaren Mar 25, 2019
90a3c04
Merge remote-tracking branch 'origin/master' into feature/160-fmuprox…
markaren Apr 22, 2019
adbff55
find thrift debug library
markaren Apr 22, 2019
459d0e5
update thrift generated sources
markaren Apr 22, 2019
da4818e
Must use different build folder because of parallel builds
Apr 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ option(CSECORE_BUILD_APIDOC "Build API documentation" ON)
option(CSECORE_BUILD_PRIVATE_APIDOC "Build private API documentation" OFF)
option(CSECORE_STANDALONE_INSTALLATION "Whether to build for a standalone installation (Linux only; sets a relative RPATH)" OFF)
option(CSECORE_USING_CONAN "Whether Conan is used for package management" OFF)
option(CSECORE_WITH_FMUPROXY "Whether or not to build with fmuproxy integration" OFF)

# ==============================================================================
# Global internal configuration
Expand Down Expand Up @@ -67,6 +68,12 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# should not be a problem, so we disable the warning.
add_compile_options("/wd4251")
endif()
if (CSECORE_WITH_FMUPROXY)
#warning C4245: 'return': conversion from 'int' to 'SOCKET', signed/unsigned mismatch
add_compile_options("/wd4245")
#warning C4706: assignment within conditional expression
add_compile_options("/wd4706")
endif()
add_definitions("-D_SCL_SECURE_NO_WARNINGS" "-D_CRT_SECURE_NO_WARNINGS")
endif()

Expand Down Expand Up @@ -115,6 +122,9 @@ find_package(Boost REQUIRED COMPONENTS ${Boost_components})
find_package(FMILibrary REQUIRED)
find_package(LIBZIP REQUIRED)
find_package(nlohmann_json REQUIRED)
if(CSECORE_WITH_FMUPROXY)
find_package(Thrift REQUIRED)
endif()

# ==============================================================================
# Targets
Expand Down
66 changes: 65 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pipeline {
stage('Configure Conan') {
steps {
sh 'conan remote add osp https://osp-conan.azurewebsites.net/artifactory/api/conan/conan-local --force'
sh 'conan remote add helmesjo https://api.bintray.com/conan/helmesjo/public-conan --force'
sh 'conan user -p $OSP_CONAN_CREDS_PSW -r osp $OSP_CONAN_CREDS_USR'
}
}
Expand Down Expand Up @@ -104,6 +105,34 @@ pipeline {
}
}
}
stage('Build on Windows with FMU-proxy support') {
agent { label 'windows' }

environment {
CONAN_USER_HOME = "${env.BASE}\\conan-repositories\\${env.EXECUTOR_NUMBER}"
CONAN_USER_HOME_SHORT = "${env.CONAN_USER_HOME}"
OSP_CONAN_CREDS = credentials('jenkins-osp-conan-creds')
CSE_CONAN_CHANNEL = "${env.BRANCH_NAME}".replaceAll("/", "_")
}

stages {
stage('Configure Conan') {
steps {
sh 'conan remote add osp https://osp-conan.azurewebsites.net/artifactory/api/conan/conan-local --force'
sh 'conan remote add helmesjo https://api.bintray.com/conan/helmesjo/public-conan --force'
sh 'conan user -p $OSP_CONAN_CREDS_PSW -r osp $OSP_CONAN_CREDS_USR'
}
}
stage('Build Release') {
steps {
dir('release-build-fmuproxy') {
bat 'conan install ../cse-core -s build_type=Release -o fmuproxy=True -b missing'
bat 'conan package ../cse-core -pf package/windows/release'
}
}
}
}
}
stage ( 'Build on Linux with Conan' ) {
agent {
dockerfile {
Expand All @@ -125,6 +154,7 @@ pipeline {
stage('Configure Conan') {
steps {
sh 'conan remote add osp https://osp-conan.azurewebsites.net/artifactory/api/conan/conan-local --force'
sh 'conan remote add helmesjo https://api.bintray.com/conan/helmesjo/public-conan --force'
sh 'conan user -p $OSP_CONAN_CREDS_PSW -r osp $OSP_CONAN_CREDS_USR'
}
}
Expand Down Expand Up @@ -175,7 +205,6 @@ pipeline {
}
}
}

stage ('Test Release') {
steps {
dir('release-build-conan') {
Expand Down Expand Up @@ -209,6 +238,41 @@ pipeline {
}
}
}
stage ( 'Build on Linux with Conan & FMU-proxy support' ) {
agent {
dockerfile {
filename 'Dockerfile.conan-build'
dir 'cse-core/.dockerfiles'
label 'linux && docker'
args '-v ${HOME}/jenkins_slave/conan-repositories/${EXECUTOR_NUMBER}:/conan_repo'
}
}

environment {
CONAN_USER_HOME = '/conan_repo'
CONAN_USER_HOME_SHORT = 'None'
OSP_CONAN_CREDS = credentials('jenkins-osp-conan-creds')
CSE_CONAN_CHANNEL = "${env.BRANCH_NAME}".replaceAll("/", "_")
}

stages {
stage('Configure Conan') {
steps {
sh 'conan remote add osp https://osp-conan.azurewebsites.net/artifactory/api/conan/conan-local --force'
sh 'conan remote add helmesjo https://api.bintray.com/conan/helmesjo/public-conan --force'
sh 'conan user -p $OSP_CONAN_CREDS_PSW -r osp $OSP_CONAN_CREDS_USR'
}
}
stage('Build Release') {
steps {
dir('release-build-conan-fmuproxy') {
sh 'conan install ../cse-core -s compiler.libcxx=libstdc++11 -s build_type=Release -o fmuproxy=True -b missing'
sh 'conan package ../cse-core -pf package/linux/release'
}
}
}
}
}
stage ( 'Build on Linux with Docker' ) {
agent {
dockerfile {
Expand Down
36 changes: 36 additions & 0 deletions cmake/FindThrift.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Find Thrift
#
# Find the native Thrift headers and libraries.
#
# THRIFT_INCLUDE_DIRS - where to find thrift/thrift.h
# THRIFT_LIBRARIES - List of libraries when using Thrift.
# THRIFT_FOUND - True if Thrift found.
#

find_path(THRIFT_INCLUDE_DIR NAMES thrift/Thrift.h)
mark_as_advanced(THRIFT_INCLUDE_DIR)

find_library(THRIFT_LIBRARY NAMES thrift thriftmd thriftmdd)
mark_as_advanced(THRIFT_LIBRARY)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(THRIFT
REQUIRED_VARS THRIFT_LIBRARY THRIFT_INCLUDE_DIR)

if (THRIFT_FOUND)

set(THRIFT_INCLUDE_DIRS ${THRIFT_INCLUDE_DIR})

if (NOT THRIFT_LIBRARIES)
set(THRIFT_LIBRARIES ${THRIFT_LIBRARY})
endif()

if (NOT TARGET thrift::thrift)
add_library(thrift::thrift UNKNOWN IMPORTED)
set_target_properties(thrift::thrift PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${THRIFT_INCLUDE_DIR}")
set_property(TARGET thrift::thrift APPEND PROPERTY
IMPORTED_LOCATION "${THRIFT_LIBRARY}")
endif()

endif()
11 changes: 10 additions & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ class CSECoreConan(ConanFile):
"jsonformoderncpp/3.5.0@vthiery/stable"
)

options = {"fmuproxy": [True, False]}
default_options = (
"fmuproxy=False",
"boost:shared=True",
"libzip:shared=True"
)
Expand All @@ -32,12 +34,19 @@ def imports(self):
self.copy("*.dll", dst=binDir, keep_path=False)
self.copy("*.pdb", dst=binDir, keep_path=False)

def requirements(self):
if self.options.fmuproxy:
self.requires("OpenSSL/1.0.2o@conan/stable")
self.requires("thrift/0.12.0@helmesjo/stable")

def configure_cmake(self):
cmake = CMake(self)
cmake.parallel = False # Needed to keep stable build on Jenkins Windows Node
cmake.definitions["CSECORE_USING_CONAN"] = "ON"
if self.settings.build_type == "Debug":
cmake.definitions["CSECORE_BUILD_PRIVATE_APIDOC"] = "ON"
if self.options.fmuproxy:
cmake.definitions["CSECORE_WITH_FMUPROXY"] = "ON"
cmake.configure()
return cmake

Expand All @@ -51,4 +60,4 @@ def package(self):
cmake = self.configure_cmake()
self.run('cmake --build %s --target install-doc' % (self.build_folder))
cmake.install()

Loading