Skip to content

Commit 97cf141

Browse files
committed
Address comments
1 parent ba8cdf6 commit 97cf141

File tree

11 files changed

+68
-56
lines changed

11 files changed

+68
-56
lines changed

yscope-k8s/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
demo-assets/clp-config.yml

yscope-k8s/.helmignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
*.tmp
1717
*.orig
1818
*~
19+
1920
# Various IDEs
2021
.project
2122
.idea/
2223
*.tmproj
2324
.vscode/
24-
clp/
25+
26+
# Demo assets
27+
demo-assets/

yscope-k8s/README.md

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -30,44 +30,7 @@ Follow the guide here: [helm]
3030

3131
3. Replace the content of `etc/clp-config.yml` with the following (also replace the IP address `${REPLACE_IP}` with the actual IP address of the host that you are running the clp-package):
3232
```yaml
33-
package:
34-
storage_engine: "clp-s"
35-
database:
36-
type: "mariadb"
37-
host: "${REPLACE_IP}"
38-
port: 6001
39-
name: "clp-db"
40-
query_scheduler:
41-
host: "${REPLACE_IP}"
42-
port: 6002
43-
jobs_poll_delay: 0.1
44-
num_archives_to_search_per_sub_job: 16
45-
logging_level: "INFO"
46-
queue:
47-
host: "${REPLACE_IP}"
48-
port: 6003
49-
redis:
50-
host: "${REPLACE_IP}"
51-
port: 6004
52-
query_backend_database: 0
53-
compression_backend_database: 1
54-
reducer:
55-
host: "${REPLACE_IP}"
56-
base_port: 6100
57-
logging_level: "INFO"
58-
upsert_interval: 100
59-
results_cache:
60-
host: "${REPLACE_IP}"
61-
port: 6005
62-
db_name: "clp-query-results"
63-
stream_collection_name: "stream-files"
64-
webui:
65-
host: "localhost"
66-
port: 6000
67-
logging_level: "INFO"
68-
log_viewer_webui:
69-
host: "localhost"
70-
port: 6006
33+
7134
```
7235

7336
4. Launch:
@@ -82,7 +45,13 @@ sbin/start-clp.sh
8245
sbin/compress.sh --timestamp-key 't.dollar_sign_date' datasets/mongod-256MB-processed.log
8346
```
8447

85-
6. Use a JetBrain IDE to connect the database source. The database is `clp-db`, the user is `clp-user` and the password is in `etc/credential.yml`. Then modify the `archive_storage_directory` field in `clp_datasets` table to `/var/data/archives/default`, and submit the change.
48+
6. Use the following command to update the CLP metadata database so that the worker can find the archives in right place:
49+
```bash
50+
# Install mysql-client if necessary
51+
sudo apt update && sudo apt install -y mysql-client
52+
# Find the user and password in clp-json-package/etc/credential.yml
53+
mysql -h ${REPLACE_IP} -P 6001 -u ${REPLACE_USER} -p'${REPLACE_PASSWORD}' clp-db -e "UPDATE clp_datasets SET archive_storage_directory = '/var/data/archives/default';"
54+
```
8655

8756
# Create k8s Cluster
8857
Create a local k8s cluster with port forwarding
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package:
2+
storage_engine: "clp-s"
3+
database:
4+
type: "mariadb"
5+
host: "${REPLACE_IP}"
6+
port: 6001
7+
name: "clp-db"
8+
query_scheduler:
9+
host: "${REPLACE_IP}"
10+
port: 6002
11+
jobs_poll_delay: 0.1
12+
num_archives_to_search_per_sub_job: 16
13+
logging_level: "INFO"
14+
queue:
15+
host: "${REPLACE_IP}"
16+
port: 6003
17+
redis:
18+
host: "${REPLACE_IP}"
19+
port: 6004
20+
query_backend_database: 0
21+
compression_backend_database: 1
22+
reducer:
23+
host: "${REPLACE_IP}"
24+
base_port: 6100
25+
logging_level: "INFO"
26+
upsert_interval: 100
27+
results_cache:
28+
host: "${REPLACE_IP}"
29+
port: 6005
30+
db_name: "clp-query-results"
31+
stream_collection_name: "stream-files"
32+
webui:
33+
host: "localhost"
34+
port: 6000
35+
logging_level: "INFO"
36+
log_viewer_webui:
37+
host: "localhost"
38+
port: 6006

yscope-k8s/demo-assets/init.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
if [ "$#" -ne 1 ]; then
4+
echo "Usage: $0 <ip-address>"
5+
exit 1
6+
fi
7+
8+
SCRIPT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9+
10+
IP="$1"
11+
FILE="${SCRIPT_PATH}/clp-config.yml"
12+
13+
cp "${FILE}.bak" "$FILE"
14+
15+
sed -i "s|\${REPLACE_IP}|$IP|g" "$FILE"
16+
17+
echo "Replaced \${REPLACE_IP} with $IP in $FILE"

yscope-k8s/templates/object-store/bucket-creation.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
apiVersion: "batch/v1"
21
kind: "Job"
32
metadata:
43
name: "bucket-creation"

yscope-k8s/templates/object-store/minio.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
apiVersion: "v1"
21
kind: "Pod"
32
metadata:
43
labels:

yscope-k8s/templates/presto/presto-coordinator.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ metadata:
66
name: "{{ .Values.presto.coordinator.serviceName }}"
77
spec:
88
initContainers:
9-
# - name: "start-clp-package"
10-
#image: "busybox"
11-
#command: "/scripts/start-clp-package.sh"
129
- name: "generate-configs"
1310
image: "busybox"
1411
command: ["/scripts/generate-configs.sh"]
@@ -37,7 +34,6 @@ spec:
3734
- name: "presto-coordinator-config-volume"
3835
configMap:
3936
name: "presto-coordinator-config"
40-
# TODO: add CLP data directory volume host path
4137
- name: "clp-archives-volume"
4238
hostPath:
4339
path: "/var/data/archives"

0 commit comments

Comments
 (0)