forked from elastic/integrations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
'feature/labels-cloud-ephemeral-components' of github.com:v1v/integr…
…ations into feature/labels-cloud-ephemeral-components * 'feature/labels-cloud-ephemeral-components' of github.com:v1v/integrations: (23 commits) use branch standardise labels/tags Update .ci/Jenkinsfile [ci][terraform][aws] tags with metadata Bump github.com/elastic/elastic-package from 0.46.0 to 0.47.0 (elastic#3182) Spring boot package [Memory - data stream] (elastic#2979) [cisco_ise] Add Cisco ISE package (elastic#2855) [apache_spark][executor] Add Apache Spark package with Executor data stream (elastic#2943) [apache_spark][driver] Add Apache Spark package with Driver data stream (elastic#2945) cisco_duo: simplify grok expression for handling ports (elastic#3170) cisco_duo: fix handling of IP addresses with port numbers (elastic#3117) [sophos] Various improvements and log samples from 18.5 (elastic#3127) [cisco_asa] fix visualizations (elastic#3146) [apache_spark][application] Add Apache Spark package with Application data stream (elastic#2941) Fix pagination bug that skipped events when more than one page is present. (elastic#3140) Cis k8s name migration (elastic#3113) remove exported fields; these will be added to Kibana docs instead (elastic#3093) Exclude ecosystem as owner of subdirectories of packages (elastic#3132) [awsfargate] bump package version (elastic#3130) add first csp rule template (elastic#3081) ...
- Loading branch information
Showing
303 changed files
with
40,565 additions
and
10,002 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# This is not valid because there is an override that would remove owners of a directory. | ||
|
||
/testdata/devexp @elastic/integrations @elastic/integrations-developer-experience | ||
/testdata/* | ||
/testdata/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# This is not valid because there is an override that would remove owners of a directory. | ||
|
||
/testdata/devexp @elastic/integrations @elastic/integrations-developer-experience | ||
/testdata/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# This is a valid test file with multiple owners for a path | ||
|
||
/testdata/devexp @elastic/integrations @elastic/integrations-developer-experience | ||
/testdata/devexp/manifest.yml @elastic/integrations | ||
/testdata/integration @elastic/integrations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# This is a valid test file | ||
* @elastic/ecosystem | ||
|
||
/testdata/* | ||
/testdata/ | ||
|
||
/testdata/devexp @elastic/integrations-developer-experience | ||
/testdata/integration @elastic/integrations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
packages/apache_spark/_dev/deploy/docker/application/wordcount.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# | ||
# 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. | ||
# | ||
|
||
import sys | ||
import signal | ||
import time | ||
|
||
from operator import add | ||
from datetime import datetime | ||
|
||
from pyspark.sql import SparkSession | ||
|
||
if __name__ == "__main__": | ||
if len(sys.argv) != 3: | ||
print("Usage: wordcount <file>", file=sys.stderr) | ||
sys.exit(-1) | ||
|
||
spark = SparkSession.builder.master(sys.argv[2]).appName("PythonWordCount").getOrCreate() | ||
|
||
t_end = time.time() + 60 * 15 | ||
|
||
# Run loop for 15 mins | ||
while time.time() < t_end: | ||
lines = spark.read.text(sys.argv[1]).rdd.map(lambda r: r[0]) | ||
counts = lines.flatMap(lambda x: x.split(" ")).map(lambda x: (x, 1)).reduceByKey(add) | ||
output = counts.collect() | ||
for (word, count) in output: | ||
print("%s: %i" % (word, count)) | ||
|
||
spark.stop() |
27 changes: 23 additions & 4 deletions
27
packages/apache_spark/_dev/deploy/docker/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,28 @@ | ||
version: '2' | ||
version: '2.3' | ||
services: | ||
apache_spark: | ||
hostname: apache-spark-main | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
image: docker.io/bitnami/spark@sha256:cb19b1bdebc0bc9dc20ea13f2109763be6a73b357b144a01efd94902540f6d27 | ||
ports: | ||
- 7777 | ||
- 7779 | ||
- 7780 | ||
environment: | ||
- SPARK_MAIN_URL=spark://apache-spark-main:7077 | ||
- SPARK_WORKER_MEMORY=1024G | ||
- SPARK_WORKER_CORES=8 | ||
- SPARK_RPC_AUTHENTICATION_ENABLED=no | ||
- SPARK_RPC_ENCRYPTION_ENABLED=no | ||
- SPARK_LOCAL_STORAGE_ENCRYPTION_ENABLED=no | ||
volumes: | ||
- ./jolokia-agent:/usr/share/java/ | ||
- ./application:/opt/bitnami/spark/examples/src/main/python/ | ||
- ./jolokia-configs:/spark/conf/ | ||
- ./docker-entrypoint/docker-entrypoint.sh:/opt/bitnami/scripts/spark/docker-entrypoint.sh | ||
healthcheck: | ||
interval: 1s | ||
retries: 120 | ||
timeout: 120s | ||
test: |- | ||
curl -f -s http://localhost:7777/jolokia/version -o /dev/null | ||
entrypoint: /opt/bitnami/scripts/spark/docker-entrypoint.sh /opt/bitnami/scripts/spark/run.sh |
47 changes: 47 additions & 0 deletions
47
packages/apache_spark/_dev/deploy/docker/docker-entrypoint/docker-entrypoint.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
|
||
echo 'export SPARK_MASTER_OPTS="$SPARK_MASTER_OPTS -javaagent:/usr/share/java/jolokia-agent.jar=config=/spark/conf/jolokia-master.properties"' >> "/opt/bitnami/spark/conf/spark-env.sh" | ||
echo 'export SPARK_WORKER_OPTS="$SPARK_WORKER_OPTS -javaagent:/usr/share/java/jolokia-agent.jar=config=/spark/conf/jolokia-worker.properties"' >> "/opt/bitnami/spark/conf/spark-env.sh" | ||
|
||
echo '*.sink.jmx.class=org.apache.spark.metrics.sink.JmxSink' >> "/opt/bitnami/spark/conf/metrics.properties" | ||
echo '*.source.jvm.class=org.apache.spark.metrics.source.JvmSource' >> "/opt/bitnami/spark/conf/metrics.properties" | ||
|
||
echo 'spark.driver.extraJavaOptions -javaagent:/usr/share/java/jolokia-agent.jar=config=/spark/conf/jolokia-driver.properties' >> "/opt/bitnami/spark/conf/spark-defaults.conf" | ||
echo 'spark.executor.extraJavaOptions -javaagent:/usr/share/java/jolokia-agent.jar=config=/spark/conf/jolokia-executor.properties' >> "/opt/bitnami/spark/conf/spark-defaults.conf" | ||
|
||
# shellcheck disable=SC1091 | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
#set -o xtrace | ||
|
||
# Load libraries | ||
. /opt/bitnami/scripts/libbitnami.sh | ||
. /opt/bitnami/scripts/libspark.sh | ||
|
||
# Load Spark environment variables | ||
eval "$(spark_env)" | ||
|
||
print_welcome_page | ||
|
||
if [ ! $EUID -eq 0 ] && [ -e "$LIBNSS_WRAPPER_PATH" ]; then | ||
echo "spark:x:$(id -u):$(id -g):Spark:$SPARK_HOME:/bin/false" > "$NSS_WRAPPER_PASSWD" | ||
echo "spark:x:$(id -g):" > "$NSS_WRAPPER_GROUP" | ||
echo "LD_PRELOAD=$LIBNSS_WRAPPER_PATH" >> "$SPARK_CONFDIR/spark-env.sh" | ||
fi | ||
|
||
if [[ "$1" = "/opt/bitnami/scripts/spark/run.sh" ]]; then | ||
info "** Starting Spark setup **" | ||
/opt/bitnami/scripts/spark/setup.sh | ||
info "** Spark setup finished! **" | ||
fi | ||
|
||
eval "$(spark_env)" | ||
cd /opt/bitnami/spark/sbin | ||
./start-worker.sh $SPARK_MAIN_URL --cores $SPARK_WORKER_CORES --memory $SPARK_WORKER_MEMORY & | ||
cd /opt/bitnami/spark/examples/src/main/python/ | ||
/opt/bitnami/spark/bin/spark-submit wordcount.py wordcount.py $SPARK_MAIN_URL & | ||
|
||
echo "" | ||
exec "$@" |
Binary file added
BIN
+451 KB
packages/apache_spark/_dev/deploy/docker/jolokia-agent/jolokia-agent.jar
Binary file not shown.
6 changes: 4 additions & 2 deletions
6
packages/apache_spark/_dev/deploy/docker/jolokia-configs/bigdata.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
[Spark-Master] | ||
stats: http://127.0.0.1:7777/jolokia/read | ||
[Spark-Master] | ||
stats: http://127.0.0.1:7777/jolokia/read | ||
[Spark-Worker] | ||
stats: http://127.0.0.1:7778/jolokia/read |
12 changes: 12 additions & 0 deletions
12
packages/apache_spark/_dev/deploy/docker/jolokia-configs/jolokia-driver.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
host=0.0.0.0 | ||
port=7779 | ||
agentContext=/jolokia | ||
backlog=100 | ||
|
||
policyLocation=file:///spark/conf/jolokia.policy | ||
historyMaxEntries=10 | ||
debug=false | ||
debugMaxEntries=100 | ||
maxDepth=15 | ||
maxCollectionSize=1000 | ||
maxObjects=0 |
12 changes: 12 additions & 0 deletions
12
packages/apache_spark/_dev/deploy/docker/jolokia-configs/jolokia-executor.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
host=0.0.0.0 | ||
port=7780 | ||
agentContext=/jolokia | ||
backlog=100 | ||
|
||
policyLocation=file:///spark/conf/jolokia.policy | ||
historyMaxEntries=10 | ||
debug=false | ||
debugMaxEntries=100 | ||
maxDepth=15 | ||
maxCollectionSize=1000 | ||
maxObjects=0 |
24 changes: 12 additions & 12 deletions
24
packages/apache_spark/_dev/deploy/docker/jolokia-configs/jolokia-master.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
host=0.0.0.0 | ||
port=7777 | ||
agentContext=/jolokia | ||
backlog=100 | ||
|
||
policyLocation=file:///spark/conf/jolokia.policy | ||
historyMaxEntries=10 | ||
debug=false | ||
debugMaxEntries=100 | ||
maxDepth=15 | ||
maxCollectionSize=1000 | ||
maxObjects=0 | ||
host=0.0.0.0 | ||
port=7777 | ||
agentContext=/jolokia | ||
backlog=100 | ||
|
||
policyLocation=file:///spark/conf/jolokia.policy | ||
historyMaxEntries=10 | ||
debug=false | ||
debugMaxEntries=100 | ||
maxDepth=15 | ||
maxCollectionSize=1000 | ||
maxObjects=0 |
12 changes: 12 additions & 0 deletions
12
packages/apache_spark/_dev/deploy/docker/jolokia-configs/jolokia-worker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
host=0.0.0.0 | ||
port=7778 | ||
agentContext=/jolokia | ||
backlog=100 | ||
|
||
policyLocation=file:///spark/conf/jolokia.policy | ||
historyMaxEntries=10 | ||
debug=false | ||
debugMaxEntries=100 | ||
maxDepth=15 | ||
maxCollectionSize=1000 | ||
maxObjects=0 |
26 changes: 13 additions & 13 deletions
26
packages/apache_spark/_dev/deploy/docker/jolokia-configs/jolokia.policy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<restrict> | ||
<http> | ||
<method>get</method> | ||
<method>post</method> | ||
</http> | ||
<commands> | ||
<command>read</command> | ||
<command>list</command> | ||
<command>search</command> | ||
<command>version</command> | ||
</commands> | ||
</restrict> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<restrict> | ||
<http> | ||
<method>get</method> | ||
<method>post</method> | ||
</http> | ||
<commands> | ||
<command>read</command> | ||
<command>list</command> | ||
<command>search</command> | ||
<command>version</command> | ||
</commands> | ||
</restrict> |
Oops, something went wrong.