-
Notifications
You must be signed in to change notification settings - Fork 846
TINKERPOP-2995 Create Sample Applications in each GLV #2298
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
Merged
Merged
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
c34b5c8
Create GLV sample applications
ryn5 2e2bbfa
Remove redundant Java imports
ryn5 4fee2e1
Update license
ryn5 5500124
Add async/await examples to .net
ryn5 598ce6b
Delete .gitignore in dotnet
ryn5 4e2261f
Declare each connection separately and comment extras
ryn5 3b2b3c2
Split examples into separate files
ryn5 59c2abc
Add license
ryn5 5450f33
Rename JS files
ryn5 fe42586
Add simple query and prints to all connections
ryn5 1025df2
Edit function names to follow convention
ryn5 f3dfb9b
Minor fixes
ryn5 bb6bdf5
Minor edits
ryn5 b644876
Improve connections example outputs
ryn5 937d1fb
Remove configs file connection example
ryn5 1ddcb26
Bash script to run examples
ryn5 64ad25b
Create pom.xml
ryn5 6e6a8fa
Add cleanup comment
ryn5 a34dbc6
Fix hanging connections issue by closing clusters
ryn5 c1d9ae4
Update script
ryn5 f76a3c5
Update versioning
ryn5 e9e5f9d
Create GLV sample applications
ryn5 4eba0dd
Remove redundant Java imports
ryn5 4d4a3a0
Update license
ryn5 6062e92
Add async/await examples to .net
ryn5 1941603
Delete .gitignore in dotnet
ryn5 fe8c8e3
Declare each connection separately and comment extras
ryn5 94a356e
Split examples into separate files
ryn5 5251284
Add license
ryn5 743370b
Rename JS files
ryn5 60b0b80
Add simple query and prints to all connections
ryn5 8020ec5
Edit function names to follow convention
ryn5 da5ba95
Minor fixes
ryn5 ffbb35b
Minor edits
ryn5 72df20c
Improve connections example outputs
ryn5 3f5780f
Remove configs file connection example
ryn5 e8fc7c9
Bash script to run examples
ryn5 fe1cc20
Create pom.xml
ryn5 311a221
Add cleanup comment
ryn5 8b408d8
Fix hanging connections issue by closing clusters
ryn5 5599e3d
Update script
ryn5 78caf91
Update versioning
ryn5 e1adeb1
Merge branch 'ryan/glv-examples' of https://github.com/Bit-Quill/tink…
ryn5 fab1645
Update versioning
ryn5 052029a
Remove image version, add warning
ryn5 0d67396
Update release notes
ryn5 cd05624
Write docs for examples
ryn5 eae6b75
Move script to bin
ryn5 d7e30f3
Stop generating reduced pom
ryn5 ff2f6fd
Add exit trap to close containers
ryn5 37855bf
Delete dependency-reduced-pom.xml
ryn5 ac792a3
Update run command
ryn5 0a47f61
Add licenses
ryn5 d0d65e5
Update pom versioning
ryn5 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 hidden or 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,119 @@ | ||
| #!/bin/bash | ||
|
|
||
| #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. | ||
|
|
||
| function cleanup { | ||
| if [ -n "$(docker ps -q -f name=glv-examples)" ] | ||
| then | ||
| echo -n "Shutting down container: " | ||
| docker stop glv-examples | ||
| fi | ||
| if [ -n "$(docker ps -q -f name=glv-examples-modern)" ] | ||
| then | ||
| echo -n "Shutting down container: " | ||
| docker stop glv-examples-modern | ||
| fi | ||
| } | ||
| trap cleanup EXIT | ||
|
|
||
| open -a Docker | ||
| docker pull tinkerpop/gremlin-server | ||
| docker run -d --rm -p 8182:8182 --name glv-examples --health-cmd="curl -f http://localhost:8182/ || exit 1" --health-interval=5s --health-timeout=3s tinkerpop/gremlin-server | ||
|
|
||
| echo | ||
| echo "Not having docker open initially may cause an error loop. If so, simply restart this script." | ||
| echo -n "Starting Gremlin server on port 8182..." | ||
| until docker inspect --format '{{.State.Health.Status}}' glv-examples | grep -q "healthy"; do | ||
| echo -n "." | ||
| sleep 1 | ||
| done | ||
| echo | ||
|
|
||
| cd ../gremlin-driver/src/main/java/examples || exit | ||
| mvn clean install | ||
|
|
||
| echo | ||
| echo "Running Java examples" | ||
| java -cp target/run-examples-shaded.jar examples.Connections | ||
| java -cp target/run-examples-shaded.jar examples.BasicGremlin | ||
| cd ../../../../.. || exit | ||
|
|
||
| echo | ||
| echo "Running python examples:" | ||
| python3 gremlin-python/src/main/python/examples/connections.py | ||
| python3 gremlin-python/src/main/python/examples/basic_gremlin.py | ||
|
|
||
| echo | ||
| echo "Running JavaScript examples:" | ||
| npm install --prefix gremlin-javascript/examples | ||
| node gremlin-javascript/examples/connections.js | ||
| node gremlin-javascript/examples/basic-gremlin.js | ||
|
|
||
| echo | ||
| echo "Running .NET examples:" | ||
| dotnet run --project gremlin-dotnet/Examples/Connections | ||
| dotnet run --project gremlin-dotnet/Examples/BasicGremlin | ||
|
|
||
| echo | ||
| echo "Running Go examples:" | ||
| cd gremlin-go/examples || exit | ||
| go run connections.go | ||
| go run basic_gremlin.go | ||
| cd ../.. || exit | ||
|
|
||
| echo | ||
| echo -n "Shutting down container: " | ||
| docker stop glv-examples | ||
|
|
||
| echo | ||
| docker run -d --rm -p 8182:8182 --name glv-examples-modern --health-cmd="curl -f http://localhost:8182/ || exit 1" --health-interval=5s --health-timeout=3s tinkerpop/gremlin-server conf/gremlin-server-modern.yaml | ||
| echo -n "Starting Modern server on port 8182..." | ||
| until docker inspect --format '{{.State.Health.Status}}' glv-examples-modern | grep -q "healthy"; do | ||
| echo -n "." | ||
| sleep 1 | ||
| done | ||
| echo | ||
|
|
||
| echo | ||
| echo "Running Java traversals" | ||
| cd gremlin-driver/src/main/java/examples || exit | ||
| java -cp target/run-examples-shaded.jar examples.ModernTraversals | ||
| cd ../../../../.. || exit | ||
|
|
||
| echo | ||
| echo "Running python traversals:" | ||
| python3 gremlin-python/src/main/python/examples/modern_traversals.py | ||
|
|
||
| echo | ||
| echo "Running JavaScript traversals:" | ||
| npm install --prefix gremlin-javascript/examples | ||
| node gremlin-javascript/examples/modern-traversals.js | ||
|
|
||
| echo | ||
| echo "Running .NET traversals:" | ||
| dotnet run --project gremlin-dotnet/Examples/ModernTraversals | ||
|
|
||
| echo | ||
| echo "Running Go traversals:" | ||
| cd gremlin-go/examples || exit | ||
| go run modern_traversals.go | ||
| cd ../.. || exit | ||
|
|
||
| echo | ||
| echo -n "Shutting down container: " | ||
| docker stop glv-examples-modern |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.