-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Change directory structure to put pypgstac and pgstac under /src * switch pypgstac to use hatch * move migrations to the pgstac tree * make symlink in pypgstac for migrations * move pgstac.sql to src/pgstac/ * update scripts and docker setup * Cleanup unused files. Adjust tests to work with new scripts * update sql with partitioning rework and maintenance tooling * fix: allow missing aws credential in pre-commit * switch from methodtools to cachetools, remove commented out code * add fix for #156 --------- Co-authored-by: Matt McFarland <mmcfarland@microsoft.com>
- Loading branch information
1 parent
f42e233
commit f39c1c1
Showing
187 changed files
with
7,938 additions
and
2,354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,6 @@ | ||
{ | ||
"name": "Ubuntu", | ||
"build": { | ||
"dockerfile": "../docker/Dockerfile", | ||
}, | ||
|
||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash" | ||
}, | ||
|
||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [], | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [5432], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
//"postCreateCommand": "/docker-entrypoint.sh postgres", | ||
"overrideCommand": false, | ||
|
||
"containerEnv": {"POSTGRES_HOST_AUTH_METHOD": "trust","POSTGRES_USER":"postgres"}, | ||
|
||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "root" | ||
} | ||
"name": "PGStac", | ||
"dockerComposeFile": "../docker-compose.yml", | ||
"service": "pgstac", | ||
"workspaceFolder": "/opt/src" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- id: check-toml | ||
- id: detect-aws-credentials | ||
args: [--allow-missing-credential] | ||
- id: detect-private-key | ||
- id: check-json | ||
- id: mixed-line-ending | ||
- id: check-merge-conflict | ||
|
||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: 'v0.0.231' | ||
hooks: | ||
- id: ruff | ||
files: pypgstac\/.*\.py$ | ||
|
||
- repo: local | ||
hooks: | ||
- id: sql | ||
name: sql | ||
entry: scripts/test | ||
args: [--basicsql, --pgtap] | ||
language: script | ||
pass_filenames: false | ||
verbose: true | ||
fail_fast: true | ||
files: sql\/.*\.sql$ | ||
- id: formatting | ||
name: formatting | ||
entry: scripts/test | ||
args: [--formatting] | ||
language: script | ||
pass_filenames: false | ||
verbose: true | ||
fail_fast: true | ||
always_run: true | ||
- id: pypgstac | ||
name: pypgstac | ||
entry: scripts/test | ||
args: [--pypgstac] | ||
language: script | ||
pass_filenames: false | ||
verbose: true | ||
fail_fast: true | ||
files: pypgstac\/.*\.py$ | ||
- id: migrations | ||
name: migrations | ||
entry: scripts/test | ||
args: [--migrations] | ||
language: script | ||
pass_filenames: false | ||
verbose: true | ||
fail_fast: true | ||
files: migrations\/.*\.sql$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,41 @@ | ||
FROM postgres:13 as pg | ||
|
||
LABEL maintainer="David Bitner" | ||
|
||
FROM postgres:15-bullseye as pg | ||
ENV PGSTACDOCKER=1 | ||
ENV POSTGIS_MAJOR 3 | ||
ENV PGUSER postgres | ||
ENV PGDATABASE postgres | ||
ENV PGHOST localhost | ||
ENV \ | ||
PYTHONUNBUFFERED=1 \ | ||
PYTHONFAULTHANDLER=1 \ | ||
PYTHONDONTWRITEBYTECODE=1 \ | ||
PIP_NO_CACHE_DIR=off \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=on \ | ||
PIP_DEFAULT_TIMEOUT=100 | ||
|
||
RUN \ | ||
apt-get update \ | ||
ENV POSTGIS_VERSION 3.3.2+dfsg-1.pgdg110+1 | ||
ENV PYTHONPATH=/opt/src/pypgstac:/opt/python:${PYTHONPATH} | ||
ENV PATH=/opt/bin:${PATH} | ||
ENV PYTHONWRITEBYTECODE=1 | ||
ENV PYTHONBUFFERED=1 | ||
|
||
RUN set -ex \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
gnupg \ | ||
apt-transport-https \ | ||
debian-archive-keyring \ | ||
software-properties-common \ | ||
ca-certificates \ | ||
python3 python-is-python3 python3-pip \ | ||
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \ | ||
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \ | ||
postgresql-$PG_MAJOR-pgtap \ | ||
postgresql-$PG_MAJOR-partman \ | ||
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ | ||
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \ | ||
build-essential \ | ||
python3 \ | ||
python3-pip \ | ||
python3-setuptools \ | ||
&& pip3 install -U pip setuptools packaging \ | ||
&& pip3 install -U psycopg2-binary \ | ||
&& pip3 install -U psycopg[binary] \ | ||
&& pip3 install -U migra[pg] \ | ||
&& apt-get remove -y apt-transport-https \ | ||
&& apt-get -y autoremove \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
&& apt-get clean && apt-get -y autoremove \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& mkdir -p /opt/src/pypgstac/pypgstac \ | ||
&& touch /opt/src/pypgstac/pypgstac/__init__.py \ | ||
&& touch /opt/src/pypgstac/README.md \ | ||
&& echo '__version__ = "0.0.0"' > /opt/src/pypgstac/pypgstac/version.py | ||
|
||
EXPOSE 5432 | ||
COPY ./src/pypgstac/pyproject.toml /opt/src/pypgstac/pyproject.toml | ||
|
||
RUN mkdir -p /docker-entrypoint-initdb.d | ||
RUN echo "#!/bin/bash \n unset PGHOST \n pypgstac migrate" >/docker-entrypoint-initdb.d/initpgstac.sh && chmod +x /docker-entrypoint-initdb.d/initpgstac.sh | ||
|
||
RUN mkdir -p /opt/src/pypgstac | ||
|
||
WORKDIR /opt/src/pypgstac | ||
|
||
COPY pypgstac /opt/src/pypgstac | ||
RUN \ | ||
pip3 install --upgrade pip \ | ||
&& pip3 install /opt/src/pypgstac[dev,test,psycopg] | ||
|
||
RUN pip3 install -e /opt/src/pypgstac[psycopg] | ||
COPY ./src /opt/src | ||
COPY ./scripts/bin /opt/bin | ||
|
||
ENV PYTHONPATH=/opt/src/pypgstac:${PYTHONPATH} | ||
RUN \ | ||
echo "initpgstac" > /docker-entrypoint-initdb.d/999_initpgstac.sh \ | ||
&& chmod +x /docker-entrypoint-initdb.d/999_initpgstac.sh \ | ||
&& chmod +x /opt/bin/* | ||
|
||
WORKDIR /opt/src |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.