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

Migrate build tasks to gradle #6

Merged
merged 28 commits into from
Mar 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
bbf2495
Initializing gradle
markusthoemmes Feb 22, 2016
8c81fb1
Cleaning up common, adding gitignores
markusthoemmes Feb 22, 2016
fabd985
Moving controller to gradle
markusthoemmes Feb 22, 2016
85f8d2c
Moving over dispatcher to gradle
markusthoemmes Feb 22, 2016
2f382cd
Moving over loadbalancer to gradle
markusthoemmes Feb 22, 2016
4cdbeb1
Moving services over to gradle
markusthoemmes Feb 22, 2016
395e429
Moving action containers over to gradle
markusthoemmes Feb 22, 2016
f310267
Moving over tests and allow deployment using ant
markusthoemmes Feb 22, 2016
dbe2445
including cleanup tasks for the build, stripping out build tasks of ant
fxulusoy Feb 23, 2016
9b24580
Optional pushImage tag is added.
fxulusoy Feb 29, 2016
bafb486
cleanup gradle build files, integrate gradle tasks with ant for inter…
markusthoemmes Mar 10, 2016
398e39b
Remove vi notation
markusthoemmes Mar 11, 2016
2b6cf18
Skip automatic gradle execution
markusthoemmes Mar 11, 2016
a7e7bcd
make tests depend on keystore creation
markusthoemmes Mar 11, 2016
885491e
Put keystore creation in correct order, remove keystore creation from…
markusthoemmes Mar 11, 2016
acac1b6
missed createTrustStore call deleted
markusthoemmes Mar 11, 2016
9d41b9a
cleanup, factoring tagImage tag out of distDocker, using gradlew
markusthoemmes Mar 11, 2016
989dbcc
strip push of images from ant build
markusthoemmes Mar 11, 2016
779647b
adding -f option to tagImage so old tags are overridden
markusthoemmes Mar 11, 2016
d0c1bc2
dont tag image while being build
markusthoemmes Mar 11, 2016
0d5185a
adding missed files
markusthoemmes Mar 11, 2016
28d958d
Better logging for testruns using gradle
markusthoemmes Mar 12, 2016
ab9667c
Update nodejsAction Dockerfile, fix location of keystore
markusthoemmes Mar 14, 2016
71351ef
remove obsolete push tasks
Mar 15, 2016
304eb8f
remove obsolete common js. replay kafka 0.9 update.
Mar 15, 2016
ef0c026
ignore KafkaTests until intermittent failures are resolved
Mar 15, 2016
8a1774e
Setting heapsize for controller, rebuilt old startscripts for scala c…
markusthoemmes Mar 15, 2016
f41b979
Adjusting common/scala to comply with gradle build best-practices
markusthoemmes Mar 16, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ nginx.conf
/config/custom-config.xml
cloudant-local.env
results
.gradle
51 changes: 7 additions & 44 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
<!-- vim: set expandtab ts=4 sw=4 : -->
<project>
<import file="config/config.xml" />
<import file="common/build.xml" />

<!-- clean temporary build files created by build script -->
<target name="dust">
<exec executable="/bin/date" />
<delete dir="${docker.scratch}" />
<delete dir="${build.dir}" />
<delete dir="results" />
<delete dir="logs" />
<delete failonerror="false">
<fileset dir="." includes="**/*.pyc" />
Expand All @@ -17,16 +12,6 @@
</delete>
</target>

<!-- clean all bin directories also out of paranoia; no bin directory outside of the ${build.dir} is created by the build script -->
<!-- if you develop with eclipse you should not call this target; if you do, refresh your eclipse workspace to rebuild. -->
<target name="scrub" depends="dust">
<delete dir="tests/bin" />
<delete dir="core/controller/bin" />
<delete dir="core/dispatcher/bin" />
<delete dir="core/loadBalancer/bin" />
<delete dir="common/scala/bin" />
</target>

<!-- scan the code base, checking some conventions that are enforced -->
<target name="scanCode">
<exec executable="/bin/bash" failonerror="true">
Expand All @@ -38,20 +23,14 @@
<target name="clean" depends="dust,teardown">
</target>

<!-- compile and build images and tests -->
<!-- compile and build images -->
<target name="build" depends="writePropertyFile">
<parallel threadCount="${buildthreads}" failonany="true">
<ant target="scanCode" />
<ant antfile="common/build.xml" target="build" />
</parallel>
<parallel threadCount="${buildthreads}" failonany="true">
<ant antfile="services/build.xml" target="build" />
<ant antfile="core/build.xml" target="build" />
</parallel>
<var file="whisk.properties" />
<ant target="scanCode" />
<exec executable="./gradlew" failonerror="true">
<arg value="distDocker" />
</exec>
<ant antfile="${openwhisk.dir}/services/nginx/build.xml" target="buildProxy" />
<ant antfile="tests/build.xml" target="build" />
<ant antfile="tools/cli/build.xml" target="buildCLI" />
<antcall target="createTrustStore" />
</target>

<!-- run unit tests-->
Expand All @@ -65,18 +44,13 @@
<ant antfile="${openwhisk.dir}/services/nginx/build.xml" target="startProxy" />
<ant antfile="services/build.xml" target="deploy" />
<ant antfile="core/build.xml" target="deploy" />
<ant antfile="tools/cli/build.xml" target="buildCLI" />
<antcall target="installCatalog" />
</target>

<!-- teardown and deploy all services -->
<target name="redeploy" depends="teardown,deploy" />

<!-- push containers -->
<target name="push" depends="writePropertyFile">
<ant antfile="services/build.xml" target="push" />
<ant antfile="core/build.xml" target="push" />
</target>

<target name="teardownLocal">
<exec executable="/bin/bash">
<arg value="tools/docker/cleanDocker.sh" />
Expand Down Expand Up @@ -123,17 +97,6 @@
</exec>
</target>

<!-- Create a trust store for use during testing -->
<target name="createTrustStore">
<var file="whisk.properties" />
<delete file="${build.dir}/tests/keystore" quiet="true" />
<exec executable="keytool" failonerror="true">
<arg line="-import -alias Whisk -noprompt -trustcacerts" />
<arg line="-file ${whisk.ssl.cert}" />
<arg line="-keystore ${build.dir}/tests/keystore -storepass '${whisk.ssl.challenge}'" />
</exec>
</target>

<!-- fetch the docker logs from all local containers to ./logs on this host -->
<target name="copyOutLogs">
<var file="whisk.properties" />
Expand Down
17 changes: 0 additions & 17 deletions common/js/.project

This file was deleted.

40 changes: 0 additions & 40 deletions common/js/Dockerfile

This file was deleted.

11 changes: 0 additions & 11 deletions common/libs/.project

This file was deleted.

Binary file removed common/libs/common/cloudant-client-1.0.1.jar
Binary file not shown.
Binary file removed common/libs/common/commons-codec-1.9.jar
Binary file not shown.
Binary file removed common/libs/common/commons-io-2.4.jar
Binary file not shown.
Binary file removed common/libs/common/commons-logging-1.2.jar
Binary file not shown.
Binary file not shown.
Binary file removed common/libs/common/gson-2.3.1.jar
Binary file not shown.
Binary file removed common/libs/common/httpclient-4.4.1.jar
Binary file not shown.
Binary file removed common/libs/common/httpcore-4.4.1.jar
Binary file not shown.
Binary file removed common/libs/common/kafka-clients-0.9.0.0.jar
Binary file not shown.
Binary file removed common/libs/common/log4j-1.2.16.jar
Binary file not shown.
Binary file removed common/libs/common/messagehub.login-1.0.0.jar
Binary file not shown.
Binary file removed common/libs/common/metrics-core-2.2.0.jar
Binary file not shown.
Binary file removed common/libs/common/scala-library-2.11.6.jar
Binary file not shown.
Binary file not shown.
Binary file removed common/libs/common/scala-xml_2.11-1.0.3.jar
Binary file not shown.
Binary file removed common/libs/common/slf4j-api-1.7.6.jar
Binary file not shown.
Binary file removed common/libs/common/slf4j-log4j12-1.6.1.jar
Binary file not shown.
Binary file removed common/libs/common/zkclient-0.3.jar
Binary file not shown.
Binary file removed common/libs/common/zookeeper-3.4.6.jar
Binary file not shown.
Binary file removed common/libs/spray/akka-actor_2.11-2.3.9.jar
Binary file not shown.
Binary file removed common/libs/spray/akka-slf4j_2.11-2.3.9.jar
Binary file not shown.
Binary file removed common/libs/spray/apache-log4j-extras-1.2.17.jar
Binary file not shown.
Binary file removed common/libs/spray/config-1.2.1.jar
Binary file not shown.
Binary file removed common/libs/spray/mimepull-1.9.5.jar
Binary file not shown.
Binary file removed common/libs/spray/parboiled-core-1.1.7.jar
Binary file not shown.
Binary file removed common/libs/spray/parboiled-scala_2.11-1.1.7.jar
Binary file not shown.
Binary file removed common/libs/spray/shapeless_2.11-1.2.4.jar
Binary file not shown.
Binary file removed common/libs/spray/spray-caching_2.11-1.3.3.jar
Binary file not shown.
Binary file removed common/libs/spray/spray-can_2.11-1.3.3.jar
Binary file not shown.
Binary file removed common/libs/spray/spray-client-1.3.1.jar
Binary file not shown.
Binary file removed common/libs/spray/spray-http_2.11-1.3.3.jar
Binary file not shown.
Binary file removed common/libs/spray/spray-httpx_2.11-1.3.3.jar
Binary file not shown.
Binary file removed common/libs/spray/spray-io_2.11-1.3.3.jar
Binary file not shown.
Binary file removed common/libs/spray/spray-json_2.11-1.3.2.jar
Binary file not shown.
Binary file removed common/libs/spray/spray-routing_2.11-1.3.3.jar
Binary file not shown.
Binary file removed common/libs/spray/spray-util_2.11-1.3.3.jar
Binary file not shown.
Binary file removed common/libs/testing/commons-exec-1.1.jar
Binary file not shown.
Binary file removed common/libs/testing/commons-lang3-3.3.2.jar
Binary file not shown.
Binary file removed common/libs/testing/commons-logging-1.1.3.jar
Binary file not shown.
Binary file removed common/libs/testing/groovy-2.4.3.jar
Binary file not shown.
Binary file removed common/libs/testing/groovy-json-2.4.3.jar
Binary file not shown.
Binary file removed common/libs/testing/groovy-xml-2.4.3.jar
Binary file not shown.
Binary file removed common/libs/testing/guava-18.0.jar
Binary file not shown.
Binary file removed common/libs/testing/hamcrest-core-1.3.jar
Binary file not shown.
Binary file removed common/libs/testing/httpmime-4.3.6.jar
Binary file not shown.
Binary file removed common/libs/testing/junit-4.11.jar
Binary file not shown.
Binary file removed common/libs/testing/rest-assured-2.4.1.jar
Binary file not shown.
Binary file removed common/libs/testing/scalatest_2.11-2.2.4.jar
Binary file not shown.
Binary file removed common/libs/testing/selenium-java-2.45.0.jar
Binary file not shown.
Binary file removed common/libs/testing/spray-testkit_2.11-1.3.3.jar
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions common/scala/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/bin/
/build/
.cache-main
47 changes: 47 additions & 0 deletions common/scala/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apply plugin: 'scala'

repositories {
mavenCentral()
}

sourceSets {
main {
scala {
srcDirs = ['src/']
}
resources {
srcDirs = ['src/']
}
}
}

dependencies {
compile 'org.scala-lang:scala-library:2.11.1'

compile 'io.spray:spray-caching_2.11:1.3.3'
compile 'io.spray:spray-json_2.11:1.3.2'
compile 'io.spray:spray-can_2.11:1.3.3'
compile 'io.spray:spray-client:1.3.1'
compile 'io.spray:spray-httpx_2.11:1.3.3'
compile 'io.spray:spray-io_2.11:1.3.3'
compile 'io.spray:spray-routing_2.11:1.3.3'

compile 'com.typesafe.akka:akka-actor_2.11:2.3.9'
compile 'com.typesafe.akka:akka-slf4j_2.11:2.3.9'

compile 'com.cloudant:cloudant-client:1.0.1'

compile 'log4j:log4j:1.2.16'
compile 'commons-codec:commons-codec:1.9'
compile 'commons-io:commons-io:2.4'
compile 'commons-logging:commons-logging:1.2'
compile 'org.apache.zookeeper:zookeeper:3.4.6'
compile 'org.apache.kafka:kafka-clients:0.9.0.0'
compile 'com.google.code.gson:gson:2.3.1'
compile 'org.apache.httpcomponents:httpclient:4.4.1'
}

def dockerImageName = project.name
task distDocker(type:Exec) {
commandLine 'docker', 'build', '-t', 'whisk/' + dockerImageName, '.'
}
21 changes: 0 additions & 21 deletions core/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,6 @@
<import file="../config/config.xml" />
<import file="../docker.xml" />

<!-- build all components in the whisk core in parallel -->
<target name="build" >
<parallel threadCount="${buildthreads}" failonany="true">
<ant antfile="${openwhisk.dir}/core/nodejsAction/build.xml" target="buildNodeJsAction" />
<ant antfile="${openwhisk.dir}/core/swiftAction/build.xml" target="buildSwiftAction" />
<ant antfile="${openwhisk.dir}/core/loadBalancer/build.xml" target="buildLoadBalancer" />
<ant antfile="${openwhisk.dir}/core/dispatcher/build.xml" target="buildDispatcher" />
<ant antfile="${openwhisk.dir}/core/controller/build.xml" target="buildController" />
</parallel>
</target>

<target name="push" >
<parallel threadCount="${pushthreads}" failonany="true">
<ant antfile="${openwhisk.dir}/core/nodejsAction/build.xml" target="pushNodeJsAction" />
<ant antfile="${openwhisk.dir}/core/swiftAction/build.xml" target="pushSwiftAction" />
<ant antfile="${openwhisk.dir}/core/loadBalancer/build.xml" target="pushLoadBalancer" />
<ant antfile="${openwhisk.dir}/core/dispatcher/build.xml" target="pushDispatcher" />
<ant antfile="${openwhisk.dir}/core/controller/build.xml" target="pushController" />
</parallel>
</target>

<!-- deploy all components in the whisk core in parallel -->
<target name="deploy" >
<parallel threadCount="${deploythreads}" failonany="true">
Expand Down
1 change: 1 addition & 0 deletions core/controller/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/bin/
/build/
.cache-main
7 changes: 3 additions & 4 deletions core/controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ Run wget https://github.com/swagger-api/swagger-ui/archive/v2.1.4.tar.gz && \

#
# Copy app jars
COPY controller.jar controller-libs.tar startController.sh ./

RUN tar xf controller-libs.tar && rm controller-libs.tar && \
chmod +x startController.sh
COPY build/distributions/controller.tar ./
RUN tar xf controller.tar
CMD controller/bin/controller

EXPOSE 8080
47 changes: 47 additions & 0 deletions core/controller/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apply plugin: 'scala'
apply plugin: 'application'

repositories {
mavenCentral()
}

sourceSets {
main {
scala {
srcDirs = ['src/']
}
resources {
srcDirs = ['src/']
}
}
}

dependencies {
compile project(':common:scala')
}

mainClassName = "whisk.core.controller.Controller"
applicationDefaultJvmArgs = ["-Xmx2g"]
startScripts {
doLast {
def lines = unixScript.readLines()
lines[lines.size()-1] = lines.last() + ' >> /logs/${COMPONENT_NAME}_logs.log 2>&1'
unixScript.text = lines.join("\n")
}
}

def dockerImageName = project.name
def dockerRegistry = project.hasProperty('dockerRegistry') ? dockerRegistry + '/' : ''
def dockerImageTag = project.hasProperty('dockerImageTag') ? dockerImageTag : 'latest'

task distDocker(dependsOn:[distTar, ':common:scala:distDocker'], type:Exec) {
commandLine 'docker', 'build', '-t', 'whisk/' + dockerImageName, '.'
}
task tagImage(type: Exec) {
commandLine 'docker', 'tag', '-f', 'whisk/' + dockerImageName, dockerRegistry + 'whisk/' + dockerImageName + ':' + dockerImageTag
}
task pushImage(dependsOn: tagImage, type:Exec) {
commandLine 'docker', 'push', dockerRegistry + 'whisk/' + dockerImageName + ':' + dockerImageTag
}
pushImage.onlyIf { dockerRegistry != '' }
distDocker.finalizedBy pushImage