Skip to content

Commit 3096f23

Browse files
authored
Port to github (#3)
* Port to github. - magic commands to connect to graph endpoints using gremlinpython for TinkerPop and SPARQLWrapper/requests for SPARQL - magic commands for connecting to Neptune-specific api paths - custom widget for visualizing graph results. - premade starter notebooks to walk through notebook functionality - seed datasets to load data into Tinkerpop or SPARQL for trying out graph Co-authored-by: Austin Kline <austinkline@>
1 parent 5e8fc66 commit 3096f23

File tree

232 files changed

+213815
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+213815
-7
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Bug report
3+
4+
about: Create a report to help us improve
5+
6+
title: "[BUG] Summarize the issue in a few words here"
7+
8+
labels: bug
9+
10+
assignees: 'austinkline'
11+
12+
---
13+
14+
**Describe the bug**
15+
A clear and concise description of what the bug is.
16+
17+
**To Reproduce**
18+
Steps to reproduce the behavior:
19+
1. Go to '...'
20+
2. Click on '....'
21+
3. Scroll down to '....'
22+
4. See error
23+
24+
**Expected behavior**
25+
A clear and concise description of what you expected to happen.
26+
27+
**Screenshots**
28+
If applicable, add screenshots to help explain your problem.
29+
30+
**Desktop (please complete the following information):**
31+
- OS: [e.g. iOS]
32+
- Browser [e.g. chrome, safari]
33+
- Version [e.g. 22]
34+
35+
**Additional context**
36+
Add any other context about the problem here.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Feature request
3+
4+
about: Suggest an idea for this project
5+
6+
title: ''
7+
8+
labels: ''
9+
10+
assignees: ''
11+
12+
---
13+
14+
**Is your feature request related to a problem? Please describe.**
15+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
16+
17+
**Describe the solution you'd like**
18+
A clear and concise description of what you want to happen.
19+
20+
**Describe alternatives you've considered**
21+
A clear and concise description of any alternative solutions or features you've considered.
22+
23+
**Additional context**
24+
Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Issue #, if available:
2+
3+
Description of changes:
4+
5+
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

.github/workflows/integration.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Integration Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
generate-stack-name:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
stack-name: ${{ steps.generate-stack-name.outputs.stack-name }}
16+
steps:
17+
- name: Generate Stack Name
18+
id: generate-stack-name
19+
run: echo "::set-output name=stack-name::$(echo graph-notebook-$RANDOM)"
20+
shell: bash
21+
create-stack:
22+
runs-on: ubuntu-latest
23+
needs: generate-stack-name
24+
steps:
25+
- name: Set up Python 3.6
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: 3.6
29+
- name: Configure AWS Credentials
30+
uses: aws-actions/configure-aws-credentials@v1
31+
with:
32+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
33+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
34+
aws-region: us-east-1
35+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
36+
role-duration-seconds: 3600
37+
role-session-name: IntegrationTestRunner
38+
- uses: actions/checkout@v2
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
pip install flake8 pytest
43+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
44+
- name: Install
45+
run: |
46+
pip install .
47+
- name: Create Stack
48+
id: create-stack
49+
run: |
50+
python test/integration/NeptuneIntegrationWorkflowSteps.py \
51+
create-cfn-stack \
52+
--cfn-stack-name ${{ needs.generate-stack-name.outputs.stack-name }} \
53+
--cfn-template-url ${{ secrets.CFN_TEMPLATE_URL }} \
54+
--cfn-s3-bucket ${{ secrets.INTEG_CFN_S3_BUCKET }} \
55+
--cfn-runner-role ${{ secrets.CFN_ROLE }} \
56+
--aws-region ${{ secrets.AWS_REGION }}
57+
run-tests:
58+
runs-on: ubuntu-latest
59+
needs: [generate-stack-name, create-stack]
60+
steps:
61+
- name: Set up Python 3.6
62+
uses: actions/setup-python@v2
63+
with:
64+
python-version: 3.6
65+
- name: Configure AWS Credentials
66+
uses: aws-actions/configure-aws-credentials@v1
67+
with:
68+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
69+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
70+
aws-region: us-east-1
71+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
72+
role-duration-seconds: 3600
73+
role-session-name: IntegrationTestRunner
74+
- uses: actions/checkout@v2
75+
- name: Install dependencies
76+
run: |
77+
python -m pip install --upgrade pip
78+
pip install flake8 pytest
79+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
80+
- name: Install
81+
run: |
82+
pip install .
83+
- name: Give user /etc/hosts permission
84+
run: |
85+
sudo chmod 777 /etc/hosts
86+
- name: Run Basic Tests
87+
run: |
88+
python test/integration/NeptuneIntegrationWorkflowSteps.py \
89+
run-tests \
90+
--pattern "*without_iam.py" \
91+
--cfn-stack-name ${{ needs.generate-stack-name.outputs.stack-name }} \
92+
--aws-region ${{ secrets.AWS_REGION }}
93+
- name: Run Networkx Tests
94+
run: |
95+
python test/integration/NeptuneIntegrationWorkflowSteps.py \
96+
run-tests \
97+
--pattern "*network*.py" \
98+
--cfn-stack-name ${{ needs.generate-stack-name.outputs.stack-name }} \
99+
--aws-region ${{ secrets.AWS_REGION }}
100+
- name: Run IAM Tests
101+
run: |
102+
python test/integration/NeptuneIntegrationWorkflowSteps.py \
103+
run-tests \
104+
--pattern "*with_iam.py" \
105+
--iam \
106+
--cfn-stack-name ${{ needs.generate-stack-name.outputs.stack-name }} \
107+
--aws-region ${{ secrets.AWS_REGION }}
108+
- name: Cleanup
109+
run: |
110+
python test/integration/NeptuneIntegrationWorkflowSteps.py \
111+
delete-cfn-stack \
112+
--cfn-stack-name ${{ needs.generate-stack-name.outputs.stack-name }} \
113+
--aws-region ${{ secrets.AWS_REGION }}

.github/workflows/unit.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Unit Tests
2+
3+
on: [push]
4+
5+
jobs:
6+
unit-tests:
7+
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Set up Python 3.6
12+
uses: actions/setup-python@v2
13+
with:
14+
python-version: 3.6
15+
- name: Install dependencies
16+
run: |
17+
python -m pip install --upgrade pip
18+
pip install flake8 pytest
19+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
20+
- name: Lint with flake8
21+
run: |
22+
# stop the build if there are Python syntax errors or undefined names
23+
flake8 ./src --count --select=E9,F63,F7,F82 --show-source --statistics
24+
flake8 ./test --max-complexity 10 --ignore E501,C901,W291 --show-source --statistics
25+
26+
- name: Install
27+
run: |
28+
pip install .
29+
- name: Test with pytest
30+
run: |
31+
pytest

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# IDE directories
2+
.vscode
3+
.idea
4+
**/.DS_Store
5+
6+
# python-generated directories
7+
venv
8+
**/__pycache__
9+
.pytest_cache
10+
src/graph_notebook.egg-info
11+
**.pyc
12+
build
13+
dist
14+
15+
MANIFEST
16+
17+
# do not include widget typescript output directories
18+
src/graph_notebook/widgets/dist/
19+
src/graph_notebook/widgets/docs/
20+
src/graph_notebook/widgets/labextension/
21+
src/graph_notebook/widgets/nbextension/
22+
src/graph_notebook/widgets/node_modules/
23+
src/graph_notebook/widgets/lib/
24+
25+
# npm
26+
node_modules/
27+
node_modules/.package-lock.json

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ reported the issue. Please try to include as much information as you can. Detail
2323
## Contributing via Pull Requests
2424
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
2525

26-
1. You are working against the latest source on the *master* branch.
26+
1. You are working against the latest source on the *main* branch.
2727
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
2828
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
2929

LICENSE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,5 @@
173173
defend, and hold each Contributor harmless for any liability
174174
incurred by, or claims asserted against, such Contributor by reason
175175
of your accepting any such warranty or additional liability.
176+
177+
END OF TERMS AND CONDITIONS

MANIFEST.in

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
include tsconfig.json
2+
include package.json
3+
include webpack.config.js
4+
include src/graph_notebook/widgets/labextension/*.tgz
5+
6+
# Javascript files
7+
graft graph_notebook/widgets/nbextension
8+
graft graph_notebook/widgets/labextension
9+
graft graph_notebook/widgets/src
10+
graft graph_notebook/widgets/css
11+
graft **/node_modules
12+
prune coverage
13+
14+
# Patterns to exclude from any directory
15+
global-exclude *~
16+
global-exclude *.pyc
17+
global-exclude *.pyo
18+
global-exclude .git
19+
global-exclude .ipynb_checkpoints

NOTICE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+

0 commit comments

Comments
 (0)