Skip to content

Commit 990d706

Browse files
committed
refactor: documentation structure.
1 parent 35a6adb commit 990d706

20 files changed

+511
-31
lines changed
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
name: Validate Documentation Links
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
paths: [ 'docs/**/*.md' ]
7+
pull_request:
8+
branches: [ main, master ]
9+
paths: [ 'docs/**/*.md' ]
10+
11+
jobs:
12+
validate-links:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '18'
23+
24+
- name: Install markdown-link-check
25+
run: npm install -g markdown-link-check
26+
27+
- name: Create markdown-link-check config
28+
run: |
29+
cat > .markdown-link-check.json << 'EOF'
30+
{
31+
"ignorePatterns": [
32+
{
33+
"pattern": "^https://github.com/developmentseed/eoapi-k8s"
34+
},
35+
{
36+
"pattern": "localhost"
37+
},
38+
{
39+
"pattern": "127.0.0.1"
40+
}
41+
],
42+
"replacementPatterns": [
43+
{
44+
"pattern": "^./",
45+
"replacement": "{{BASEURL}}/"
46+
}
47+
],
48+
"httpHeaders": [
49+
{
50+
"urls": ["https://github.com"],
51+
"headers": {
52+
"Accept": "text/html"
53+
}
54+
}
55+
],
56+
"timeout": "20s",
57+
"retryOn429": true,
58+
"retryCount": 3,
59+
"fallbackRetryDelay": "30s",
60+
"aliveStatusCodes": [200, 206, 301, 302, 403, 999]
61+
}
62+
EOF
63+
64+
- name: Validate internal links
65+
run: |
66+
echo "Checking internal link patterns..."
67+
broken_links_found=0
68+
69+
while IFS= read -r -d '' file; do
70+
echo "Checking internal links in: $file"
71+
72+
# Check for broken relative links
73+
while IFS=: read -r line_num link; do
74+
# Extract the link path
75+
link_path=$(echo "$link" | sed -n 's/.*](\.\///; s/).*//p')
76+
77+
# Check if it's an image link
78+
if [[ "$link_path" == images/* ]]; then
79+
full_path="docs/$link_path"
80+
else
81+
full_path="docs/$link_path"
82+
fi
83+
84+
if [[ ! -e "$full_path" ]]; then
85+
echo "❌ Broken internal link in $file:$line_num -> $link_path (resolved to: $full_path)"
86+
broken_links_found=1
87+
else
88+
echo "✅ Valid internal link: $link_path"
89+
fi
90+
done < <(grep -n "](\./" "$file" || true)
91+
done < <(find docs -name "*.md" -type f -print0)
92+
93+
if [[ $broken_links_found -eq 1 ]]; then
94+
echo "❌ Found broken internal links!"
95+
exit 1
96+
else
97+
echo "✅ All internal links are valid!"
98+
fi
99+
100+
- name: Validate external links
101+
run: |
102+
echo "Validating external links..."
103+
find docs -name "*.md" -type f | while read -r file; do
104+
echo "Checking external links in: $file"
105+
markdown-link-check "$file" --config .markdown-link-check.json || echo "Some external links failed in $file"
106+
done
107+
108+
- name: Check for consistent link patterns
109+
run: |
110+
echo "Checking for inconsistent link patterns..."
111+
inconsistent_found=false
112+
113+
# Check for bad patterns
114+
if find docs -name "*.md" -exec grep -l "](docs/" {} \;; then
115+
echo "❌ Found links using 'docs/' prefix - use relative paths instead"
116+
find docs -name "*.md" -exec grep -Hn "](docs/" {} \;
117+
inconsistent_found=true
118+
fi
119+
120+
if find docs -name "*.md" -exec grep -l "](\.\./" {} \;; then
121+
echo "❌ Found links using '../' - use relative paths from docs root instead"
122+
find docs -name "*.md" -exec grep -Hn "](\.\./" {} \;
123+
inconsistent_found=true
124+
fi
125+
126+
if [[ "$inconsistent_found" == "true" ]]; then
127+
echo "❌ Found inconsistent link patterns!"
128+
echo "Use these patterns instead:"
129+
echo " - [Installation Guide](./installation.md)"
130+
echo " - [AWS Setup](./aws-eks.md)"
131+
echo " - [Images](./images/diagram.png)"
132+
exit 1
133+
else
134+
echo "✅ All link patterns are consistent!"
135+
fi
136+
137+
- name: Validate frontmatter
138+
run: |
139+
echo "Checking that all markdown files have frontmatter..."
140+
missing_frontmatter_found=0
141+
142+
while IFS= read -r -d '' file; do
143+
if ! head -1 "$file" | grep -q "^---$"; then
144+
echo "❌ Missing frontmatter in: $file"
145+
missing_frontmatter_found=1
146+
fi
147+
done < <(find docs -name "*.md" -not -path "docs/_includes/*" -type f -print0)
148+
149+
if [[ $missing_frontmatter_found -eq 1 ]]; then
150+
echo "❌ Some files are missing frontmatter!"
151+
echo "Add frontmatter like:"
152+
echo "---"
153+
echo "title: \"Page Title\""
154+
echo "description: \"Page description\""
155+
echo "external_links:"
156+
echo " - name: \"Link Name\""
157+
echo " url: \"https://example.com\""
158+
echo "---"
159+
exit 1
160+
else
161+
echo "✅ All markdown files have frontmatter!"
162+
fi

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
- Restructured docs with flattened structure and added portable documentation generation
11+
1012
## [0.7.12] - 2025-10-17
1113

1214
- Bumped eoapi-notifier dependency version to 0.0.7

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ HELM_REPO_URL=https://devseed.com/eoapi-k8s/
55
HELM_CHART_NAME=eoapi/eoapi
66
PGO_CHART_VERSION=5.7.4
77

8-
.PHONY: all deploy minikube ingest tests integration lint validate-schema help
8+
.PHONY: all deploy minikube ingest tests integration lint validate-schema docs help
99

1010
# Default target
1111
all: deploy
@@ -25,6 +25,11 @@ minikube:
2525
@echo "eoAPI is now available at:"
2626
@minikube service ingress-nginx-controller -n ingress-nginx --url | head -n 1
2727

28+
docs:
29+
@echo "Generating portable documentation package."
30+
@command -v bash >/dev/null 2>&1 || { echo "bash is required but not installed"; exit 1; }
31+
@./scripts/generate-portable-docs.sh
32+
2833
ingest:
2934
@echo "Ingesting STAC collections and items into the database."
3035
@command -v bash >/dev/null 2>&1 || { echo "bash is required but not installed"; exit 1; }

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
### Get started
3030

31-
* [Quick start guide](./docs/installation/quick-start.md)
31+
* [Quick start guide](./docs/quick-start.md)
3232

3333
### `eoAPI-k8s` documentation
3434

charts/eoapi/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ postgresql:
114114

115115
For detailed configuration and usage:
116116

117-
- [Configuration Guide](https://github.com/developmentseed/eoapi-k8s/blob/main/docs/installation/configuration.md)
118-
- [Data Management](https://github.com/developmentseed/eoapi-k8s/blob/main/docs/operations/manage-data.md)
119-
- [Autoscaling Guide](https://github.com/developmentseed/eoapi-k8s/blob/main/docs/operations/autoscaling.md)
117+
- [Configuration Guide](https://github.com/developmentseed/eoapi-k8s/blob/main/docs/configuration.md)
118+
- [Data Management](https://github.com/developmentseed/eoapi-k8s/blob/main/docs/manage-data.md)
119+
- [Autoscaling Guide](https://github.com/developmentseed/eoapi-k8s/blob/main/docs/autoscaling.md)
120120

121121
## License
122122

docs/_includes/repository-links.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!-- Reusable repository references -->
2+
[Main eoapi Repository]: https://github.com/developmentseed/eoapi
3+
[eoapi-k8s Repository]: https://github.com/developmentseed/eoapi-k8s
4+
[Report Issues]: https://github.com/developmentseed/eoapi-k8s/issues
5+
[eoAPI Documentation]: https://eoapi.dev/
6+
[Helm Charts]: https://github.com/developmentseed/eoapi-k8s/tree/main/charts
7+
[PostgreSQL Operator]: https://access.crunchydata.com/documentation/postgres-operator/
8+
[Kubernetes Documentation]: https://kubernetes.io/docs/

docs/operations/autoscaling.md renamed to docs/autoscaling.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1+
---
2+
title: "Autoscaling & Monitoring"
3+
description: "HPA setup with custom metrics, Grafana dashboards, Prometheus configuration, and load testing"
4+
external_links:
5+
- name: "eoapi-k8s Repository"
6+
url: "https://github.com/developmentseed/eoapi-k8s"
7+
- name: "Kubernetes HPA Documentation"
8+
url: "https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/"
9+
- name: "Prometheus Documentation"
10+
url: "https://prometheus.io/docs/"
11+
- name: "Grafana Documentation"
12+
url: "https://grafana.com/docs/"
13+
---
14+
115
# Autoscaling / Monitoring / Observability
216

317
Autoscaling is both art and science. To test out your application's autoscaling requirements you often need to consider
418
your data volume, data usage patterns, bottlenecks (such as the database) among many, many other things. Load testing,
519
metrics, monitoring and observability will help you explore what those needs are.
620

721

8-
> &#9432; The `eoapi-support` chart in this repository (see `../charts/eoapi-support`) is required to be installed to
22+
> &#9432; The `eoapi-support` chart in this repository is required to be installed to
923
enable any of the eoAPI service autoscaling. It cannot be listed as a dependecy of `eoapi` chart
1024
b/c of the limitations in `prometheus-adapter` and `grafana` for constructing the Prometheus internal
1125
service domains dynamically.
@@ -17,7 +31,7 @@ might want to read through the verbose walkthrough material below to familiarize
1731

1832
## Helm Install `eoapi-support`
1933

20-
The following instructions assume you've gone through the [AWS](../installation/providers/aws-eks.md) or [GCP](../installation/providers/gcp-gke.md) cluster set up
34+
The following instructions assume you've gone through the [AWS](./aws-eks.md) or [GCP](./gcp-gke.md) cluster set up
2135
and installed the `eoapi` chart.
2236

2337

@@ -99,9 +113,9 @@ manual step that cannot be automated
99113

100114
---
101115

102-
### Review [Default Configuration and Options](../installation/configuration.md)
116+
### Review [Default Configuration and Options](./configuration.md)
103117

104-
[This document](../installation/configuration.md) will explain the differences in the `autoscaling` block for each service:
118+
[This document](./configuration.md) will explain the differences in the `autoscaling` block for each service:
105119

106120
```yaml
107121
autoscaling:
@@ -199,15 +213,15 @@ with the `release` name we installed the chart with below `<release-name>-grafan
199213

200214
3. Login and you should be default be able to see the eoapi-k8s grafana dashboard. The Prometheus datasource will already be configured for you:
201215

202-
![Grafana Datasource Configuration](../images/datasource.png)
216+
![Grafana Datasource Configuration](./images/datasource.png)
203217

204218
You can then view the main eoAPI dashboard:
205219

206-
![](../images/gfdashboard.png)
220+
![](./images/gfdashboard.png)
207221

208222
To add additional custom dashboards, you can use the dashboard import functionality:
209223

210-
![Adding Custom Grafana Dashboards](../images/add-grafana-dashboard.png)
224+
![Adding Custom Grafana Dashboards](./images/add-grafana-dashboard.png)
211225

212226
### Install or Upgrade Autoscaling Changes to `eoapi` Chart
213227

@@ -361,7 +375,7 @@ that you're deploying using `ingress.className: "nginx"`.
361375

362376
4. **Monitor autoscaling in Grafana** - Go back to your Grafana dashboard and watch your services autoscale for the endpoints you're hitting:
363377

364-
![Grafana Autoscaling Dashboard](../images/grafanaautoscale.png)
378+
![Grafana Autoscaling Dashboard](./images/grafanaautoscale.png)
365379

366380
### Load Testing Best Practices
367381

docs/installation/providers/aws-eks.md renamed to docs/aws-eks.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
---
2+
title: "AWS EKS Setup"
3+
description: "Complete EKS cluster setup with OIDC, node autoscaling, EBS CSI, and NGINX ingress"
4+
external_links:
5+
- name: "eoapi-k8s Repository"
6+
url: "https://github.com/developmentseed/eoapi-k8s"
7+
- name: "AWS EKS Documentation"
8+
url: "https://docs.aws.amazon.com/eks/"
9+
- name: "eksctl Documentation"
10+
url: "https://eksctl.io/"
11+
- name: "Terraform Alternative"
12+
url: "https://github.com/developmentseed/eoapi-k8s-terraform"
13+
---
14+
115
# AWS EKS Cluster Walkthrough
216

317
This is a verbose walkthrough. It uses `eksctl` and assumes you already have an AWS account, have the [eksctl prerequisites installed](https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html) including `eksctl` and `helm`.

docs/installation/providers/azure.md renamed to docs/azure.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
---
2+
title: "Azure AKS Setup"
3+
description: "Azure configuration with managed PostgreSQL, Key Vault integration, and Workload Identity"
4+
external_links:
5+
- name: "eoapi-k8s Repository"
6+
url: "https://github.com/developmentseed/eoapi-k8s"
7+
- name: "Azure Kubernetes Service Documentation"
8+
url: "https://docs.microsoft.com/en-us/azure/aks/"
9+
- name: "Azure CLI Documentation"
10+
url: "https://docs.microsoft.com/en-us/cli/azure/"
11+
- name: "Azure PostgreSQL Documentation"
12+
url: "https://docs.microsoft.com/en-us/azure/postgresql/"
13+
---
14+
115
# Microsoft Azure Setup
216

317
## Using Azure Managed PostgreSQL

docs/installation/configuration.md renamed to docs/configuration.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
---
2+
title: "Configuration Options"
3+
description: "Complete reference for Helm values, database types, ingress setup, and service configuration"
4+
external_links:
5+
- name: "eoapi-k8s Repository"
6+
url: "https://github.com/developmentseed/eoapi-k8s"
7+
- name: "Helm Values Documentation"
8+
url: "https://helm.sh/docs/chart_best_practices/values/"
9+
---
10+
111
# Configuration Options
212

313
## Required Values
@@ -116,7 +126,7 @@ raster:
116126
## Deployment Architecture
117127

118128
When using default settings, the deployment looks like this:
119-
![](../images/default_architecture.png)
129+
![](./images/default_architecture.png)
120130

121131
The deployment includes:
122132
- HA PostgreSQL database (via PostgreSQL Operator)
@@ -138,7 +148,7 @@ All services include health check endpoints with automatic liveness probes:
138148
| Raster API | `/raster/healthz` | HTTP 200, no auth required |
139149
| Vector API | `/vector/healthz` | HTTP 200, no auth required |
140150

141-
The Kubernetes deployment templates automatically configure `livenessProbe` settings for regular health checks. See the [deployment template](../../charts/eoapi/templates/services/deployment.yaml) for probe configuration details.
151+
The Kubernetes deployment templates automatically configure `livenessProbe` settings for regular health checks. See the [deployment template](https://github.com/developmentseed/eoapi-k8s/blob/main/charts/eoapi/templates/services/deployment.yaml) for probe configuration details.
142152

143153
## Advanced Configuration
144154

0 commit comments

Comments
 (0)