Skip to content

Commit

Permalink
Debug add_tileset
Browse files Browse the repository at this point in the history
  • Loading branch information
docuracy committed Dec 28, 2024
1 parent 996d0c7 commit ee7f36e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
10 changes: 5 additions & 5 deletions tileserver/repository/api/utils/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ def split_geojson(response, geojson_path, table_path):
table_path: Path to save geometry-less features.
"""
with open(geojson_path, "w") as geojson_file, open(table_path, "w") as table_file:
# Write headers for both files
geojson_file.write('{"type": "FeatureCollection", "features": [\n')
table_file.write('{"features": [\n')

try:
# Write headers for both files
geojson_file.write('{"type": "FeatureCollection", "features": [\n')
table_file.write('{"features": [\n')

logger.info("Streaming GeoJSON data.")
first_geojson_feature = True
first_table_feature = True
Expand Down Expand Up @@ -200,7 +200,7 @@ def add_tileset(tileset_type: str, tileset_id: int) -> str:
random_suffix = generate_random_suffix()
job_name = f"tippecanoe-{tileset_type}-{tileset_id}-{random_suffix}"
image = f"{os.getenv('TIPPECANOE_IMAGE')}:{os.getenv('TIPPECANOE_IMAGE_TAG')}"
geojson_url = f"http://django-service.whg.svc.cluster.local:8000/mapdata/{tileset_type}/{tileset_id}/standard/refresh/"
geojson_url = f"http://django-service.whg.svc.cluster.local:8000/mapdata/{tileset_type}/{tileset_id}/refresh/full/"
citation_url = f"http://django-service.whg.svc.cluster.local:8000/{tileset_type}/{tileset_id}/citation"
restart_url = f"http://tileapi.{namespace}.svc.cluster.local:{os.getenv('PORT')}/restart"

Expand Down
5 changes: 2 additions & 3 deletions whg/.helmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
files/node_modules/

.DS_Store
# Common VCS dirs
.git/
Expand Down
11 changes: 8 additions & 3 deletions whg/templates/django-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ spec:
- |
if [ ! -d "/app/.git" ]; then
echo "Repository not found, cloning...";
git clone -b main https://github.com/{{ .Values.django.githubRepository }}.git /app || { echo 'Cloning failed'; exit 1; }
git clone -b {{ .Values.django.githubBranch }} https://github.com/{{ .Values.django.githubRepository }}.git /app || { echo 'Cloning failed'; exit 1; }
else
echo "Repository already cloned.";
echo "Repository already cloned. Pulling latest changes...";
cd /app
git fetch origin {{ .Values.django.githubBranch }}
git checkout {{ .Values.django.githubBranch }} || { echo 'Failed to checkout branch'; exit 1; }
git reset --hard origin/{{ .Values.django.githubBranch }} && git pull --rebase || { echo 'Pulling failed'; exit 1; }
fi
mkdir -p /app/whg/authorisation
cp --remove-destination /app/whg/secret/local_settings.py /app/whg/
cp --remove-destination /app/whg/secret/env_template.py /app/server-admin/
cp --remove-destination /app/whg/secret/ca-cert.pem /app/whg/authorisation/
Expand All @@ -45,7 +50,7 @@ spec:
{{- end }}
- name: secret-volume
mountPath: /app/whg/secret
readOnly: true
readOnly: false
containers:
- name: django-container
image: {{ .Values.django.image }}:{{ .Values.django.imageTag }}
Expand Down
1 change: 1 addition & 0 deletions whg/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ django:
imageTag: "0.1.7"
imagePullPolicy: "IfNotPresent"
githubRepository: "WorldHistoricalGazetteer/whg3"
githubBranch: "staging"
securityContext:
runAsUser: 1000
runAsGroup: 1000
Expand Down

0 comments on commit ee7f36e

Please sign in to comment.