Skip to content

Instantly share code, notes, and snippets.

@style95
Created May 24, 2022 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save style95/ac7bb101c64b1308e7e92830ff0a74c0 to your computer and use it in GitHub Desktop.
Save style95/ac7bb101c64b1308e7e92830ff0a74c0 to your computer and use it in GitHub Desktop.
Run OpenWhisk on M1 Mac.
/*
* 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 plugin: 'scala'
apply plugin: 'application'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'org.scoverage'
apply plugin: 'com.lightbend.akka.grpc.gradle'
ext.dockerImageName = 'scheduler'
apply from: '../../gradle/docker.gradle'
distDocker.dependsOn ':common:scala:distDocker', 'distTar'
project.archivesBaseName = "openwhisk-scheduler"
ext.coverageDirs = [
"${buildDir}/classes/scala/scoverage",
"${project(':common:scala').buildDir.absolutePath}/classes/scala/scoverage"
]
distDockerCoverage.dependsOn ':common:scala:scoverageClasses', 'scoverageClasses'
buildscript {
repositories {
mavenLocal()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
// see https://plugins.gradle.org/plugin/com.lightbend.akka.grpc.gradle
// for the currently latest version.
classpath 'gradle.plugin.com.lightbend.akka.grpc:akka-grpc-gradle-plugin:0.7.2'
}
}
// Define a separate configuration for managing the dependency on Jetty ALPN agent.
configurations {
alpnagent
}
dependencies {
configurations.all {
resolutionStrategy.force "com.lihaoyi:fastparse_${gradle.scala.depVersion}:2.1.3"
resolutionStrategy.force "com.typesafe.akka:akka-http-core_${gradle.scala.depVersion}:${gradle.akka_http.version}"
resolutionStrategy.force "com.typesafe.akka:akka-http_${gradle.scala.depVersion}:${gradle.akka_http.version}"
resolutionStrategy.force "com.typesafe.akka:akka-http2-support_${gradle.scala.depVersion}:${gradle.akka_http.version}"
resolutionStrategy.force "com.typesafe.akka:akka-http-spray-json_${gradle.scala.depVersion}:${gradle.akka_http.version}"
resolutionStrategy.force "com.typesafe.akka:akka-parsing_${gradle.scala.depVersion}:${gradle.akka_http.version}"
resolutionStrategy.force "com.typesafe.akka:akka-http_${gradle.scala.depVersion}:${gradle.akka_http.version}"
}
compile "org.scala-lang:scala-library:${gradle.scala.version}"
compile "io.altoo:akka-kryo-serialization_${gradle.scala.depVersion}:1.0.0"
compile project(':common:scala')
}
// workaround for akka-grpc
// https://github.com/akka/akka-grpc/issues/786
printProtocLogs.doFirst {
mkdir "$buildDir"
file("$buildDir/akka-grpc-gradle-plugin.log").text = "x"
mkdir "$project.rootDir/build"
file("$project.rootDir/build/akka-grpc-gradle-plugin.log").text = "x"
}
printProtocLogs.configure {
mkdir "$buildDir"
file("$buildDir/akka-grpc-gradle-plugin.log").text = "x"
mkdir "$project.rootDir/build"
file("$project.rootDir/build/akka-grpc-gradle-plugin.log").text = "x"
}
protobuf {
protoc {
// for apple m1, please add protoc_platform=osx-x86_64 in $HOME/.gradle/gradle.properties
if (project.hasProperty('protoc_platform')) {
artifact = "com.google.protobuf:protoc:3.4.0:${protoc_platform}"
} else {
artifact = "com.google.protobuf:protoc:3.4.0"
}
}
}
mainClassName = "org.apache.openwhisk.core.scheduler.Scheduler"
applicationDefaultJvmArgs = ["-Djava.security.egd=file:/dev/./urandom"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment