Implement Docker image (#7)
Browse files- .github/workflows/ci-cd.yaml +60 -1
- .lycheeignore +1 -0
- Dockerfile +20 -0
- README.md +57 -1
- german-greek-latin.png +0 -0
- neo4j-docker-connect.png +0 -0
.github/workflows/ci-cd.yaml
CHANGED
@@ -24,6 +24,7 @@ jobs:
|
|
24 |
yml-md-style-and-link-checks:
|
25 |
uses: QubitPi/hashistack/.github/workflows/yml-md-style-and-link-checks.yml@master
|
26 |
with:
|
|
|
27 |
use-custom-yamllint-config-file: true
|
28 |
use-custom-markdownlint-config-file: true
|
29 |
|
@@ -71,9 +72,67 @@ jobs:
|
|
71 |
NEO4J_USERNAME: not used
|
72 |
NEO4J_PASSWORD: not used
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
cleanup-neo4j:
|
75 |
if: github.ref == 'refs/heads/master'
|
76 |
-
needs: tests
|
77 |
runs-on: ubuntu-latest
|
78 |
steps:
|
79 |
- uses: actions/checkout@v3
|
|
|
24 |
yml-md-style-and-link-checks:
|
25 |
uses: QubitPi/hashistack/.github/workflows/yml-md-style-and-link-checks.yml@master
|
26 |
with:
|
27 |
+
use-custom-lycheeignore-file: true
|
28 |
use-custom-yamllint-config-file: true
|
29 |
use-custom-markdownlint-config-file: true
|
30 |
|
|
|
72 |
NEO4J_USERNAME: not used
|
73 |
NEO4J_PASSWORD: not used
|
74 |
|
75 |
+
docker:
|
76 |
+
name: Test Docker build and publish image to DockerHub
|
77 |
+
needs: yml-md-style-and-link-checks
|
78 |
+
runs-on: ubuntu-latest
|
79 |
+
steps:
|
80 |
+
- uses: actions/checkout@v3
|
81 |
+
with:
|
82 |
+
fetch-depth: 0
|
83 |
+
- name: Set up Python 3.10
|
84 |
+
uses: actions/setup-python@v4
|
85 |
+
with:
|
86 |
+
python-version: "3.10"
|
87 |
+
- name: Startup a Neo4J database
|
88 |
+
run: docker run --publish=7474:7474 --publish=7687:7687 --env=NEO4J_AUTH=none --name data-loader --env=NEO4J_ACCEPT_LICENSE_AGREEMENT=yes neo4j:5.23.0-enterprise &
|
89 |
+
- name: Wait for database to be ready
|
90 |
+
uses: iFaxity/wait-on-action@v1
|
91 |
+
with:
|
92 |
+
resource: http://localhost:7474
|
93 |
+
- name: Load all languages into the intermediate container
|
94 |
+
run: |
|
95 |
+
pip3 install --upgrade --force-reinstall wilhelm-python-sdk
|
96 |
+
python3 .github/load_german.py
|
97 |
+
python3 .github/load_ancient_greek.py
|
98 |
+
python3 .github/load_latin.py
|
99 |
+
env:
|
100 |
+
NEO4J_URI: neo4j://localhost:7687
|
101 |
+
NEO4J_DATABASE: neo4j
|
102 |
+
NEO4J_USERNAME: not used
|
103 |
+
NEO4J_PASSWORD: not used
|
104 |
+
- name: Copy over data onto host
|
105 |
+
run: docker cp data-loader:/data .
|
106 |
+
- name: Test image build
|
107 |
+
uses: docker/build-push-action@v3
|
108 |
+
with:
|
109 |
+
context: .
|
110 |
+
push: false
|
111 |
+
- name: Login to DockerHub
|
112 |
+
if: github.ref == 'refs/heads/master'
|
113 |
+
uses: docker/login-action@v2
|
114 |
+
with:
|
115 |
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
116 |
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
117 |
+
- name: Push image to DockerHub
|
118 |
+
if: github.ref == 'refs/heads/master'
|
119 |
+
uses: docker/build-push-action@v3
|
120 |
+
with:
|
121 |
+
context: .
|
122 |
+
push: true
|
123 |
+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/wilhelm-vocabulary:latest
|
124 |
+
- name: Push image Description
|
125 |
+
if: github.ref == 'refs/heads/master'
|
126 |
+
uses: peter-evans/dockerhub-description@v4
|
127 |
+
with:
|
128 |
+
username: jack20191124
|
129 |
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
130 |
+
repository: ${{ secrets.DOCKERHUB_USERNAME }}/wilhelm-vocabulary
|
131 |
+
readme-filepath: README.md
|
132 |
+
|
133 |
cleanup-neo4j:
|
134 |
if: github.ref == 'refs/heads/master'
|
135 |
+
needs: [tests, docker]
|
136 |
runs-on: ubuntu-latest
|
137 |
steps:
|
138 |
- uses: actions/checkout@v3
|
.lycheeignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
http://localhost:7474
|
Dockerfile
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright Jiaqi Liu
|
2 |
+
#
|
3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4 |
+
# you may not use this file except in compliance with the License.
|
5 |
+
# You may obtain a copy of the License at
|
6 |
+
#
|
7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8 |
+
#
|
9 |
+
# Unless required by applicable law or agreed to in writing, software
|
10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 |
+
# See the License for the specific language governing permissions and
|
13 |
+
# limitations under the License.
|
14 |
+
FROM neo4j:5.23.0-enterprise
|
15 |
+
|
16 |
+
LABEL maintainer="Jiaqi (Jack) Liu"
|
17 |
+
LABEL maintainer-email="jack20220723@gmail.com"
|
18 |
+
|
19 |
+
RUN rm -rf /var/lib/neo4j/data
|
20 |
+
COPY data/ /var/lib/neo4j/data
|
README.md
CHANGED
@@ -2,8 +2,36 @@ Wilhelm Vocabulary
|
|
2 |
==================
|
3 |
|
4 |
[![GitHub workflow status badge][GitHub workflow status badge]][GitHub workflow status URL]
|
|
|
5 |
[![Apache License Badge]][Apache License, Version 2.0]
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
Data Format
|
8 |
-----------
|
9 |
|
@@ -135,7 +163,32 @@ the German noun "[Ecke](https://en.wiktionary.org/wiki/Ecke#Noun)" has at least
|
|
135 |
|
136 |
### Docker
|
137 |
|
138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
|
140 |
#### Interesting Queries
|
141 |
|
@@ -411,5 +464,8 @@ The use and distribution terms for [wilhelm-vocabulary]() are covered by the [Ap
|
|
411 |
[Apache License Badge]: https://img.shields.io/badge/Apache%202.0-F25910.svg?style=for-the-badge&logo=Apache&logoColor=white
|
412 |
[Apache License, Version 2.0]: https://www.apache.org/licenses/LICENSE-2.0
|
413 |
|
|
|
|
|
|
|
414 |
[GitHub workflow status badge]: https://img.shields.io/github/actions/workflow/status/QubitPi/wilhelm-vocabulary/ci-cd.yaml?branch=master&style=for-the-badge&logo=github&logoColor=white&label=Database%20Loading
|
415 |
[GitHub workflow status URL]: https://github.com/QubitPi/wilhelm-vocabulary/actions/workflows/ci-cd.yaml
|
|
|
2 |
==================
|
3 |
|
4 |
[![GitHub workflow status badge][GitHub workflow status badge]][GitHub workflow status URL]
|
5 |
+
[![Docker Hub][Docker Hub badge]][Docker Hub URL]
|
6 |
[![Apache License Badge]][Apache License, Version 2.0]
|
7 |
|
8 |
+
<!-- TOC -->
|
9 |
+
|
10 |
+
- [Wilhelm Vocabulary](#wilhelm-vocabulary)
|
11 |
+
- [Data Format](#data-format)
|
12 |
+
- [Encoding Table in YAML](#encoding-table-in-yaml)
|
13 |
+
- [Data Pipeline](#data-pipeline)
|
14 |
+
- [How Data (Vocabulary) is Stored in a Graph Database](#how-data-vocabulary-is-stored-in-a-graph-database)
|
15 |
+
- [Why Graph Database](#why-graph-database)
|
16 |
+
- [Base Schema](#base-schema)
|
17 |
+
- [Docker](#docker)
|
18 |
+
- [Interesting Queries](#interesting-queries)
|
19 |
+
- [Languages](#languages)
|
20 |
+
- [German](#german)
|
21 |
+
- [Noun Declension](#noun-declension)
|
22 |
+
- [Declension Template](#declension-template)
|
23 |
+
- [Ancient Greek](#ancient-greek)
|
24 |
+
- [Diacritic Mark Convention](#diacritic-mark-convention)
|
25 |
+
- [Noun Declension](#noun-declension-1)
|
26 |
+
- [Adjective Declension](#adjective-declension)
|
27 |
+
- [Verb Conjugation](#verb-conjugation)
|
28 |
+
- [Latin](#latin)
|
29 |
+
- [Classical Hebrew (Coming Soon)](#classical-hebrew-coming-soon)
|
30 |
+
- [Korean](#korean)
|
31 |
+
- [License](#license)
|
32 |
+
|
33 |
+
<!-- TOC -->
|
34 |
+
|
35 |
Data Format
|
36 |
-----------
|
37 |
|
|
|
163 |
|
164 |
### Docker
|
165 |
|
166 |
+
A Docker image has been made to allow us to explore the vocabulary in Neo4J browser backed by a Neo4J database in
|
167 |
+
container. To get the image and run the container, simply do:
|
168 |
+
|
169 |
+
```console
|
170 |
+
docker run \
|
171 |
+
--publish=7474:7474 \
|
172 |
+
--publish=7687:7687 \
|
173 |
+
--env=NEO4J_AUTH=none \
|
174 |
+
--env=NEO4J_ACCEPT_LICENSE_AGREEMENT=yes \
|
175 |
+
-e NEO4JLABS_PLUGINS=\[\"apoc\"\] \
|
176 |
+
jack20191124/wilhelm-vocabulary
|
177 |
+
```
|
178 |
+
|
179 |
+
> [!NOTE]
|
180 |
+
>
|
181 |
+
> The image is based on Neo4J Enterprise 5.23.0.
|
182 |
+
|
183 |
+
- When container starts, access neo4j through browser at http://localhost:7474
|
184 |
+
- Both __bolt://__ and __neo4j://__ protocols are fine.
|
185 |
+
- Choose __No authentication__ for _Authentication type_
|
186 |
+
- Then hit __Connect__ as shown below
|
187 |
+
|
188 |
+
![Connecting to Neo4J Docker](./neo4j-docker-connect.png "Error loading neo4j-docker-connect.png")
|
189 |
+
|
190 |
+
We have offered some queries that can be used to quickly explore our language data in the
|
191 |
+
[next section](#interesting-queries)
|
192 |
|
193 |
#### Interesting Queries
|
194 |
|
|
|
464 |
[Apache License Badge]: https://img.shields.io/badge/Apache%202.0-F25910.svg?style=for-the-badge&logo=Apache&logoColor=white
|
465 |
[Apache License, Version 2.0]: https://www.apache.org/licenses/LICENSE-2.0
|
466 |
|
467 |
+
[Docker Hub badge]: https://img.shields.io/badge/DockerHub-2596EC?style=for-the-badge&logo=docker&logoColor=white
|
468 |
+
[Docker Hub URL]: https://hub.docker.com/r/jack20191124/wilhelm-vocabulary
|
469 |
+
|
470 |
[GitHub workflow status badge]: https://img.shields.io/github/actions/workflow/status/QubitPi/wilhelm-vocabulary/ci-cd.yaml?branch=master&style=for-the-badge&logo=github&logoColor=white&label=Database%20Loading
|
471 |
[GitHub workflow status URL]: https://github.com/QubitPi/wilhelm-vocabulary/actions/workflows/ci-cd.yaml
|
german-greek-latin.png
CHANGED
neo4j-docker-connect.png
ADDED