Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
043f493
feat: wip implement delete layer
vitaligi Jul 14, 2026
d794f6e
test: move test file to strategies dir
vitaligi Jul 15, 2026
31fc947
feat: add delete batch size configuration for s3 and fs storage provi…
vitaligi Jul 15, 2026
f980673
chore: remove extra space in start:dev script
vitaligi Jul 15, 2026
0353800
refactor: remove and update logs
vitaligi Jul 15, 2026
190bf40
test: fix test mocked config returned value
vitaligi Jul 15, 2026
e852150
fix: s3 storage provider matching keys handling
vitaligi Jul 20, 2026
80bb5ca
test: reorder and fix flaky tests and improve coverage
vitaligi Jul 20, 2026
fd3b1e3
refactor: extract function to a path module
vitaligi Jul 20, 2026
7c43941
refactor: extract function to a path module
vitaligi Jul 20, 2026
9e0fe7f
fix: fs and s3 bacth size config value parsing
vitaligi Jul 20, 2026
a95b43b
fix: regression in delete of chunks exceeding 1000 objects
vitaligi Jul 20, 2026
c19b137
test: add tests covering s3 chunk limit regression
vitaligi Jul 20, 2026
2163115
fix: prevent batch size from being zero or less
vitaligi Jul 20, 2026
b070a9f
test: cover batch size configuration
vitaligi Jul 20, 2026
cd65186
refactor: reduce number of potential matching paths
vitaligi Jul 20, 2026
6753f52
refactor: unshadow detected file instead of dir config error
vitaligi Jul 20, 2026
919c01a
chore: missing env value in configmap
vitaligi Jul 20, 2026
ba892c6
refactor: change fsBasePath from tilesDeletion strategy config
vitaligi Jul 20, 2026
271560b
chore: add artifacts-deletion simulation to the deletion script
vitaligi Jul 20, 2026
e0bbca7
test: fix lint error of import order
vitaligi Jul 20, 2026
398fb51
refactor: reorder functions
vitaligi Jul 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"js/ts.tsdk.path": "node_modules/typescript/lib",
"files.eol": "\n",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"files.insertFinalNewline": true
Expand Down
50 changes: 38 additions & 12 deletions config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,44 @@
"__format": "boolean"
}
},
"s3": {
"endpoint": "S3_ENDPOINT",
"accessKeyId": "S3_ACCESS_KEY_ID",
"secretAccessKey": "S3_SECRET_ACCESS_KEY",
"sslEnabled": {
"__name": "S3_SSL_ENABLED",
"__format": "boolean"
"storage": {
"cleanupStorageProviders": {
"__name": "CLEANUP_STORAGE_PROVIDERS",
"__format": "json"
},
"forcePathStyle": {
"__name": "S3_FORCE_PATH_STYLE",
"__format": "boolean"
"s3": {
"delete": {
"batchSize": {
"__name": "S3_DELETE_BATCH_SIZE",
"__format": "number"
}
},
"endpoint": "S3_ENDPOINT",
"accessKeyId": "S3_ACCESS_KEY_ID",
"secretAccessKey": "S3_SECRET_ACCESS_KEY",
"sslEnabled": {
"__name": "S3_SSL_ENABLED",
"__format": "boolean"
},
"forcePathStyle": {
"__name": "S3_FORCE_PATH_STYLE",
"__format": "boolean"
},
"region": "S3_REGION"
},
"region": "S3_REGION"
"fs": {
"delete": {
"batchSize": {
"__name": "FS_DELETE_BATCH_SIZE",
"__format": "number"
}
},
"basePath": "FS_BASE_PATH"
}
},
"strategies": {
"tilesDeletion": {
"s3Bucket": "TILES_DELETION_S3_BUCKET",
"fsBasePath": "TILES_DELETION_FS_BASE_PATH",
"batchSize": {
"__name": "TILES_DELETION_BATCH_SIZE",
"__format": "number"
Expand All @@ -103,6 +123,12 @@
"__name": "TILES_DELETION_FAILURE_SAMPLE_SIZE",
"__format": "number"
}
},
"storedResourcesDeletion": {
"failureSampleSize": {
"__name": "STORED_RESOURCES_DELETION_FAILURE_SAMPLE_SIZE",
"__format": "number"
}
}
}
}
59 changes: 45 additions & 14 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"level": "info",
"prettyPrint": false,
"opentelemetryOptions": {
"enabled": false,
"url": "",
"resourceAttributes": {}
"enabled": false
}
}
},
Expand All @@ -28,18 +26,26 @@
{
"job": "Ingestion_Swap_Update",
"task": "tiles-deletion"
},
{
"job": "Delete_Layer",
"task": "tiles-deletion"
},
{
"job": "Delete_Layer",
"task": "artifacts-deletion"
}
]
}
},
"queue": {
"jobManagerBaseUrl": "http://localhost:8080",
"heartbeatBaseUrl": "http://localhost:8081",
"jobManagerBaseUrl": "http://localhost:8081",
"heartbeatBaseUrl": "http://localhost:8082",
"heartbeatIntervalMs": 1000,
"dequeueIntervalMs": 3000
},
"servicesUrl": {
"jobTracker": "http://localhost:8082"
"jobTracker": "http://localhost:8083"
},
"disableHttpClientLogs": false,
"jobDefinitions": {
Expand All @@ -49,12 +55,23 @@
},
"swapUpdate": {
"type": "Ingestion_Swap_Update"
},
"deleteLayer": {
"type": "Delete_Layer"
}
},
"tasks": {
"tilesDeletion": {
"type": "tiles-deletion",
"maxAttempts": 3
},
"layerDeletion": {
"type": "tiles-deletion",
"maxAttempts": 3
},
"artifactsDeletion": {
"type": "artifacts-deletion",
"maxAttempts": 3
}
}
},
Expand All @@ -63,21 +80,35 @@
"delay": "exponential",
"shouldResetTimeout": true
},
"s3": {
"endpoint": "http://localhost:9000",
"accessKeyId": "minioadmin",
"secretAccessKey": "minioadmin",
"sslEnabled": false,
"forcePathStyle": true,
"region": "us-east-1"
"storage": {
"cleanupStorageProviders": ["FS", "S3"],
"s3": {
"delete": {
"batchSize": 1000
},
"endpoint": "http://localhost:9000",
"accessKeyId": "minioadmin",
"secretAccessKey": "minioadmin",
"sslEnabled": false,
"forcePathStyle": true,
"region": "us-east-1"
},
"fs": {
"delete": {
"batchSize": 1000
},
"basePath": "/tiles"
}
},
"strategies": {
"tilesDeletion": {
"s3Bucket": "",
"fsBasePath": "/tiles",
"batchSize": 1000,
"concurrency": 10,
"failureSampleSize": 3
},
"storedResourcesDeletion": {
"failureSampleSize": 3
}
}
}
15 changes: 13 additions & 2 deletions helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
{{- $serviceUrls := fromYaml (include "common.serviceUrls.merged" .) -}}
{{- $storage := fromYaml (include "common.storage.merged" .) -}}
{{- $s3 := ($storage.s3) | default dict -}}
{{- $internalPvc := (($storage.fs).internalPvc) | default dict -}}
{{- $fs := ($storage.fs) | default dict -}}
{{- $internalPvc := (($fs).internalPvc) | default dict -}}
{{- $tilesFSBasePath := clean (printf "/%s/%s" $internalPvc.mountPath ($internalPvc.tilesSubPath | default "tiles")) -}}
{{- if .Values.enabled -}}
apiVersion: v1
Expand Down Expand Up @@ -54,15 +55,25 @@ data:
{{- with .Values.env.jobnik.worker }}
JOBNIK_WORKER_CONCURRENCY: {{ .concurrency | default 1 | quote }}
{{- end }}
CLEANUP_STORAGE_PROVIDERS: {{ $storage.cleanupStorageProviders | toJson | quote }}
{{- if has "S3" $storage.cleanupStorageProviders }}
S3_DELETE_BATCH_SIZE: {{ $s3.delete.batchSize | default 1000 | quote }}
S3_ENDPOINT: {{ if $s3.endpointUrl }}{{ printf "%s://%s" ($s3.sslEnabled | ternary "https" "http") $s3.endpointUrl | quote }}{{ else }}{{ "" | quote }}{{ end }}
S3_FORCE_PATH_STYLE: {{ $s3.forcePathStyle | default false | quote }}
S3_SSL_ENABLED: {{ $s3.sslEnabled | default false | quote }}
S3_REGION: {{ $s3.region | default "us-east-1" | quote }}
{{- end }}
{{- if has "FS" $storage.cleanupStorageProviders }}
FS_DELETE_BATCH_SIZE: {{ $fs.delete.batchSize | default 1000 | quote }}
FS_BASE_PATH: {{ $tilesFSBasePath | quote }}
{{- end }}
TILES_DELETION_S3_BUCKET: {{ $s3.tilesBucket | default "" | quote }}
TILES_DELETION_FS_BASE_PATH: {{ $tilesFSBasePath | quote }}
{{- with .Values.env.strategies.tilesDeletion }}
TILES_DELETION_BATCH_SIZE: {{ .batchSize | default 1000 | quote }}
TILES_DELETION_CONCURRENCY: {{ .concurrency | default 10 | quote }}
TILES_DELETION_FAILURE_SAMPLE_SIZE: {{ .failureSampleSize | default 3 | quote }}
{{- end }}
{{- with .Values.env.strategies.storedResourcesDeletion }}
STORED_RESOURCES_DELETION_FAILURE_SAMPLE_SIZE: {{ .failureSampleSize | default 3 | quote }}
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ spec:
imagePullPolicy: {{ .pullPolicy | default "IfNotPresent" }}
{{- end }}
{{- if .Values.command }}
command:
command:
{{- toYaml .Values.command | nindent 12 }}
{{- if .Values.args }}
args:
args:
{{- toYaml .Values.args | nindent 12 }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -122,7 +122,7 @@ spec:
httpGet:
path: {{ .Values.readinessProbe.path }}
port: {{ .Values.env.targetPort }}
{{- end }}
{{- end }}
{{- if .Values.resources.enabled }}
resources:
{{- toYaml .Values.resources.value | nindent 12 }}
Expand Down
9 changes: 9 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@ serviceUrls:
jobTracker: ""

storage:
cleanupStorageProviders:
- FS
- S3
s3:
delete:
batchSize: 1000
endpointUrl: ""
forcePathStyle: true
secretName: ""
sslEnabled: false
region: ""
tilesBucket: ""
fs:
delete:
batchSize: 1000
internalPvc:
enabled: false
name: ""
Expand Down Expand Up @@ -128,6 +135,8 @@ env:
batchSize: 1000
concurrency: 10
failureSampleSize: 3
storedResourcesDeletion:
failureSampleSize: 3

resources:
enabled: true
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"prebuild": "npm run clean",
"build": "tsc --project tsconfig.build.json && tsc-alias -p tsconfig.build.json && npm run assets:copy",
"start": "npm run build && cd dist && node --import ./instrumentation.mjs ./index.js",
"start:dev": "npm run build && cd dist && cross-env CONFIG_OFFLINE_MODE=true node --enable-source-maps --import ./instrumentation.mjs ./index.js",
"start:dev": "npm run build && cd dist && cross-env CONFIG_OFFLINE_MODE=true node --enable-source-maps --import ./instrumentation.mjs ./index.js",
"assets:copy": "copyfiles -f ./config/* ./dist/config && copyfiles ./package.json dist",
"clean": "rimraf dist",
"prepare": "node .husky/install.mjs"
Expand All @@ -37,7 +37,7 @@
"@map-colonies/js-logger": "^5.0.0",
"@map-colonies/mc-priority-queue": "^9.1.0",
"@map-colonies/mc-utils": "^5.1.0",
"@map-colonies/raster-shared": "^8.1.0-alpha.3",
"@map-colonies/raster-shared": "^8.3.0-alpha.1",
"@map-colonies/read-pkg": "^1.0.0",
"@map-colonies/schemas": "^1.20.0",
"@map-colonies/telemetry": "^10.0.1",
Expand Down
Loading
Loading