Skip to content

Commit a943301

Browse files
committed
Upgrade to Resonant v0.50.1
1 parent ff0765c commit a943301

15 files changed

Lines changed: 236 additions & 135 deletions

.copier-answers.resonant.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
_commit: v0.48.1
1+
_commit: v0.50.1
22
_src_path: https://github.com/kitware-resonant/cookiecutter-resonant
33
core_app_name: core
44
include_example_code: false

.devcontainer/devcontainer.json

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose
3+
{
4+
"name": "GeoDatalytics",
5+
"dockerComposeFile": [
6+
"../docker-compose.yml",
7+
"../docker-compose.override.yml",
8+
"./docker-compose.devcontainer.yml"
9+
],
10+
"service": "django",
11+
"overrideCommand": true,
12+
// The "vscode" user and remoteUser are set by the base image label (devcontainers/base).
13+
"workspaceFolder": "/home/vscode/geodatalytics",
14+
"features": {
15+
"ghcr.io/devcontainers/features/node:1": {},
16+
"ghcr.io/rails/devcontainer/features/postgres-client:1": {
17+
"version": 18
18+
},
19+
"ghcr.io/devcontainers/features/terraform:1": {},
20+
"ghcr.io/devcontainers/features/aws-cli:1": {},
21+
"ghcr.io/devcontainers/features/github-cli:1": {},
22+
"ghcr.io/devcontainers-extra/features/heroku-cli:1": {}
23+
},
24+
"customizations": {
25+
"vscode": {
26+
"extensions": [
27+
// Python
28+
"ms-python.python",
29+
"ms-python.vscode-pylance",
30+
"ms-python.debugpy",
31+
"ms-python.mypy-type-checker",
32+
"charliermarsh.ruff",
33+
// Django
34+
"batisteo.vscode-django",
35+
"augustocdias.tasks-shell-input",
36+
// Other file formats
37+
"editorconfig.editorconfig",
38+
"mikestead.dotenv",
39+
"tamasfe.even-better-toml",
40+
"timonwong.shellcheck",
41+
// Infrastructure
42+
"ms-azuretools.vscode-containers",
43+
"hashicorp.terraform",
44+
"github.vscode-github-actions",
45+
// Remove AWS extension, as only the CLI is wanted; see: https://github.com/devcontainers/features/issues/1228
46+
"-AmazonWebServices.aws-toolkit-vscode"
47+
],
48+
"settings": {
49+
"containers.containerClient": "com.microsoft.visualstudio.containers.docker",
50+
// Container-specific Python paths
51+
"python.defaultInterpreterPath": "/home/vscode/venv/bin/python",
52+
// Ensure that `envFile` from any user settings is ignored; Docker Compose provides it.
53+
"python.envFile": "",
54+
// Reduce file watcher overhead for generated/cache directories.
55+
"files.watcherExclude": {
56+
"**/__pycache__/**": true,
57+
"**/.pytest_cache/**": true,
58+
"**/node_modules/**": true
59+
}
60+
}
61+
}
62+
},
63+
// Prevent a prompt every time the debugger opens a port or Django auto-restarts.
64+
"otherPortsAttributes": {
65+
"onAutoForward": "silent"
66+
},
67+
"portsAttributes": {
68+
"8000": {
69+
"label": "Django",
70+
// Show a dialog if the port isn't free.
71+
"requireLocalPort": true,
72+
"onAutoForward": "silent"
73+
}
74+
},
75+
// Install a global Python and create a venv before VSCode extensions start,
76+
// to prevent prompts and ensure test discovery works on first load.
77+
"onCreateCommand": {
78+
"python": ["uv", "python", "install", "--default"],
79+
"venv": ["uv", "sync", "--all-extras", "--all-groups"]
80+
},
81+
// Ensure it is re-synced on restarts.
82+
"updateContentCommand": ["uv", "sync", "--all-extras", "--all-groups"]
83+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
services:
2+
django:
3+
# Don't expose ports, devcontainer forwarding is superior, since we can just bind to localhost.
4+
ports: !reset []
5+
# Don't auto-run the default command, launch.json or the terminal will be used.
6+
command: !reset []
7+
8+
celery:
9+
# Celery will be started via launch.json or the terminal.
10+
profiles: ["celery"]
11+
12+
web:
13+
# npm will be started via launch.json or the terminal.
14+
profiles: ["web"]
15+
16+
volumes:
17+
web_node_modules: !reset {}

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ permissions:
88
contents: read
99
jobs:
1010
lint-client:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-24.04
1212
steps:
1313
- uses: actions/checkout@v6
1414
- name: Install npm
@@ -23,7 +23,7 @@ jobs:
2323
working-directory: web
2424
2525
test-server:
26-
runs-on: ubuntu-latest
26+
runs-on: ubuntu-24.04
2727
services:
2828
postgres:
2929
image: postgis/postgis:18-3.6

.github/workflows/nightly_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ permissions:
88
contents: read
99
jobs:
1010
test-server-slow:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-24.04
1212
services:
1313
postgres:
1414
image: postgis/postgis:18-3.6

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ permissions:
88
contents: write
99
jobs:
1010
version-and-release:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-24.04
1212
steps:
1313
- name: Checkout repository
1414
uses: actions/checkout@v6

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Urban areas, particularly those with underserved populations and critical assets
3131

3232
GeoDatalytics is designed to assist urban planners, policymakers, logistics engineers, and infrastructure developers/owners in managing increasingly large, complex, and diverse datasets. By integrating climate data with other critical data types such as infrastructure, sensor, and demographic information using our advanced analytic and visualization tools, users will be empowered to make data-driven decisions.
3333

34-
GeoDatalytics is built with Kitware's [Resonant][girder-4-cookiecutter-link] technology stack. It consists of a series of container services, managed by `docker-compose`. These services include a Django Python server, PostgreSQL/PostGIS database, Minio object store, Vue web application, and Celery task service.
34+
GeoDatalytics is built with Kitware's [Resonant][resonant-cookiecutter-link] technology stack. This stack includes a Django Python server, PostgreSQL/PostGIS database, Minio object store, Vue web application, and Celery task service.
3535

3636
## Getting Started with GeoDatalytics
3737

@@ -42,4 +42,4 @@ To run GeoDatalytics locally with `docker-compose`, follow the instructions in t
4242
[kitware-link]: https://kitware.com
4343
[sds-lab-link]: https://sdslab.io
4444
[mass-mapper-link]: https://maps.massgis.digital.mass.gov/MassMapper/MassMapper.html
45-
[girder-4-cookiecutter-link]: https://github.com/girder/cookiecutter-girder-4
45+
[resonant-cookiecutter-link]: https://github.com/kitware-resonant/cookiecutter-resonant

dev/django.Dockerfile

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
1-
FROM ghcr.io/astral-sh/uv:debian
2-
3-
# Make Python more friendly to running in containers
4-
ENV PYTHONDONTWRITEBYTECODE=1 \
5-
PYTHONUNBUFFERED=1
6-
7-
# Make uv install content in well-known locations
8-
ENV UV_PROJECT_ENVIRONMENT=/var/lib/venv \
9-
UV_CACHE_DIR=/var/cache/uv/cache \
10-
UV_PYTHON_INSTALL_DIR=/var/cache/uv/bin \
11-
# The uv cache and environment are expected to be mounted on different volumes,
12-
# so hardlinks won't work
1+
FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04
2+
3+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
4+
5+
# Ensure Python output appears immediately in container logs.
6+
ENV PYTHONUNBUFFERED=1
7+
8+
# Put the uv cache in a separate location, where it can persist and be shared across containers.
9+
# The uv cache and virtual environment will be on different volumes, so hardlinks won't work.
10+
ENV UV_CACHE_DIR=/home/vscode/uv/cache \
11+
UV_PYTHON_INSTALL_DIR=/home/vscode/uv/bin \
1312
UV_LINK_MODE=symlink
13+
14+
# Put the virtual environment outside the project directory,
15+
# to improve performance on macOS and prevent accidental usage from the host machine.
16+
# Activate it, so `uv run` doesn't need to be prefixed.
17+
ENV UV_PROJECT_ENVIRONMENT=/home/vscode/venv \
18+
PATH="/home/vscode/venv/bin:$PATH"
19+
20+
# Put tool scratch files outside the project directory too.
21+
ENV TOX_WORK_DIR=/home/vscode/tox \
22+
RUFF_CACHE_DIR=/home/vscode/.cache/ruff \
23+
MYPY_CACHE_DIR=/home/vscode/.cache/mypy
24+
25+
RUN ["chsh", "-s", "/usr/bin/zsh", "vscode"]
26+
27+
USER vscode
28+
29+
# Pre-create named volume mount points, so the new volume inherits `vscode` user ownership:
30+
# https://docs.docker.com/engine/storage/volumes/#populate-a-volume-using-a-container
31+
RUN ["mkdir", "/home/vscode/uv"]

dev/docker-development.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Docker Compose Development (without VS Code)
2+
3+
An alternative to the recommended [dev container](../README.md) workflow.
4+
5+
## Setup
6+
1. `docker compose run --rm django ./manage.py migrate`
7+
1. `docker compose run --rm django ./manage.py createsuperuser`
8+
9+
## Run
10+
1. `docker compose up`
11+
1. Access http://localhost:8000/
12+
1. `Ctrl+C` to stop
13+
14+
To include the Celery worker: `docker compose --profile celery up`
15+
16+
## Update
17+
1. `docker compose down`
18+
1. `docker compose pull`
19+
1. `docker compose build --pull`
20+
1. `docker compose run --rm django ./manage.py migrate`
21+
22+
## Reset
23+
Remove all data and volumes: `docker compose down -v`

dev/export-env.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# shellcheck shell=bash
12
# Export environment variables from the .env file in the first argument.
23
# If no argument is given, default to "dev/.env.docker-compose-native".
34
# This file must be sourced, not run.
@@ -21,6 +22,7 @@ fi
2122
# Using "set -a" allows .env files with spaces or comments to work seamlessly
2223
# https://stackoverflow.com/a/45971167
2324
set -a
25+
# shellcheck source=.env.docker-compose-native
2426
. "$_dotenv_file"
2527
set +a
2628

0 commit comments

Comments
 (0)