-
Notifications
You must be signed in to change notification settings - Fork 4
docs: Add k8s setup instructions. #28
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
base: release-0.293-clp-connector
Are you sure you want to change the base?
Changes from 1 commit
5f0eb8c
5bae0ce
c82f6eb
ba8cdf6
80ec62d
e40f329
6cafbfc
17d7d31
8aa5cc1
c8666a4
d730404
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,223 @@ | ||||||||||||||||||||||
| # Setup | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Dependency Installation | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ### Install docker | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Follow the guide here: [docker] | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ### Install kubectl | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| `kubectl` is the command-line tool for interacting with Kubernetes clusters. You will use it to | ||||||||||||||||||||||
| manage and inspect your k3d cluster. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Follow the guide here: [kubectl] | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ### Install k3d | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| k3d is a lightweight wrapper to run k3s (Rancher Lab's minimal Kubernetes distribution) in docker. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Follow the guide here: [k3d] | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ### Runbook | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Import the images and apply them to the cluster: | ||||||||||||||||||||||
| ```shell | ||||||||||||||||||||||
| # Create a cluster called presto | ||||||||||||||||||||||
| # There should be two directories under /path/to/host/configs/: | ||||||||||||||||||||||
| # - /path/to/host/configs/etc-coordinator: | ||||||||||||||||||||||
| # - /path/to/host/configs/etc-coordinator/catalog/clp.properties | ||||||||||||||||||||||
| # - /path/to/host/configs/etc-coordinator/config.properties | ||||||||||||||||||||||
| # - /path/to/host/configs/etc-coordinator/jvm.config | ||||||||||||||||||||||
| # - /path/to/host/configs/etc-coordinator/log.properties | ||||||||||||||||||||||
| # - /path/to/host/configs/etc-coordinator/metadata-filter.json | ||||||||||||||||||||||
| # - /path/to/host/configs/etc-coordinator/node.properties | ||||||||||||||||||||||
| # | ||||||||||||||||||||||
| # - /path/to/host/configs/etc-worker: | ||||||||||||||||||||||
| # - /path/to/host/configs/etc-worker/catalog/clp.properties | ||||||||||||||||||||||
| # - /path/to/host/configs/etc-worker/config.properties | ||||||||||||||||||||||
| # - /path/to/host/configs/etc-worker/node.properties | ||||||||||||||||||||||
| # - /path/to/host/configs/etc-worker/velox.properties | ||||||||||||||||||||||
| # | ||||||||||||||||||||||
| # There will be examples of these config files in the following sections | ||||||||||||||||||||||
| k3d cluster create presto --servers 1 --agents 1 -v /path/to/host/configs/:/configs | ||||||||||||||||||||||
| # Load the coordinator image | ||||||||||||||||||||||
| k3d image import ghcr.io/y-scope/yscope-presto-with-clp-connector-coordinator:latest -c presto | ||||||||||||||||||||||
| # Load the worker image | ||||||||||||||||||||||
| k3d image import ghcr.io/y-scope/yscope-presto-with-clp-connector-worker:latest -c presto | ||||||||||||||||||||||
| # Launch the container | ||||||||||||||||||||||
| kubectl apply -f coordinator.yaml worker.yaml | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| To do a sanity check: | ||||||||||||||||||||||
| ```shell | ||||||||||||||||||||||
| kubectl port-forward svc/presto-coordinator 8080:8080 | ||||||||||||||||||||||
| # Check is coordinator alive | ||||||||||||||||||||||
| curl -X GET http://coordinator:8080/v1/info | ||||||||||||||||||||||
| # Check is worker connected to the coordinator | ||||||||||||||||||||||
| curl -X GET http://coordinator:8080/v1/nodes | ||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainService name mismatch breaks the port-forward sanity-check The manifest defines the Service as -kubectl port-forward svc/presto-coordinator 8080:8080
-# Check is coordinator alive
-curl -X GET http://coordinator:8080/v1/info
-# Check is worker connected to the coordinator
-curl -X GET http://coordinator:8080/v1/nodes
+kubectl port-forward svc/coordinator 8080:8080
+# Verify coordinator is alive
+curl -X GET http://localhost:8080/v1/info
+# Verify workers are registered
+curl -X GET http://localhost:8080/v1/nodesAlso consider renaming the Service in the YAML to Also applies to: 84-88 To confirm the Service name defined in your Kubernetes manifest, let’s search for all Service resources under yscope-k8s: 🏁 Script executed: #!/bin/bash
# List all Service definitions and their names in the yscope-k8s directory
rg -n "kind: Service" -A5 yscope-k8sLength of output: 263 Let’s verify the actual Kubernetes Service resource names in your manifests (not just the README) under 🏁 Script executed: #!/bin/bash
# Search for Service definitions in all YAML files under yscope-k8s
rg -n "kind: Service" -A5 yscope-k8s --glob '*.yaml'Length of output: 54 To locate where your Kubernetes Service manifests are defined, let’s list all YAML files under 🏁 Script executed: #!/bin/bash
# Find all Kubernetes manifest files under yscope-k8s
find yscope-k8s -type f \( -iname '*.yaml' -o -iname '*.yml' \)Length of output: 67 Align README port-forward commands with the Service name The Service in your README snippet is defined as • File: yscope-k8s/README.md - kubectl port-forward svc/presto-coordinator 8080:8080
- # Check is coordinator alive
- curl -X GET http://coordinator:8080/v1/info
- # Check is worker connected to the coordinator
- curl -X GET http://coordinator:8080/v1/nodes
+ kubectl port-forward svc/coordinator 8080:8080
+ # Verify coordinator is alive
+ curl -X GET http://localhost:8080/v1/info
+ # Verify workers are registered
+ curl -X GET http://localhost:8080/v1/nodesAlternatively, if you prefer the Service to be named 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Example Configs for Coordinator | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Example of k8s image YAML: | ||||||||||||||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||
| ```yaml | ||||||||||||||||||||||
| apiVersion: v1 | ||||||||||||||||||||||
| kind: Pod | ||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||
| labels: | ||||||||||||||||||||||
| app: coordinator | ||||||||||||||||||||||
| name: coordinator | ||||||||||||||||||||||
| spec: | ||||||||||||||||||||||
| containers: | ||||||||||||||||||||||
| - name: coordinator | ||||||||||||||||||||||
| image: ghcr.io/y-scope/yscope-0.293-coordinator:latest | ||||||||||||||||||||||
| imagePullPolicy: Never | ||||||||||||||||||||||
| volumeMounts: | ||||||||||||||||||||||
| - name: "coordinator-config" | ||||||||||||||||||||||
| mountPath: "/opt/presto-server/etc" | ||||||||||||||||||||||
| volumes: | ||||||||||||||||||||||
| - name: "coordinator-config" | ||||||||||||||||||||||
| hostPath: | ||||||||||||||||||||||
| path: "/configs/etc-coordinator" | ||||||||||||||||||||||
| --- | ||||||||||||||||||||||
| apiVersion: v1 | ||||||||||||||||||||||
| kind: Service | ||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||
| name: coordinator | ||||||||||||||||||||||
| labels: | ||||||||||||||||||||||
| app: coordinator | ||||||||||||||||||||||
| spec: | ||||||||||||||||||||||
| type: NodePort | ||||||||||||||||||||||
| ports: | ||||||||||||||||||||||
| - port: 8080 | ||||||||||||||||||||||
| nodePort: 30000 | ||||||||||||||||||||||
| name: "8080" | ||||||||||||||||||||||
| selector: | ||||||||||||||||||||||
| app: coordinator | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
Comment on lines
+45
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Minor grammar fix for clarity -mysql … -e "UPDATE clp_datasets SET archive_storage_directory = '/var/data/archives/default';"
+mysql … -e "UPDATE clp_datasets SET archive_storage_directory = '/var/data/archives/default';"
^ add “the”
🧰 Tools🪛 LanguageTool[uncategorized] ~45-~45: Possible missing article found. (AI_HYDRA_LEO_MISSING_THE) 🪛 markdownlint-cli2 (0.17.2)45-45: Ordered list item prefix (MD029, ol-prefix) 45-45: Lists should be surrounded by blank lines (MD032, blanks-around-lists) 46-46: Fenced code blocks should be surrounded by blank lines (MD031, blanks-around-fences) 🤖 Prompt for AI Agents |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||||||||||||||||||
| Example of `/path/to/host/configs/etc-coordinator/catalog/clp.properties` (need to update `clp.metadata-db-*` fields): | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
| connector.name=clp | ||||||||||||||||||||||
| clp.metadata-provider-type=mysql | ||||||||||||||||||||||
| clp.metadata-db-url=jdbc:mysql://REPLACE_ME | ||||||||||||||||||||||
| clp.metadata-db-name=REPLACE_ME | ||||||||||||||||||||||
| clp.metadata-db-user=REPLACE_ME | ||||||||||||||||||||||
| clp.metadata-db-password=REPLACE_ME | ||||||||||||||||||||||
| clp.metadata-table-prefix=clp_ | ||||||||||||||||||||||
| clp.split-provider-type=mysql | ||||||||||||||||||||||
| clp.metadata-filter-config=$(pwd)/etc-coordinator/metadata-filter.json | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Example of `/path/to/host/configs/etc-coordinator/config.properties`: | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
| coordinator=true | ||||||||||||||||||||||
| node-scheduler.include-coordinator=false | ||||||||||||||||||||||
| http-server.http.port=8080 | ||||||||||||||||||||||
| query.max-memory=1GB | ||||||||||||||||||||||
| query.max-memory-per-node=1GB | ||||||||||||||||||||||
| discovery-server.enabled=true | ||||||||||||||||||||||
| discovery.uri=http://localhost:8080 | ||||||||||||||||||||||
| optimizer.optimize-hash-generation=false | ||||||||||||||||||||||
| regex-library=RE2J | ||||||||||||||||||||||
| use-alternative-function-signatures=true | ||||||||||||||||||||||
| inline-sql-functions=false | ||||||||||||||||||||||
| nested-data-serialization-enabled=false | ||||||||||||||||||||||
| native-execution-enabled=true | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Example of `/path/to/host/configs/etc-coordinator/jvm.config`: | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
| -server | ||||||||||||||||||||||
| -Xmx4G | ||||||||||||||||||||||
| -XX:+UseG1GC | ||||||||||||||||||||||
| -XX:G1HeapRegionSize=32M | ||||||||||||||||||||||
| -XX:+UseGCOverheadLimit | ||||||||||||||||||||||
| -XX:+ExplicitGCInvokesConcurrent | ||||||||||||||||||||||
| -XX:+HeapDumpOnOutOfMemoryError | ||||||||||||||||||||||
| -XX:+ExitOnOutOfMemoryError | ||||||||||||||||||||||
| -Djdk.attach.allowAttachSelf=true | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Example of `/path/to/host/configs/etc-coordinator/log.properties`: | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
| com.facebook.presto=DEBUG | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Example of `/path/to/host/configs/etc-coordinator/metadata-filter.json`: | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "clp.default": [ | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "filterName": "msg.timestamp", | ||||||||||||||||||||||
| "rangeMapping": { | ||||||||||||||||||||||
| "lowerBound": "begin_timestamp", | ||||||||||||||||||||||
| "upperBound": "end_timestamp" | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| "required": true | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| ] | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Example of `/path/to/host/configs/etc-coordinator/node.properties`: | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
| node.environment=production | ||||||||||||||||||||||
| node.id=coordinator | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Example Configs for Worker | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Example of k8s image YAML: | ||||||||||||||||||||||
| 🚧This is still in progress. | ||||||||||||||||||||||
| ```yaml | ||||||||||||||||||||||
| apiVersion: v1 | ||||||||||||||||||||||
| kind: Pod | ||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||
| labels: | ||||||||||||||||||||||
| app: worker | ||||||||||||||||||||||
| name: worker | ||||||||||||||||||||||
| spec: | ||||||||||||||||||||||
| containers: | ||||||||||||||||||||||
| - name: worker | ||||||||||||||||||||||
| image: ubuntu:22.04 | ||||||||||||||||||||||
| # imagePullPolicy: Never | ||||||||||||||||||||||
| command: | ||||||||||||||||||||||
| - /bin/bash | ||||||||||||||||||||||
| - -c | ||||||||||||||||||||||
| args: | ||||||||||||||||||||||
| - sleep infinity | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Example of `/path/to/host/configs/etc-worker/catalog/clp.properties`: | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
| connector.name=clp | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
Comment on lines
+88
to
+90
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Add language hint to SQL block The example query lacks a language tag, tripping MD040 and losing syntax highlighting. -```
+```sql
SELECT * FROM default LIMIT 1;In yscope-k8s/README.md around lines 88 to 90, the SQL code block is missing a |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Example of `/path/to/host/configs/etc-worker/config.properties` (need to replace the `presto.version` to make it the same as coordinator`s): | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
| discovery.uri=http://127.0.0.1:8080 | ||||||||||||||||||||||
| presto.version=REPLACE_ME | ||||||||||||||||||||||
| http-server.http.port=7777 | ||||||||||||||||||||||
| shutdown-onset-sec=1 | ||||||||||||||||||||||
| register-test-functions=false | ||||||||||||||||||||||
| runtime-metrics-collection-enabled=false | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Example of `/path/to/host/configs/etc-worker/node.properties`: | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
| node.environment=production | ||||||||||||||||||||||
| node.internal-address=127.0.0.1 | ||||||||||||||||||||||
| node.location=testing-location | ||||||||||||||||||||||
| node.id=worker-1 | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Example of `/path/to/host/configs/etc-worker/velox.properties`: | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
| mutable-config=true | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| [docker]: https://docs.docker.com/engine/install | ||||||||||||||||||||||
| [k3d]: https://k3d.io/stable/#installation | ||||||||||||||||||||||
| [kubectl]: https://kubernetes.io/docs/tasks/tools/#kubectl | ||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Insert blank lines around list items and fenced blocks
Lists (
1.…6.) and the following fencedbashblocks are missing the mandatory blank line before/after, triggering MD031/MD032 and rendering inconsistently.Apply the same pattern to the other ordered-list sections.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
33-33: Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
34-34: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
🤖 Prompt for AI Agents