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

Merge balazs-patchset #13

Open
wants to merge 45 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
22bb476
Update README.adoc
balazsgaspar Mar 7, 2021
0c509cd
Merge pull request #1 from cloudera-labs/trunk
balazsgaspar Apr 19, 2021
7964019
Added images for streaming lite labs
Apr 19, 2021
76d4839
Added images for Lab 6 instructions
Mar 10, 2021
62ceb44
Added images for Lab 6 instructions
Mar 10, 2021
0794330
Added automated Viz setup - alpha
Mar 9, 2021
b95615d
Merging streaming_flink and streaming_lite content from zBrainiac/edg…
Mar 9, 2021
bce14f4
Merging addional images for streaming lite workshop from zBrainiac/ed…
Mar 9, 2021
a0014b1
Enabled unauthenticated app access. Added viz app status / health check.
Mar 9, 2021
6b40d43
Update streaming_lite.adoc
balazsgaspar Mar 9, 2021
005ece3
Added images for Lab 6 instructions
Mar 9, 2021
923244f
Updated web forms to improve registration process, fixed small issue …
Mar 9, 2021
e77f12b
Update streaming_lite.adoc
balazsgaspar Mar 9, 2021
c734153
Update streaming_lite.adoc
balazsgaspar Mar 9, 2021
aa17b26
Update streaming_lite.adoc
balazsgaspar Mar 9, 2021
38ffc94
Update streaming_lite.adoc
balazsgaspar Mar 9, 2021
4ce7267
Update streaming_lite.adoc
balazsgaspar Mar 9, 2021
ce77a76
Update streaming_lite.adoc
balazsgaspar Mar 10, 2021
dd43cfe
Added images for Lab 6 instructions
Mar 10, 2021
3dad2c2
Added images for Lab 6 instructions
Mar 10, 2021
8699895
Update streaming_lite.adoc
balazsgaspar Mar 10, 2021
4cd36e8
Update streaming_lite.adoc
balazsgaspar Mar 10, 2021
833e52e
Added images for Lab 6 instructions
Mar 10, 2021
a5a14a0
Added images for Lab 6 instructions
Mar 10, 2021
2f4fb89
Update streaming_lite.adoc
balazsgaspar Mar 10, 2021
b8db4e3
Added images for Lab 6 instructions
Mar 10, 2021
823773c
Added images for Lab 6 instructions
Mar 10, 2021
d215fc8
Update streaming_lite.adoc
balazsgaspar Mar 10, 2021
04143dd
Added images for Lab 6 instructions
Mar 10, 2021
085827f
Update streaming_lite.adoc
balazsgaspar Mar 10, 2021
d5db2b6
Typo fix
Mar 10, 2021
09c956a
Update streaming_lite.adoc
balazsgaspar Mar 10, 2021
fe0b3e4
Updated images for Lab 7 instructions
Mar 10, 2021
b13b720
Updated Lab 7 instructions for lite workshop
Mar 10, 2021
a67f988
Modified source topic name from iot_enriched to iot (for lite labs)
balazsgaspar Mar 10, 2021
b5c8e65
Update streaming_lite.adoc
balazsgaspar Mar 10, 2021
00859ae
Resolving conflicts with upstream
Jul 12, 2021
e8f5a7b
Resolving conflicts with upstream
Jul 12, 2021
c4e9fe2
Resolving conflicts with upstream
Jul 12, 2021
eb4b808
Resolving conflicts with upstream
Jul 12, 2021
57fff52
Resolving conflicts with upstream
Jul 12, 2021
8bfbfdb
Resolving conflicts with upstream
Jul 12, 2021
ddbba15
Resolving conflicts with upstream
Jul 12, 2021
e67971a
Resolving conflicts with upstream
Jul 12, 2021
0c555f7
Resolving conflicts with upstream
Jul 12, 2021
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.DS_Store
.idea/
__pycache__/
.vscode/
edge2ai.code-workspace
Binary file added images/FLINK_running_jobs_lite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/add_ConsumeMQTT_lite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/add_updateattribute_lite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/additional_controller_services_lite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/create_pgroup_lite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/flink_ssl_lite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/from_kafka_to_kudu_flow_lite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/hue_timestamp_fixed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/hue_timestamp_issue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/kafka_success_lite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/kudu_success_lite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/publishKafka_flow_lite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ssb-sql-results-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/table_select_lite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/viz_add_expression.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/viz_clone_field.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/viz_connection_explorer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/viz_connection_explorer_table.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/viz_create_dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/viz_dashboard_add_dimensions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/viz_dashboard_add_measures.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/viz_dashboard_auto_refresh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/viz_dashboard_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/viz_new_connection_advanced.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/viz_new_connection_basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/viz_new_dashboard.png
Binary file added images/viz_new_dataset.png
Binary file added images/viz_save_dataset.png
115 changes: 115 additions & 0 deletions sensor_enhanced.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"type": "record",
"name": "SensorReading",
"namespace": "com.cloudera.example",
"doc": "This is a sample sensor reading",
"fields": [
{
"name": "sensor_id",
"doc": "Sensor identification number.",
"type": "int"
},
{
"name": "sensor_ts",
"doc": "Timestamp of the collected readings.",
"type": "long"
},
{
"name": "is_healthy",
"doc": "Flag indicating health (healthy == 1)",
"type": "int"
},
{
"name": "response",
"doc": "response record",
"type": {
"type": "record",
"name": "CDSWResponse",
"namespace": "com.cloudera.example",
"doc": "This is a CDSW Model response",
"fields": [
{
"name": "result",
"doc": "Result",
"type": "int"
}
]
}
},
{
"name": "sensor_0",
"doc": "Reading #0.",
"type": "int"
},
{
"name": "sensor_1",
"doc": "Reading #1.",
"type": "int"
},
{
"name": "sensor_2",
"doc": "Reading #2.",
"type": "int"
},
{
"name": "sensor_3",
"doc": "Reading #3.",
"type": "int"
},
{
"name": "sensor_4",
"doc": "Reading #4.",
"type": "int"
},
{
"name": "sensor_5",
"doc": "Reading #5.",
"type": "int"
},
{
"name": "sensor_6",
"doc": "Reading #6.",
"type": "int"
},
{
"name": "sensor_7",
"doc": "Reading #7.",
"type": "int"
},
{
"name": "sensor_8",
"doc": "Reading #8.",
"type": "int"
},
{
"name": "sensor_9",
"doc": "Reading #9.",
"type": "int"
},
{
"name": "sensor_10",
"doc": "Reading #10.",
"type": "int"
},
{
"name": "sensor_11",
"doc": "Reading #11.",
"type": "int"
},
{
"name": "city",
"doc": "closest city",
"type": "string"
},
{
"name": "lat",
"doc": "geo location",
"type": "double"
},
{
"name": "lon",
"doc": "geo location",
"type": "double"
}
]
}
2 changes: 1 addition & 1 deletion setup/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ docker pull asdaraujo/edge2ai-workshop:latest
+
[source,shell]
----
# Install YUM, skip if you already have it
# Install Git, skip if you already have it
sudo yum install -y git

# Clone the repo
Expand Down
29 changes: 22 additions & 7 deletions setup/terraform/check-services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ function cleanup() {
rm -f .curl.*.$$
}

function get_model_status() {
local ip=$1
CDSW_API="cdsw.$ip.nip.io/api/v1"
CDSW_ALTUS_API="cdsw.$ip.nip.io/api/altus-ds-1"
status=""
for scheme in http https; do
token=$("${CURL[@]}" -X POST --cookie-jar .curl.cj.$$ --cookie .curl.cj.$$ -H "Content-Type: application/json" --data '{"_local":false,"login":"admin","password":"'"${THE_PWD}"'"}' "$scheme://$CDSW_API/authenticate" 2>/dev/null | jq -r '.auth_token' 2> /dev/null)
[[ ! -n $token ]] && continue
status=$("${CURL[@]}" -X POST --cookie-jar .curl.cj.$$ --cookie .curl.cj.$$ -H "Content-Type: application/json" -H "Authorization: Bearer $token" --data '{"projectOwnerName":"admin","latestModelDeployment":true,"latestModelBuild":true}' "$scheme://$CDSW_ALTUS_API/models/list-models" 2>/dev/null | jq -r '.[].latestModelDeployment | select(.model.name == "IoT Prediction Model").status' 2>/dev/null)
[[ -n $status ]] && break
done
echo -n $status
}

if [ $# != 1 ]; then
echo "Syntax: $0 <namespace>"
show_namespaces
Expand All @@ -17,26 +31,27 @@ fi
NAMESPACE=$1
load_env $NAMESPACE

printf "%-30s %-30s %-5s %-5s %-5s %-5s %-5s %-5s %-5s %-5s %-5s %s\n" "instance" "ip address" "WEB" "CM" "CEM" "NIFI" "NREG" "SREG" "SMM" "HUE" "CDSW" "Model Status"
printf "%-30s %-20s %-5s %-5s %-5s %-5s %-5s %-5s %-5s %-5s %-5s %-14s %s\n" "instance" "ip address" "WEB" "CM" "CEM" "NIFI" "NREG" "SREG" "SMM" "HUE" "CDSW" "Model Status" "Viz Status"
ensure_tf_json_file
if [ -s $TF_JSON_FILE ]; then
cat $TF_JSON_FILE | \
jq -r '.values.root_module.resources[] | select(.type == "aws_instance" and .name == "web" or .type == "aws_instance" and .name == "cluster") | "\(.type).\(.name)[\(.index)] \(.values.public_ip) \(.values.public_dns)"' | \
while read instance ip host; do
jq -r '.values.root_module.resources[] | select(.type == "aws_instance" and .name == "web" or .type == "aws_instance" and .name == "cluster") | "\(.type).\(.name)[\(.index)] \(.values.public_ip)"' | \
while read instance ip; do
host="cdp.$ip.nip.io"
CDSW_API="http://cdsw.$ip.nip.io/api/v1"
CDSW_ALTUS_API="http://cdsw.$ip.nip.io/api/altus-ds-1"
("${CURL[@]}" http://$host/api/ping 2>/dev/null | grep 'Pong!' > /dev/null 2>&1 && echo Ok) > .curl.web.$$ &
("${CURL[@]}" http://$host:7180/cmf/login 2>/dev/null | grep "<title>Cloudera Manager</title>" > /dev/null 2>&1 && echo Ok) > .curl.cm.$$ &
(("${CURL[@]}" http://$host:10080/efm/ui/ || "${CURL[@]}" https://$host:10080/efm/ui/) 2>/dev/null | grep "<title>CEM</title>" > /dev/null 2>&1 && echo Ok) > .curl.cem.$$ &
(("${CURL[@]}" http://$host:10088/efm/ui/ || "${CURL[@]}" https://$host:10088/efm/ui/) 2>/dev/null | grep "<title>CEM</title>" > /dev/null 2>&1 && echo Ok) > .curl.cem.$$ &
(("${CURL[@]}" http://$host:8080/nifi/ || "${CURL[@]}" https://$host:8443/nifi/) 2>/dev/null | grep "<title>NiFi</title>" > /dev/null 2>&1 && echo Ok) > .curl.nifi.$$ &
(("${CURL[@]}" http://$host:18080/nifi-registry/ || "${CURL[@]}" https://$host:18433/nifi-registry/) 2>/dev/null | grep "<title>NiFi Registry</title>" > /dev/null 2>&1 && echo Ok) > .curl.nifireg.$$ &
(("${CURL[@]}" http://$host:7788/ || "${CURL[@]}" https://$host:7790/) 2>/dev/null | egrep "<title>Schema Registry</title>|Error 401 Authentication required" > /dev/null 2>&1 && echo Ok) > .curl.schreg.$$ &
(("${CURL[@]}" http://$host:9991/ || "${CURL[@]}" https://$host:9991/) 2>/dev/null | grep "<title>STREAMS MESSAGING MANAGER</title>" > /dev/null 2>&1 && echo Ok) > .curl.smm.$$ &
(("${CURL[@]}" http://$host:8888/ ; "${CURL[@]}" https://$host:8889/) 2>/dev/null | grep "<title>Hue" > /dev/null 2>&1 && echo Ok) > .curl.hue.$$ &
(("${CURL[@]}" http://cdsw.$ip.nip.io/ || "${CURL[@]}" https://cdsw.$ip.nip.io/) 2>/dev/null | egrep "(Cloudera Machine Learning|Cloudera Data Science Workbench)" > /dev/null 2>&1 && echo Ok) > .curl.cml.$$ &
(token=$("${CURL[@]}" -X POST --cookie-jar .curl.cj.$$ --cookie .curl.cj.$$ -H "Content-Type: application/json" --data '{"_local":false,"login":"admin","password":"'"${THE_PWD}"'"}' "$CDSW_API/authenticate" 2>/dev/null | jq -r '.auth_token' 2> /dev/null) && \
"${CURL[@]}" -X POST --cookie-jar .curl.cj.$$ --cookie .curl.cj.$$ -H "Content-Type: application/json" -H "Authorization: Bearer $token" --data '{"projectOwnerName":"admin","latestModelDeployment":true,"latestModelBuild":true}' "$CDSW_ALTUS_API/models/list-models" 2>/dev/null | jq -r '.[].latestModelDeployment | select(.model.name == "IoT Prediction Model").status' 2>/dev/null) > .curl.model.$$ &
(get_model_status $ip) > .curl.model.$$ &
("${CURL[@]}" http://viz.cdsw.$ip.nip.io/arc/adminapi/users 2>/dev/null | grep 'user' > /dev/null 2>&1 && echo running) > .curl.viz.$$ &
wait
printf "%-30s %-30s %-5s %-5s %-5s %-5s %-5s %-5s %-5s %-5s %-5s %s\n" "$instance" "$ip" "$(cat .curl.web.$$)" "$(cat .curl.cm.$$)" "$(cat .curl.cem.$$)" "$(cat .curl.nifi.$$)" "$(cat .curl.nifireg.$$)" "$(cat .curl.schreg.$$)" "$(cat .curl.smm.$$)" "$(cat .curl.hue.$$)" "$(cat .curl.cml.$$)" "$(cat .curl.model.$$)"
printf "%-30s %-20s %-5s %-5s %-5s %-5s %-5s %-5s %-5s %-5s %-5s %-14s %s\n" "$instance" "$ip" "$(cat .curl.web.$$)" "$(cat .curl.cm.$$)" "$(cat .curl.cem.$$)" "$(cat .curl.nifi.$$)" "$(cat .curl.nifireg.$$)" "$(cat .curl.schreg.$$)" "$(cat .curl.smm.$$)" "$(cat .curl.hue.$$)" "$(cat .curl.cml.$$)" "$(cat .curl.model.$$)" "$(cat .curl.viz.$$)"
done | sort -t\[ -k1,1r -k2,2n
fi
Loading