Skip to content

Commit efd7cc8

Browse files
committed
add sentry and api to get timestamp
1 parent 12e435f commit efd7cc8

File tree

13 files changed

+774
-955
lines changed

13 files changed

+774
-955
lines changed

.env.example

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# =============================================================================
2+
# CloudCasting Backend Environment Configuration
3+
# =============================================================================
4+
# Copy this file to .env and customize the values for your environment
5+
6+
# =============================================================================
7+
# Application Server Configuration
8+
# =============================================================================
9+
10+
# Host interface to bind the server to
11+
# Default: "0.0.0.0" (all interfaces)
12+
# For local development, you might use "127.0.0.1"
13+
CLOUDCASTING_BACKEND_HOST=0.0.0.0
14+
15+
# Port number for the application server
16+
# Default: 8000
17+
CLOUDCASTING_BACKEND_PORT=8000
18+
19+
# Number of worker processes for uvicorn
20+
# Default: 1
21+
# For production, increase based on CPU cores
22+
CLOUDCASTING_BACKEND_WORKERS_COUNT=1
23+
24+
# Enable auto-reload for development
25+
# Default: false
26+
# Set to true for development to auto-restart on file changes
27+
CLOUDCASTING_BACKEND_RELOAD=false
28+
29+
# =============================================================================
30+
# Environment and Logging Configuration
31+
# =============================================================================
32+
33+
# Current environment identifier
34+
# Default: "dev"
35+
# Options: "dev", "staging", "production", "pytest"
36+
CLOUDCASTING_BACKEND_ENVIRONMENT=dev
37+
38+
# Logging level
39+
# Default: "INFO"
40+
# Options: "NOTSET", "DEBUG", "INFO", "WARNING", "ERROR", "FATAL"
41+
CLOUDCASTING_BACKEND_LOG_LEVEL=INFO
42+
43+
# =============================================================================
44+
# Sentry Error Monitoring (Optional)
45+
# =============================================================================
46+
47+
# Sentry DSN for error tracking and monitoring
48+
# Default: null (disabled)
49+
# Get this from your Sentry project settings
50+
CLOUDCASTING_BACKEND_SENTRY_DSN=
51+
52+
# Sentry sample rate for performance monitoring
53+
# Default: 1.0 (100% sampling)
54+
# Range: 0.0 to 1.0 (0% to 100%)
55+
CLOUDCASTING_BACKEND_SENTRY_SAMPLE_RATE=1.0
56+
57+
# =============================================================================
58+
# AWS S3 Configuration (Required for cloudcasting data)
59+
# =============================================================================
60+
61+
# S3 bucket containing the cloudcasting forecast data
62+
# This bucket should contain zarr files under cloudcasting_forecast/latest.zarr/
63+
CLOUDCASTING_BACKEND_S3_BUCKET_NAME=your-bucket-name
64+
65+
# AWS region where the S3 bucket is located
66+
# Example: "us-east-1", "eu-west-1", etc.
67+
CLOUDCASTING_BACKEND_S3_REGION_NAME=us-east-1
68+
69+
# AWS Access Key ID for S3 access
70+
# Should have read permissions for the specified bucket
71+
CLOUDCASTING_BACKEND_S3_ACCESS_KEY_ID=your-access-key-id
72+
73+
# AWS Secret Access Key for S3 access
74+
# Keep this secure and never commit to version control
75+
CLOUDCASTING_BACKEND_S3_SECRET_ACCESS_KEY=your-secret-access-key
76+
77+
78+
# =============================================================================
79+
# File Storage Paths (Optional - uses defaults if not specified)
80+
# =============================================================================
81+
82+
# Path to store downloaded zarr files locally
83+
# Default: "cloudcasting_backend/static/zarr_files"
84+
# Can be absolute or relative path
85+
CLOUDCASTING_BACKEND_ZARR_STORAGE_PATH=cloudcasting_backend/static/zarr_files
86+
87+
# Path to store converted GeoTIFF layers
88+
# Default: "cloudcasting_backend/static/layers"
89+
# These files are served via the /static/ endpoint
90+
CLOUDCASTING_BACKEND_GEOTIFF_STORAGE_PATH=cloudcasting_backend/static/layers
91+
92+
# =============================================================================
93+
# Example Development Configuration
94+
# =============================================================================
95+
# Uncomment and modify these for local development:
96+
97+
# CLOUDCASTING_BACKEND_HOST=127.0.0.1
98+
# CLOUDCASTING_BACKEND_PORT=8000
99+
# CLOUDCASTING_BACKEND_RELOAD=true
100+
# CLOUDCASTING_BACKEND_ENVIRONMENT=dev
101+
# CLOUDCASTING_BACKEND_LOG_LEVEL=DEBUG
102+
# CLOUDCASTING_BACKEND_WORKERS_COUNT=1
103+
104+
# =============================================================================
105+
# Example Production Configuration
106+
# =============================================================================
107+
# For production deployment:
108+
109+
# CLOUDCASTING_BACKEND_HOST=0.0.0.0
110+
# CLOUDCASTING_BACKEND_PORT=8000
111+
# CLOUDCASTING_BACKEND_WORKERS_COUNT=4
112+
# CLOUDCASTING_BACKEND_RELOAD=false
113+
# CLOUDCASTING_BACKEND_ENVIRONMENT=production
114+
# CLOUDCASTING_BACKEND_LOG_LEVEL=INFO
115+
# CLOUDCASTING_BACKEND_SENTRY_DSN=https://[email protected]/project-id
116+
# CLOUDCASTING_BACKEND_SENTRY_SAMPLE_RATE=0.1

.github/workflows/tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ jobs:
88
matrix:
99
cmd:
1010
- black
11-
- ruff
12-
- mypy
1311
runs-on: ubuntu-latest
1412
steps:
1513
- uses: actions/checkout@v4
@@ -35,7 +33,7 @@ jobs:
3533
with:
3634
python-version: '3.11'
3735
- name: Update docker-compose
38-
uses: KengoTODA/actions-setup-docker-compose@v1
36+
uses: docker/setup-buildx-action@v3
3937
with:
4038
version: "2.28.0"
4139
- name: run tests

.pre-commit-config.yaml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,4 @@ repos:
99
name: Format with Black
1010
entry: poetry run black
1111
language: system
12-
types: [python]
13-
14-
- id: ruff
15-
name: Check with Ruff
16-
entry: poetry run ruff
17-
language: system
18-
pass_filenames: false
19-
always_run: true
20-
args: ["check", "cloudcasting_backend", "tests", "--fix"]
21-
22-
- id: mypy
23-
name: Validate types with MyPy
24-
entry: poetry run mypy
25-
language: system
26-
types: [python]
27-
pass_filenames: false
28-
args:
29-
- "cloudcasting_backend"
12+
types: [python]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Open Climate Fix
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)