Skip to content

Commit 3746811

Browse files
committed
Included eoapi-k8s docs in mkdocs build for eoapi.dev
1 parent 025da1b commit 3746811

File tree

6 files changed

+213
-150
lines changed

6 files changed

+213
-150
lines changed

.github/workflows/deploy_mkdocs.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
- 'CONTRIBUTING.md'
1212
- 'docs/**'
1313
- '.github/workflows/deploy_mkdocs.yml'
14+
workflow_dispatch: # Allow manual triggering
15+
schedule:
16+
# Run daily at 6 AM UTC to check for updates in eoapi-k8s docs
17+
- cron: '0 6 * * *'
1418

1519
jobs:
1620
build:
@@ -20,6 +24,51 @@ jobs:
2024
- name: Checkout main
2125
uses: actions/checkout@v3
2226

27+
- name: Checkout eoapi-k8s docs
28+
uses: actions/checkout@v3
29+
with:
30+
repository: developmentseed/eoapi-k8s
31+
path: eoapi-k8s-temp
32+
ref: main
33+
34+
- name: Setup Kubernetes docs directory
35+
run: |
36+
mkdir -p docs/src/kubernetes
37+
38+
if [ -f "eoapi-k8s-temp/docs/docs-config.json" ]; then
39+
echo "Using docs-config.json for structured documentation sync"
40+
41+
find eoapi-k8s-temp/docs -name "*.md" -not -name "README.md" \
42+
-exec cp {} docs/src/kubernetes/ \;
43+
44+
ASSETS_DIR=$(grep -o '"assets_dir": *"[^"]*"' eoapi-k8s-temp/docs/docs-config.json | cut -d'"' -f4)
45+
if [ -n "$ASSETS_DIR" ] && [ -d "eoapi-k8s-temp/docs/$ASSETS_DIR" ]; then
46+
cp -r "eoapi-k8s-temp/docs/$ASSETS_DIR" docs/src/kubernetes/
47+
fi
48+
49+
find eoapi-k8s-temp/docs -name "*.svg" \
50+
-exec cp {} docs/src/kubernetes/ \;
51+
else
52+
echo "Fallback: copying all documentation files"
53+
54+
find eoapi-k8s-temp/docs -name "*.md" \
55+
-exec cp {} docs/src/kubernetes/ \;
56+
if [ -d "eoapi-k8s-temp/docs/images" ]; then
57+
cp -r eoapi-k8s-temp/docs/images docs/src/kubernetes/
58+
fi
59+
find eoapi-k8s-temp/docs -name "*.svg" \
60+
-exec cp {} docs/src/kubernetes/ \;
61+
fi
62+
63+
cat >> docs/src/kubernetes/index.md << EOF
64+
65+
---
66+
67+
*Documentation last synchronized: $(date -u +"%Y-%m-%d %H:%M:%S UTC")*
68+
EOF
69+
70+
rm -rf eoapi-k8s-temp
71+
2372
- name: Set up Python 3.8
2473
uses: actions/setup-python@v4
2574
with:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,4 @@ demo/cmip6/CMIP6_daily_*stac_items.ndjson
117117

118118
# browser compiled code and default config
119119
infrastructure/aws/stac-browser
120-
infrastructure/aws/browser_config.js
120+
infrastructure/aws/browser_config.js

Makefile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
.PHONY: docs-sync docs-build docs-serve docs-clean help
2+
3+
# Default target
4+
help:
5+
@echo "Available commands:"
6+
@echo " docs-sync - Sync eoapi-k8s documentation"
7+
@echo " docs-build - Build documentation site"
8+
@echo " docs-serve - Serve documentation locally"
9+
@echo " docs-clean - Clean documentation build files"
10+
11+
# Sync eoapi-k8s documentation
12+
docs-sync:
13+
@echo "Syncing eoapi-k8s documentation..."
14+
@mkdir -p docs/src/kubernetes
15+
@if [ ! -d "eoapi-k8s" ]; then \
16+
git clone https://github.com/developmentseed/eoapi-k8s.git; \
17+
fi
18+
# TODO: Temporarily relying on the feature/rerefactor-docs branch.
19+
@cd eoapi-k8s && git fetch && git checkout feature/rerefactor-docs
20+
@if [ -f "eoapi-k8s/docs/docs-config.json" ]; then \
21+
find eoapi-k8s/docs -name "*.md" -not -name "README.md" -exec cp {} docs/src/kubernetes/ \;; \
22+
ASSETS_DIR=$$(grep -o '"assets_dir": *"[^"]*"' eoapi-k8s/docs/docs-config.json | cut -d'"' -f4); \
23+
if [ -n "$$ASSETS_DIR" ] && [ -d "eoapi-k8s/docs/$$ASSETS_DIR" ]; then \
24+
cp -r "eoapi-k8s/docs/$$ASSETS_DIR" docs/src/kubernetes/; \
25+
fi; \
26+
find eoapi-k8s/docs -name "*.svg" -exec cp {} docs/src/kubernetes/ \;; \
27+
fi
28+
@echo "" >> docs/src/kubernetes/index.md
29+
@echo "---" >> docs/src/kubernetes/index.md
30+
@echo "" >> docs/src/kubernetes/index.md
31+
@echo "*Documentation last synchronized: $$(date -u +"%Y-%m-%d %H:%M:%S UTC")*" >> docs/src/kubernetes/index.md
32+
@echo "Documentation sync complete!"
33+
34+
# Build documentation
35+
docs-build: docs-sync
36+
@cd docs && mkdocs build
37+
38+
# Serve documentation locally
39+
docs-serve: docs-sync
40+
@cd docs && mkdocs serve
41+
42+
# Clean documentation build files
43+
docs-clean:
44+
@rm -rf docs/build docs/src/kubernetes eoapi-k8s
45+
@echo "Documentation cleaned!"

docs/mkdocs.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,26 @@ nav:
2929
- Contributing: contributing.md
3030
- Advanced User Guide:
3131
- Customization: customization.md
32-
- Deployment: deployment.md
32+
- Deployment:
33+
- deployment.md
34+
- Kubernetes:
35+
- Overview: kubernetes/index.md
36+
- Quick Start: kubernetes/quick-start.md
37+
- Installation:
38+
- Helm Install: kubernetes/helm-install.md
39+
- AWS EKS: kubernetes/aws-eks.md
40+
- GCP GKE: kubernetes/gcp-gke.md
41+
- Azure: kubernetes/azure.md
42+
- Configuration: kubernetes/configuration.md
43+
- Operations:
44+
- Manage Data: kubernetes/manage-data.md
45+
- Autoscaling: kubernetes/autoscaling.md
46+
- Unified Ingress: kubernetes/unified-ingress.md
47+
- STAC Auth Proxy: kubernetes/stac-auth-proxy.md
48+
- Release: kubernetes/release.md
49+
- AWS CDK:
50+
- Overview: aws/index.md
51+
3352

3453
plugins:
3554
- search

docs/src/aws/index.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
title: "AWS CDK Deployment"
3+
description: "Serverless deployment of eoAPI on AWS using CDK"
4+
external_links:
5+
- name: "eoapi-cdk Repository"
6+
url: "https://github.com/developmentseed/eoapi-cdk"
7+
- name: "eoapi-template Repository"
8+
url: "https://github.com/developmentseed/eoapi-template"
9+
---
10+
11+
# AWS CDK Deployment
12+
13+
[← Back to Deployment](../deployment.md)
14+
15+
Serverless deployment of eoAPI on AWS using Lambda, RDS, and API Gateway.
16+
17+
## Architecture
18+
19+
eoAPI on AWS CDK provides:
20+
- AWS Lambda functions for API services
21+
- Amazon RDS PostgreSQL database
22+
- API Gateway for routing and management
23+
- CloudFormation for infrastructure as code
24+
- Automatic scaling based on request volume
25+
- Pay-per-request pricing model
26+
27+
## Prerequisites
28+
29+
- AWS account with appropriate permissions
30+
- AWS CLI configured
31+
- Node.js 14+
32+
- Python 3.8+
33+
- AWS CDK CLI
34+
35+
## Quick Start
36+
37+
1. **Clone and Setup**
38+
```bash
39+
git clone https://github.com/developmentseed/eoapi-template.git
40+
cd eoapi-template
41+
42+
python -m venv .venv
43+
source .venv/bin/activate
44+
python -m pip install -r requirements.txt
45+
npm install
46+
```
47+
48+
2. **Configure**
49+
```bash
50+
# Copy and edit configuration
51+
cp config.yaml.example config.yaml
52+
# Edit config.yaml with your settings
53+
```
54+
55+
3. **Bootstrap CDK** (one-time per AWS account)
56+
```bash
57+
PROJECT_ID=eoAPI STAGE=staging npx cdk bootstrap
58+
```
59+
60+
4. **Deploy**
61+
```bash
62+
PROJECT_ID=eoAPI STAGE=staging npx cdk deploy vpceoAPI-staging eoAPI-staging
63+
```
64+
65+
## Configuration
66+
67+
The deployment is configured through `config.yaml` and environment variables:
68+
69+
- `PROJECT_ID`: Prefix for stack names
70+
- `STAGE`: Environment name (staging, production, etc.)
71+
- Database settings, Lambda configuration, and API Gateway options
72+
73+
See [configuration examples](https://github.com/developmentseed/eoapi-template/blob/main/config.yaml.example) for detailed options.
74+
75+
## Components
76+
77+
- **[eoapi-cdk](https://github.com/developmentseed/eoapi-cdk)** - CDK constructs library
78+
- **[eoapi-template](https://github.com/developmentseed/eoapi-template)** - Example CDK application
79+
80+
## Troubleshooting
81+
82+
**VPC Limits**: If you encounter "max VPCs reached" errors, switch to a different AWS region.
83+
84+
**Permissions**: Ensure your AWS credentials have permissions for Lambda, RDS, API Gateway, and CloudFormation.

0 commit comments

Comments
 (0)