Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.
#

version = 1.5.1
style = intellij
danglingParentheses = false
maxColumn = 120
Expand Down
1 change: 1 addition & 0 deletions ansible/elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# This playbook deploys a ElasticSearch cluster

- hosts: elasticsearch
gather_facts: yes
vars:
#
# host_group - usually "{{ groups['...'] }}" where '...' is what was used
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/elasticsearch/templates/elasticsearch.yml.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cluster.name: "{{ db.elasticsearch.cluster_name }}"
node.name: "{{ elasticsearch_name }}"
network.host: 0.0.0.0
network.publish_host: {{ ansible_default_ipv4.address }}
network.publish_host: {{ ansible_default_ipv4.address | default(ansible_host | default('127.0.0.1')) }}

http.port: 9200
transport.tcp.port: {{ transport_port }}
Expand Down
35 changes: 22 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

buildscript {
repositories {
jcenter()
gradlePluginPortal()
mavenCentral()
}
dependencies {
classpath "gradle.plugin.cz.alenkacz:gradle-scalafmt:${gradle.scalafmt.version}"
Expand All @@ -26,6 +27,7 @@ buildscript {

plugins {
id "org.scoverage" version "7.0.0" apply false
id "cz.alenkacz.gradle.scalafmt" version "1.16.2" apply false
}

subprojects {
Expand All @@ -41,16 +43,21 @@ subprojects {
// ./gradlew :test:dependencies | grep -o 'akka-.*_' | cut -c 6- | rev | cut -c 2- | rev | sort -u
def cons = project.getDependencies().getConstraints()
def akka = ['akka-actor', 'akka-cluster', 'akka-cluster-metrics', 'akka-cluster-tools', 'akka-coordination',
'akka-discovery', 'akka-distributed-data', 'akka-protobuf', 'akka-remote', 'akka-slf4j',
'akka-stream', 'akka-stream-testkit', 'akka-testkit', 'akka-persistence', 'akka-cluster-sharding']
'akka-discovery', 'discovery-kubernetes-api', 'discovery-marathon-api', 'akka-distributed-data','grpc-runtime','akka-protobuf', 'akka-remote', 'akka-slf4j',
'akka-stream', 'akka-stream-testkit', 'akka-testkit', 'akka-persistence', 'akka-cluster-sharding','akka-protobuf-v3','akka-pki','akka-parsing','akka-management-cluster-bootstrap','akka-management',
'akka-kryo-serialization']
def akkaHttp = ['akka-http', 'akka-http-core', 'akka-http-spray-json', 'akka-http-testkit', 'akka-http-xml',
'akka-parsing', 'akka-http2-support']
def akkaKafka = ['akka-stream-kafka-testkit','akka-stream-kafka','akka-stream-alpakka-s3','akka-stream-alpakka-file']

akka.forEach {
cons.add('compile', "com.typesafe.akka:${it}_${gradle.scala.depVersion}:${gradle.akka.version}")
cons.add('implementation', "com.typesafe.akka:${it}_${gradle.scala.depVersion}:${gradle.akka.version}")
}
akkaHttp.forEach {
cons.add('compile', "com.typesafe.akka:${it}_${gradle.scala.depVersion}:${gradle.akka_http.version}")
cons.add('implementation', "com.typesafe.akka:${it}_${gradle.scala.depVersion}:${gradle.akka_http.version}")
}
akkaKafka.forEach{
cons.add('implementation', "com.typesafe.akka:${it}_${gradle.scala.depVersion}:${gradle.akka_kafka.version}")
}
}

Expand All @@ -72,9 +79,17 @@ subprojects {
}
}
}

configurations {
implementationResolvable {
canBeResolved = true
canBeConsumed = false
extendsFrom configurations.implementation
}
}
}

if (project.plugins.hasPlugin('maven')) {
if (project.plugins.hasPlugin('maven-publish')) {
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
Expand All @@ -90,18 +105,12 @@ subprojects {
classifier = 'tests'
from sourceSets.test.output
}

artifacts {
archives sourcesJar
archives testSourcesJar
archives testClassesJar
}
}

if (project.plugins.hasPlugin('application')) {
//Ensure that dist archive name does not contain version
distTar {
archiveName = "${project.name}.tar"
archiveFileName = "${project.name}.tar"
}

//Avoid generating the zip files from maven installations
Expand Down
21 changes: 13 additions & 8 deletions common/scala/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# if you change version of openjsk, also update tools/github/setup.sh to download the corresponding jdk
FROM adoptopenjdk/openjdk11-openj9:x86_64-alpine-jdk-11.0.12_7_openj9-0.27.0
# if you change version of openjdk, also update tools/github/setup.sh to download the corresponding jdk
# NOTE:
# OpenWhisk will use a 21-jre multi arch image, compilation will be done with a jdk 17 temurin based image.
# as wsk CLI is compiled against glibc we need touse a GLIBC based JRE Image (alpine it is not GLIBC based)
FROM eclipse-temurin:21-jre

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

# Switch to the HTTPS endpoint for the apk repositories as per https://github.com/gliderlabs/docker-alpine/issues/184
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
RUN apk add --update sed curl bash && apk update && apk upgrade
# Install curl, bash, sed
RUN apt-get update && \
apt-get install -y curl bash sed openssl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN mkdir /logs

Expand Down
34 changes: 0 additions & 34 deletions common/scala/Dockerfile.arm

This file was deleted.

17 changes: 11 additions & 6 deletions common/scala/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@

plugins {
id 'eclipse'
id 'maven'
id 'maven-publish'
id 'org.scoverage'
id 'scala'
id 'java-library'
}

ext.dockerImageName = 'scala'
if(System.getProperty("os.arch").toLowerCase(Locale.ENGLISH).startsWith("aarch")) {
ext.dockerDockerfileSuffix = ".arm"
}

// Using a multiarch base image should make this supefluous
//if(System.getProperty("os.arch").toLowerCase(Locale.ENGLISH).startsWith("aarch")) {
// ext.dockerDockerfileSuffix = ".arm"
//}

apply from: '../../gradle/docker.gradle'

project.archivesBaseName = "openwhisk-common"
Expand Down Expand Up @@ -56,7 +59,7 @@ dependencies {
api "com.typesafe.akka:akka-http-core_${gradle.scala.depVersion}:${gradle.akka_http.version}"
api "com.typesafe.akka:akka-http-spray-json_${gradle.scala.depVersion}:${gradle.akka_http.version}"

api "com.lightbend.akka:akka-stream-alpakka-file_${gradle.scala.depVersion}:1.1.2"
api "com.lightbend.akka:akka-stream-alpakka-file_${gradle.scala.depVersion}:2.0.2"

api "ch.qos.logback:logback-classic:1.2.11"
api "org.slf4j:jcl-over-slf4j:1.7.25"
Expand Down Expand Up @@ -141,10 +144,12 @@ dependencies {
api "io.netty:netty-codec-http2:${gradle.netty.version}"
api "io.netty:netty-transport-native-epoll:${gradle.netty.version}"
api "io.netty:netty-transport-native-unix-common:${gradle.netty.version}"
api "com.lightbend.akka.grpc:akka-grpc-runtime_${gradle.scala.depVersion}:${gradle.akka_gprc.version}"
api "com.typesafe.akka:akka-stream_${gradle.scala.depVersion}:${gradle.akka.version}"
}

configurations {
compile {
api {
exclude group: 'commons-logging'
exclude group: 'log4j'
}
Expand Down
7 changes: 3 additions & 4 deletions core/controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# limitations under the License.
#

FROM scala
ARG BASE=scala
FROM ${BASE}

ENV UID=1001 \
NOT_ROOT_USER=owuser
Expand All @@ -30,8 +31,6 @@ ENV SWAGGER_UI_DOWNLOAD_SHA256=3d7ef5ddc59e10f132fe99771498f0f1ba7a2cbfb9585f986
# If this cannot be guaranteed, set `invoker_use_runc: false` in the ansible env.
ENV DOCKER_VERSION=23.0.6

RUN apk add --update openssl

# Uncomment to fetch latest version of docker instead: RUN wget -qO- https://get.docker.com | sh
# Install docker client
RUN curl -sSL -o docker-${DOCKER_VERSION}.tgz https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz && \
Expand All @@ -56,7 +55,7 @@ ADD build/distributions/controller.tar /
COPY init.sh /
RUN chmod +x init.sh

RUN adduser -D -u ${UID} -h /home/${NOT_ROOT_USER} -s /bin/bash ${NOT_ROOT_USER}
RUN useradd -m -u 1001 -d /home/${NOT_ROOT_USER} -s /bin/bash ${NOT_ROOT_USER}

# It is possible to run as non root if you dont need invoker capabilities out of the controller today
# When running it as a non-root user this has implications on the standard directory where runc stores its data.
Expand Down
2 changes: 1 addition & 1 deletion core/controller/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
plugins {
id 'application'
id 'eclipse'
id 'maven'
id 'maven-publish'
id 'org.scoverage'
id 'scala'
}
Expand Down
5 changes: 3 additions & 2 deletions core/cosmosdb/cache-invalidator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# limitations under the License.
#

FROM scala
ARG BASE=scala
FROM ${BASE}

ENV UID=1001 \
NOT_ROOT_USER=owuser
Expand All @@ -27,7 +28,7 @@ ADD build/distributions/cache-invalidator.tar /
COPY init.sh /
RUN chmod +x init.sh

RUN adduser -D -u ${UID} -h /home/${NOT_ROOT_USER} -s /bin/bash ${NOT_ROOT_USER}
RUN useradd -m -u 1001 -d /home/${NOT_ROOT_USER} -s /bin/bash ${NOT_ROOT_USER}
USER ${NOT_ROOT_USER}

EXPOSE 8080
Expand Down
2 changes: 1 addition & 1 deletion core/cosmosdb/cache-invalidator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
plugins {
id 'application'
id 'eclipse'
id 'maven'
id 'maven-publish'
id 'org.scoverage'
id 'scala'
}
Expand Down
8 changes: 3 additions & 5 deletions core/invoker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# limitations under the License.
#

FROM scala
ARG BASE=scala
FROM ${BASE}

ENV UID=1001 \
NOT_ROOT_USER=owuser \
Expand All @@ -24,9 +25,6 @@ ENV UID=1001 \
# Docker server version and the invoker docker version must be the same to enable runc usage.
# If this cannot be guaranteed, set `invoker_use_runc: false` in the ansible env.


RUN apk add --update openssl

# Uncomment to fetch latest version of docker instead: RUN wget -qO- https://get.docker.com | sh
# Install docker client
RUN curl -sSL -o docker-${DOCKER_VERSION}.tgz https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz && \
Expand All @@ -43,7 +41,7 @@ RUN chmod +x init.sh

# When running the invoker as a non-root user this has implications on the standard directory where runc stores its data.
# The non-root user should have access on the directory and corresponding permission to make changes on it.
RUN adduser -D -u ${UID} -h /home/${NOT_ROOT_USER} -s /bin/bash ${NOT_ROOT_USER}
RUN useradd -m -u 1001 -d /home/${NOT_ROOT_USER} -s /bin/bash ${NOT_ROOT_USER}

EXPOSE 8080
CMD ["./init.sh", "0"]
2 changes: 1 addition & 1 deletion core/invoker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
plugins {
id 'application'
id 'eclipse'
id 'maven'
id 'maven-publish'
id 'org.scoverage'
id 'scala'
}
Expand Down
5 changes: 3 additions & 2 deletions core/monitoring/user-events/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# limitations under the License.
#

FROM scala
ARG BASE=scala
FROM ${BASE}

ENV UID=1001 \
NOT_ROOT_USER=owuser
Expand All @@ -26,7 +27,7 @@ ADD build/distributions/user-events.tar /
COPY init.sh /
RUN chmod +x init.sh

RUN adduser -D -u ${UID} -h /home/${NOT_ROOT_USER} -s /bin/bash ${NOT_ROOT_USER}
RUN useradd -m -u 1001 -d /home/${NOT_ROOT_USER} -s /bin/bash ${NOT_ROOT_USER}
USER ${NOT_ROOT_USER}

# Prometheus port
Expand Down
2 changes: 1 addition & 1 deletion core/monitoring/user-events/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
plugins {
id 'application'
id 'eclipse'
id 'maven'
id 'maven-publish'
id 'org.scoverage'
id 'scala'
}
Expand Down
5 changes: 3 additions & 2 deletions core/scheduler/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# limitations under the License.
#

FROM scala
ARG BASE=scala
FROM ${BASE}

ENV UID=1001 \
NOT_ROOT_USER=owuser
Expand All @@ -26,7 +27,7 @@ ADD build/distributions/scheduler.tar /
COPY init.sh /
RUN chmod +x init.sh

RUN adduser -D -u ${UID} -h /home/${NOT_ROOT_USER} -s /bin/bash ${NOT_ROOT_USER}
RUN useradd -m -u 1001 -d /home/${NOT_ROOT_USER} -s /bin/bash ${NOT_ROOT_USER}
USER ${NOT_ROOT_USER}

EXPOSE 8080
Expand Down
Loading
Loading