-
Notifications
You must be signed in to change notification settings - Fork 150
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
Add docker playground to practice tutorials #258
Open
sagarlakshmipathy
wants to merge
2
commits into
main
Choose a base branch
from
257-add-docker-playground
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 @@ | ||
FROM bitnami/spark:3.2.4 | ||
|
||
USER root | ||
|
||
# Install vim and cd to onetable | ||
RUN apt-get update \ | ||
&& apt-get install -y vim \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& mkdir -p /home/onetable \ | ||
&& chmod -R 777 /home/onetable | ||
|
||
WORKDIR /home/onetable |
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,10 +1,11 @@ | ||
#!/bin/bash | ||
# Create the require jars for the demo and copy them into a directory we'll mount in our notebook container | ||
cd .. && mvn install -am -pl core -DskipTests -T 2 | ||
# Create the require jars for the demo and copy them into a directory we'll mount in our notebook & spark container | ||
cd .. && mvn install -DskipTests -T 2 | ||
mkdir -p demo/jars | ||
cp hudi-support/utils/target/hudi-utils-0.1.0-SNAPSHOT.jar demo/jars | ||
cp api/target/onetable-api-0.1.0-SNAPSHOT.jar demo/jars | ||
cp core/target/onetable-core-0.1.0-SNAPSHOT.jar demo/jars | ||
cp utilities/target/utilities-0.1.0-SNAPSHOT-bundled.jar demo/jars | ||
|
||
cd demo | ||
docker-compose up |
File renamed without changes.
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,36 @@ | ||
--- | ||
sidebar_position: 2 | ||
title: "Docker Playground" | ||
--- | ||
|
||
# OneTable Playground | ||
This playground helps you install and work with OneTable in a dockerized environment. | ||
|
||
## Pre-requisites | ||
* Install Docker in your local machine | ||
* Clone [OneTable GitHub repository](https://github.com/onetable-io/onetable) | ||
|
||
:::note NOTE: | ||
This demo was tested in AArch64 based macOS operating system | ||
::: | ||
|
||
## Setting up the playground | ||
After cloning the OneTable repository, change directory to `demo` and run the `start_demo.sh` script. | ||
This script builds OneTable jars required for the demo and then spins up docker containers to start a Spark cluster, | ||
Jupyter notebook with Scala interpreter, Hive Metastore, Presto and Trino. | ||
|
||
```shell md title="shell" | ||
cd demo | ||
./start_demo.sh | ||
``` | ||
|
||
### Accessing the Spark cluster | ||
You can access the Spark master by running `docker exec -it demo-spark-master-1 /bin/bash` in a separate terminal window. | ||
This will open the master node in a bash shell and will initially take you to `/home/onetable` directory. | ||
|
||
### Running the tutorial | ||
Once inside the master node, you can follow the [Creating your first interoperable table](/docs/how-to#steps) tutorial. | ||
|
||
To run sync, from the same directory, you can create the my_config.yaml file using `vi my_config.yaml` command and copy-paste | ||
the contents from the [run sync](/docs/how-to#running-sync) section and then | ||
run the `java -jar utilities/target/utilities-0.1.0-SNAPSHOT-bundled.jar --datasetConfig my_config.yaml` command. |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We can run spark from the notebook currently, should we just do that?
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.
Leaving this PR open until I could confirm quickstart examples on the demo jupyter notebook works seamlessly.