Skip to content

Commit b6ccde2

Browse files
Chore/monorepo import docs examples (#94)
* Move docs and examples repo into here * Update gitignore --------- Signed-off-by: Peter Flook <pflooky@hotmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: pflooky <26299147+pflooky@users.noreply.github.com>
1 parent c9aaa77 commit b6ccde2

351 files changed

Lines changed: 36511 additions & 0 deletions

File tree

Some content is hidden

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

.github/workflows/benchmark.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Run performance benchmark tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
working-directory: example
14+
steps:
15+
- name: Checkout monorepo
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 2
19+
- name: Check if benchmark has already run
20+
run: |
21+
version=$(grep dataCatererVersion gradle.properties | cut -d= -f2)
22+
if [ ! -f benchmark/results/benchmark_results_${version}.txt ]; then
23+
echo "No benchmark results for version: $version, starting to run benchmarks"
24+
else
25+
echo "Benchmarks already run!"
26+
exit 1
27+
fi
28+
- name: Checkout datafusion-comet repo
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 2
32+
repository: apache/datafusion-comet
33+
path: example/benchmark/build/datafusion-comet
34+
- name: Get Spark query engine jars
35+
run: bash benchmark/setup_query_engine_jars.sh
36+
- name: Run benchmark script
37+
env:
38+
DATA_CATERER_MANAGEMENT_TRACK: ${{ secrets.DATA_CATERER_MANAGEMENT_TRACK }}
39+
run: |
40+
version=$(grep dataCatererVersion gradle.properties | cut -d= -f2)
41+
bash benchmark/run_benchmark.sh
42+
bash benchmark/compare_benchmark_results.sh "$version"
43+
- name: Create pull request
44+
uses: peter-evans/create-pull-request@v6
45+
with:
46+
title: Add benchmark results

.github/workflows/docs-ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.x'
21+
- name: Configure Git Credentials
22+
run: |
23+
git config user.name github-actions[bot]
24+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
25+
- name: Set cache key
26+
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
27+
- uses: actions/cache@v4
28+
with:
29+
key: mkdocs-material-${{ env.cache_id }}
30+
path: .cache
31+
restore-keys: |
32+
mkdocs-material-
33+
- run: sudo apt-get update && sudo apt-get install -y pngquant
34+
- run: pip install mkdocs-material mkdocs-open-in-new-tab "mkdocs-material[imaging]" mike
35+
- name: Deploy docs with mike
36+
run: |
37+
latest_tag=$(git describe --tags --abbrev=0)
38+
mike deploy --push --update-aliases "$latest_tag" latest
39+
env:
40+
GH_TOKEN: ${{ secrets.GH_TOKEN }}

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ tmp
1515
.bloop
1616
.metals
1717
.vscode
18+
site
19+
.cache
20+
21+
# Python/virtualenvs used by docs
22+
.venv
23+
.python-version
1824

1925
app/out
2026
app/src/test/resources/sample/parquet
@@ -30,8 +36,21 @@ app/src/test/resources/sample/plan-gen
3036
api/out
3137
api/src/test/resources/sample/documentation
3238

39+
# UI
3340
ui/node_modules
3441
ui/coverage
3542

43+
# Docs build caches
44+
.docs
45+
docs/site
46+
docs/.cache
47+
docs/.venv
48+
49+
# Example module
50+
example/build
51+
example/.gradle
52+
example/benchmark/build
53+
example/benchmark/jars
54+
3655
*.class
3756
*.log

buildSrc/build.gradle.kts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
plugins {
2+
kotlin("jvm") version "1.9.0"
3+
}
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
dependencies {
10+
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.18.2")
11+
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.2")
12+
implementation("com.networknt:json-schema-validator:1.0.87")
13+
implementation(kotlin("stdlib-jdk8"))
14+
}
15+
16+
kotlin {
17+
jvmToolchain(17)
18+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import com.fasterxml.jackson.databind.JsonNode
2+
import com.fasterxml.jackson.databind.ObjectMapper
3+
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
4+
import com.networknt.schema.JsonSchema
5+
import com.networknt.schema.JsonSchemaFactory
6+
import com.networknt.schema.SpecVersion
7+
import com.networknt.schema.ValidationMessage
8+
import org.gradle.api.DefaultTask
9+
import org.gradle.api.file.DirectoryProperty
10+
import org.gradle.api.file.RegularFileProperty
11+
import org.gradle.api.tasks.InputDirectory
12+
import org.gradle.api.tasks.InputFile
13+
import org.gradle.api.tasks.TaskAction
14+
import org.gradle.api.GradleException
15+
16+
abstract class ValidateYamlAgainstSchema : DefaultTask() {
17+
18+
@get:InputDirectory
19+
abstract val yamlDirectory: DirectoryProperty
20+
21+
@get:InputFile
22+
abstract val schemaFile: RegularFileProperty
23+
24+
@TaskAction
25+
fun validateYaml() {
26+
val objectMapper = ObjectMapper(YAMLFactory())
27+
objectMapper.readTree(schemaFile.get().asFile.readText())
28+
val schemaFactory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V201909)
29+
val schemaNode: JsonNode = objectMapper.readTree(schemaFile.asFile.get())
30+
val schema: JsonSchema = schemaFactory.getSchema(schemaNode)
31+
32+
val validationResults = yamlDirectory.asFile.get().walk()
33+
.filter { it.isFile && (it.extension == "yaml" || it.extension == "yml") }
34+
.map { file ->
35+
try {
36+
val yamlNode: JsonNode = objectMapper.readTree(file)
37+
val validationResult: Set<ValidationMessage> = schema.validate(yamlNode)
38+
file to validationResult
39+
} catch (e: Exception) {
40+
println("Fail read or validation failed, path: ${file.absolutePath}, message: ${e.message}")
41+
file to setOf()
42+
}
43+
}
44+
.toList()
45+
46+
val failedValidations = validationResults.filter { it.second.isNotEmpty() }
47+
48+
if (failedValidations.isNotEmpty()) {
49+
val errorMessage = StringBuilder("YAML validation failed for the following files:\n")
50+
failedValidations.forEach { (file, errors) ->
51+
errorMessage.append(" - file://${file}:\n")
52+
errors.forEach { message ->
53+
errorMessage.append(" - ${message.message} (path: ${message.schemaPath})\n")
54+
}
55+
}
56+
throw GradleException(errorMessage.toString())
57+
} else {
58+
println("All YAML files validated successfully.")
59+
}
60+
}
61+
}

docs/.DS_Store

6 KB
Binary file not shown.

docs/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
data.catering

docs/about.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# About
2+
3+
Hi, my name is Peter. I am a Software Developer, mainly focussing on data related services. My experience
4+
can be found on my [LinkedIn](https://www.linkedin.com/in/peter-flook/).
5+
6+
I have created Data Caterer to help serve individuals and companies with data generation and data testing. It is a
7+
complex area that has many edge cases or intricacies that are hard to summarise or turn into something actionable and
8+
repeatable. Through the use of metadata, Data Caterer can help simplify your data testing, simulating production
9+
environment data, aid in data debugging, or whatever your data use case may be.
10+
11+
Given that it is going to save you and your team time and money, please help in considering financial support. This will
12+
help the product grow into a sustainable and feature-full service.
13+
14+
## Contact
15+
16+
Please contact us
17+
via [Slack](https://join.slack.com/t/data-catering/shared_invite/zt-2664ylbpi-w3n7lWAO~PHeOG9Ujpm~~w)
18+
or via email `hello@data.catering` if you have any questions or queries.

0 commit comments

Comments
 (0)