beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lc...@apache.org
Subject [20/50] [abbrv] beam git commit: Add gradle rule for python container
Date Fri, 17 Nov 2017 22:29:51 GMT
Add gradle rule for python container


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/294a0a79
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/294a0a79
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/294a0a79

Branch: refs/heads/master
Commit: 294a0a79e95f8612c5286ec92a90b34db2b52623
Parents: afba5cb
Author: Henning Rohde <herohde@google.com>
Authored: Fri Nov 3 12:23:25 2017 -0700
Committer: Luke Cwik <lcwik@google.com>
Committed: Fri Nov 17 14:27:15 2017 -0800

----------------------------------------------------------------------
 build.gradle                       |  1 +
 build_rules.gradle                 |  8 ++++++
 sdks/python/container/build.gradle | 45 +++++++++++++++++++++++++++++++++
 3 files changed, 54 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/294a0a79/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 316e2d5..3642930 100644
--- a/build.gradle
+++ b/build.gradle
@@ -148,6 +148,7 @@ buildscript {
     classpath "com.commercehub.gradle.plugin:gradle-avro-plugin:0.11.0"
     classpath "com.diffplug.spotless:spotless-plugin-gradle:3.6.0"
     classpath "gradle.plugin.com.github.blindpirate:gogradle:0.7.0"
+    classpath "gradle.plugin.com.palantir.gradle.docker:gradle-docker:0.13.0"
   }
 }
 

http://git-wip-us.apache.org/repos/asf/beam/blob/294a0a79/build_rules.gradle
----------------------------------------------------------------------
diff --git a/build_rules.gradle b/build_rules.gradle
index de6ce43..4f3b4df 100644
--- a/build_rules.gradle
+++ b/build_rules.gradle
@@ -155,6 +155,14 @@ ext.applyGoNature = {
   }
 }
 
+ext.applyDockerNature = {
+  println "applyDockerNature with " + (it ? "$it" : "default configuration") + " for project
$project.name"
+  apply plugin: "com.palantir.docker"
+  docker {
+    noCache true
+  }
+}
+
 ext.applyGrpcNature = {
   println "applyGrpcNature with " + (it ? "$it" : "default configuration") + " for project
$project.name"
   apply plugin: "com.google.protobuf"

http://git-wip-us.apache.org/repos/asf/beam/blob/294a0a79/sdks/python/container/build.gradle
----------------------------------------------------------------------
diff --git a/sdks/python/container/build.gradle b/sdks/python/container/build.gradle
new file mode 100644
index 0000000..6a2f532
--- /dev/null
+++ b/sdks/python/container/build.gradle
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+apply from: project(":").file("build_rules.gradle")
+applyGoNature()
+applyDockerNature()
+
+description = "Apache Beam :: SDKs :: Python :: Container"
+
+dependencies {
+    golang {
+        // TODO(herohde): use "./" prefix to prevent gogradle use base github path, for now.
+        build name: './github.com/apache/beam/sdks/go', dir: project(':beam-sdks-parent:beam-sdks-go').projectDir
+    }
+}
+
+golang {
+    packagePath = 'github.com/apache/beam/sdks/python/boot'
+    build {
+        // TODO(herohde): build local platform + linux-amd64, if possible.
+        targetPlatform = ['linux-amd64']
+        outputLocation = './build/target/${GOOS}_${GOARCH}/boot'
+    }
+}
+
+docker {
+    // TODO(herohde): make the name easier to generate for releases.
+    name System.properties['user.name'] + '-docker-apache.bintray.io/beam/python:latest'
+    files "./build/"
+}


Mime
View raw message