-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Added documentation for MySQL.
- Loading branch information
1 parent
60e291d
commit af784ac
Showing
20 changed files
with
348 additions
and
78 deletions.
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,36 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- mariadb | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy Documentation | ||
environment: 'docs-dev' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Set up AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-1 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- name: Install plantuml | ||
run: sudo apt-get install -y plantuml | ||
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
with: | ||
key: mkdocs-material-${{ env.cache_id }} | ||
path: .cache | ||
restore-keys: | | ||
mkdocs-material- | ||
- run: pip install mkdocs-material pymdown-extensions plantuml_markdown | ||
- run: mkdocs build | ||
- run: aws s3 sync ./site "s3://${{ env.BUCKET_NAME || 'dev.docs.cfa.codes' }}/${{ env.PREFIX || 'cmr-entity-resolution' }}" |
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
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,6 @@ | ||
FROM squidfunk/mkdocs-material:latest | ||
|
||
# Install PlantUML so we can render UML diagrams. | ||
RUN pip install markdown-callouts plantuml_markdown | ||
RUN apk add --no-cache plantuml --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \ | ||
&& rm -rf /var/cache/apk/* |
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
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
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
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,77 @@ | ||
# Example: Import from MySQL | ||
|
||
> [!TIP] | ||
> The MySQL source type can be used for any MySQL compatible database, as shown | ||
> in this example using MariaDB. | ||
This example demonstrates importing data from a [MySQL][mysql] database. | ||
Following the steps below will launch a [MariaDB] container locally, and load a | ||
sample dataset to be imported into Senzing. You can also use your own | ||
MySQL compatible database, but you must also provide an appropriate | ||
configuration file rather than the one specified here. | ||
|
||
> [!NOTE] | ||
> All commands listed in this document are run from the root directory of this | ||
> [repository][repo]. | ||
## Launching | ||
|
||
If you've launched the entity resolution system by following | ||
[README.md][readme:launching], then you're already part way there! If you | ||
haven't, don't worry! It's worth taking a look at that documentation, but you | ||
don't have to run any of those commands. We'll launch the system along with our | ||
MariaDB container. | ||
|
||
Before launching, the following environment variables can be set to configure | ||
the container: | ||
|
||
| Variable | Default | Description | | ||
|-----------------------|----------|-----------------------------| | ||
| MARIADB_ROOT_PASSWORD | password | Password for the root user. | | ||
|
||
Whether you already have the entity resolution system up and you just want to | ||
add the MariaDB container, or your need to launch the full stack, you can do so | ||
with the following: | ||
|
||
```bash | ||
docker compose \ | ||
-f docker-compose.yml \ | ||
-f docs/examples/assets/docker-compose.mysql.yml \ | ||
up -d | ||
``` | ||
|
||
This will launch and configure all the required containers and load the sample | ||
dataset into MariaDB. | ||
|
||
## Importing | ||
|
||
Now that we have the system up and running, we can import our data. The data's | ||
already been loaded into the database, so we just need to point the importer at | ||
it. We do so using a configuration file with the source set to the database, and | ||
passing that to the importer. | ||
|
||
See [Importing & Exporting][import-export] for more information on importing and | ||
exporting. | ||
|
||
```bash | ||
export IMPORTER_CONFIG_FILE="$(pwd)/docs/examples/assets/config.mysql.yml" | ||
docker compose up importer | ||
``` | ||
|
||
Once the importer container exits, your data is now in Senzing! | ||
|
||
## Exporting | ||
|
||
To verify that the import succeeded, we can export the results from Senzing | ||
to a CSV file. Our config file already has this setup. | ||
|
||
```bash | ||
export EXPORTER_CONFIG_FILE="$(pwd)/docs/examples/assets/config.mysql.yml" | ||
docker compose up exporter | ||
``` | ||
|
||
[import-export]: ../importing-exporting.md | ||
[mariadb]: https://mariadb.org/ | ||
[mysql]: https://www.mysql.com/ | ||
[readme:launching]: /#launching | ||
[repo]: https://github.com/codeforamerica/cmr-entity-resolution |
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
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,4 @@ | ||
--8<-- "README.md" | ||
|
||
[examples]: examples.md | ||
[import-export]: importing-exporting.md |
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 @@ | ||
--8<-- "LICENSE" |
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
Oops, something went wrong.