Skip to content

Commit

Permalink
Documentation: Add a bit of style to the README
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Feb 8, 2024
1 parent 38af571 commit 4bafce6
Show file tree
Hide file tree
Showing 2 changed files with 189 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/stack-kafka-flink.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Apache Kafka, Apache Flink, and CrateDB
name: Apache Kafka, Apache Flink

on:
pull_request:
Expand Down
214 changes: 188 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,87 @@
<div align="center">

# CrateDB Examples

## About
A collection of clear and concise examples how to work with [CrateDB].

Quick links:
[Dataframe](./by-dataframe)
[Language](./by-language)
[Framework](./framework)
[Stack](./stacks)
[Testing](./testing)
[Topic](./topic)

More information:
[Drivers and Integrations](https://cratedb.com/docs/clients/)
[Integration Tutorials](https://community.cratedb.com/t/overview-of-cratedb-integration-tutorials/1015)
[Reference Documentation](https://cratedb.com/docs/crate/reference/)

</div>


## 👨‍💻 Usage

- You can explore the content by browsing folders within the repository.
Main sections can be explored by using the quick links in the header
area.

This repository contains a collection of clear and concise examples
how to work with [CrateDB](https://github.com/crate/crate). You can
use them for educational purposes, or as blueprints for your own
projects.
- If you are looking for something specific, please use GitHub search, for
example, [searching for "jdbc"].

## Layout
- You can use the code snippets for educational and knowledge base purposes,
or as blueprints within your own projects.

- The `by-dataframe` folder contains example code snippets how
- The repository is also used to support QA processes. Each example is
designed to be invoked as an integration test case, accompanied by a
corresponding CI validation job.


## 🧐 What's inside

This section gives you an overview about what's inside the relevant
folders.

- **by-dataframe** contains example code snippets how
to work with dataframe libraries like pandas, Polars, Dask,
Spark, and friends.

- The `by-language` folder contains demo programs / technical
- **by-language** contains demo programs / technical
investigations outlining how to get started quickly with CrateDB
using different programming languages and frameworks.

- The `framework` folder contains integration scenarios with
- **framework** contains integration scenarios with
full-fledged applications or software frameworks.

- The `stacks` folder contains more grown-up, complete usage scenarios
- **stacks** contains more grown-up, complete usage scenarios
where CrateDB is part of a larger software stack. Those resources
may also be used within \"reference architecture\" types of
may also be used within "reference architecture" types of
documentation.

- The `testing` folder contains reference implementations about how to
- **testing** contains reference implementations about how to
use different kinds of test layers for testing your applications
with CrateDB.

## Testing

The repository uses an universal test runner to invoke test suites of
different languages and environments.
## 🏕️ Testing

### Prerequisites

Before running the software integration tests on your workstation, make sure
to supply an instance of CrateDB. In order to use the most recent available
code, this Docker commands selects the `crate/crate:nightly` OCI image.

Before running the examples on your workstation, make sure you are using
an up-to-date version of CrateDB:
```shell
docker run --rm -it --pull=always \
--name=cratedb --publish=4200:4200 --publish=5432:5432 \
--env=CRATE_HEAP_SIZE=4g \
crate/crate:nightly -Cdiscovery.type=single-node
```

docker pull crate/crate:nightly
### Test Runner `ngr`

### Introducing `ngr`
The repository uses a universal test runner to invoke test suites of
different languages and environments, called `ngr`.

In order to run specific sets of test cases, you do not need to leave
the top-level directory, or run any kind of environment setup procedures.
Expand All @@ -54,19 +96,139 @@ If all goes well, just select one of the folders of interest, and invoke
ngr test testing/testcontainers/java
ngr test topic/machine-learning/llm-langchain

The authors recommend to invoke `ngr` from within a Python virtualenv,
in order to isolate its installation from the system Python.
> [!NOTE]
> It is recommended to invoke `ngr` from within a Python virtualenv,
> in order to isolate its installation from the system Python.
> Installing `ngr` works like this:
> ```shell
> git clone https://github.com/crate/cratedb-examples
> cd cratedb-examples
> python3 -m venv .venv
> source .venv/bin/activate
> pip install -r requirements.txt
> ```
### Running a Test Matrix
### Test Matrix Support
Some examples optionally obtain parameters on invocation time.
An example are the test cases for Npgsql, which accept the version number of
One example is the test suite for Npgsql, which accepts the version number of
the Npgsql driver release to be obtained from the environment at runtime,
overriding any internally specified versions. Example:
ngr test by-language/csharp-npgsql --npgsql-version=6.0.9
This feature is handy if you are running a test matrix, which is
responsible for driving the version numbers, instead of using any
versions nailed within local specification files of any sort.
> [!TIP]
> This feature is handy if you are running a test matrix, which is
> responsible for driving the version numbers, instead of using the
> version numbers nailed within local specification files of any sort.
### CI Status
This section outlines the status of integration tests on CI/GHA.
<table>
<thead>
<tr>
<th></th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<b>Dataframe</b>
</td>
<td>
<a href="https://github.com/crate/cratedb-examples/actions/workflows/dataframe-dask.yml">
<img src="https://github.com/crate/cratedb-examples/actions/workflows/dataframe-dask.yml/badge.svg" loading="lazy"></a>
<a href="https://github.com/crate/cratedb-examples/actions/workflows/dataframe-pandas.yml">
<img src="https://github.com/crate/cratedb-examples/actions/workflows/dataframe-pandas.yml/badge.svg" loading="lazy"></a>
</td>
</tr>
<tr>
<td>
<b>Language</b>
</td>
<td>
<a href="https://github.com/crate/cratedb-examples/actions/workflows/lang-npgsql.yml">
<img src="https://github.com/crate/cratedb-examples/actions/workflows/lang-npgsql.yml/badge.svg" loading="lazy"></a>
<a href="https://github.com/crate/cratedb-examples/actions/workflows/lang-java-jooq.yml">
<img src="https://github.com/crate/cratedb-examples/actions/workflows/lang-java-jooq.yml/badge.svg" loading="lazy"></a>
<a href="https://github.com/crate/cratedb-examples/actions/workflows/lang-java-maven.yml">
<img src="https://github.com/crate/cratedb-examples/actions/workflows/lang-java-maven.yml/badge.svg" loading="lazy"></a>
<a href="https://github.com/crate/cratedb-examples/actions/workflows/lang-php-amphp.yml">
<img src="https://github.com/crate/cratedb-examples/actions/workflows/lang-php-amphp.yml/badge.svg" loading="lazy"></a>
<a href="https://github.com/crate/cratedb-examples/actions/workflows/lang-php-pdo.yml">
<img src="https://github.com/crate/cratedb-examples/actions/workflows/lang-php-pdo.yml/badge.svg" loading="lazy"></a>
<a href="https://github.com/crate/cratedb-examples/actions/workflows/lang-python-sqlalchemy.yml">
<img src="https://github.com/crate/cratedb-examples/actions/workflows/lang-python-sqlalchemy.yml/badge.svg" loading="lazy"></a>
<a href="https://github.com/crate/cratedb-examples/actions/workflows/lang-ruby.yml">
<img src="https://github.com/crate/cratedb-examples/actions/workflows/lang-ruby.yml/badge.svg" loading="lazy"></a>
</td>
</tr>
<tr>
<td>
<b>Framework</b>
</td>
<td>
<a href="https://github.com/crate/cratedb-examples/actions/workflows/stack-kafka-flink.yml">
<img src="https://github.com/crate/cratedb-examples/actions/workflows/stack-kafka-flink.yml/badge.svg" loading="lazy"></a>
<a href="https://github.com/crate/cratedb-examples/actions/workflows/framework-apache-supersetk.yml">
<img src="https://github.com/crate/cratedb-examples/actions/workflows/framework-apache-superset.yml/badge.svg" loading="lazy"></a>
</td>
</tr>
<tr>
<td>
<b>Testing</b>
</td>
<td>
<a href="https://github.com/crate/cratedb-examples/actions/workflows/testing-testcontainers-java.yml">
<img src="https://github.com/crate/cratedb-examples/actions/workflows/testing-testcontainers-java.yml/badge.svg" loading="lazy"></a>
</td>
</tr>
<tr>
<td>
<b>Topic</b>
</td>
<td>
<b>Machine Learning</b>
<br>
<a href="https://github.com/crate/cratedb-examples/actions/workflows/ml-automl.yml">
<img src="https://github.com/crate/cratedb-examples/actions/workflows/ml-automl.yml/badge.svg" loading="lazy"></a>
<a href="https://github.com/crate/cratedb-examples/actions/workflows/ml-langchain.yml">
<img src="https://github.com/crate/cratedb-examples/actions/workflows/ml-langchain.yml/badge.svg" loading="lazy"></a>
<a href="https://github.com/crate/cratedb-examples/actions/workflows/ml-mlflow.yml">
<img src="https://github.com/crate/cratedb-examples/actions/workflows/ml-mlflow.yml/badge.svg" loading="lazy"></a>
</td>
</tr>
</tbody>
</table>
## 💁 Contributing
Interested in contributing to this project? Thanks so much for your interest!
As an open-source project, we are always looking for improvements in form of
contributions, whether it be in the form of a new feature, improved
infrastructure, or better documentation.
Your bug reports, feature requests, and patches are greatly appreciated.
## 🌟 Contributors
[![Contributors to CrateDB Examples](https://contrib.rocks/image?repo=crate/cratedb-examples)](https://github.com/crate/cratedb-examples/graphs/contributors)
[CrateDB]: https://github.com/crate/crate
[searching for "jdbc"]: https://github.com/search?q=repo%3Acrate%2Fcratedb-examples+jdbc

0 comments on commit 4bafce6

Please sign in to comment.