Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 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
96dd83b
refactor: modify providers deletion response
vitaligi Jul 22, 2026
a499006
refactor: modify deletion failure summary report
vitaligi Jul 22, 2026
2bb2ccb
feat: add a function to merge failure results
vitaligi Jul 22, 2026
a10ab79
refactor: update s3 storage provider with failure output change
vitaligi Jul 22, 2026
9cd57aa
refactor: update fs storage provider with failure output change
vitaligi Jul 23, 2026
82fd062
refactor: update delete stored resoures strategy with failure output …
vitaligi Jul 23, 2026
47310b8
refactor: update tiles deletion strategy with failure output change
vitaligi Jul 23, 2026
eaae536
refactor: rename file
vitaligi Jul 23, 2026
50ba9bf
refactor: add and improve log messages
vitaligi Jul 23, 2026
c5c7ae2
refactor: rename vars for clarity
vitaligi Jul 23, 2026
c7f580a
refactor: remove unused config vars of sample size
vitaligi Jul 26, 2026
04d5fdd
refactor: fix and improve logs
vitaligi Jul 26, 2026
fa5b8f2
fix: map data structure handling
vitaligi Jul 26, 2026
5657069
style: string formatting
vitaligi Jul 26, 2026
238dd4f
refactor: improve logs
vitaligi Jul 26, 2026
4ecfdfe
refactor: pr comment use storage type
vitaligi Jul 26, 2026
0bb370c
fix: report full path failure
vitaligi Jul 27, 2026
2c8517d
fix: keep existing example if exists
vitaligi Jul 27, 2026
31d9f95
build: update @map-colonies/raster-shared
vitaligi Jul 27, 2026
b1b6036
refactor: restore previous behavior of sample logging
vitaligi Jul 27, 2026
7610350
fix: error count
vitaligi Jul 27, 2026
63af704
fix: total errors count
vitaligi Jul 27, 2026
2b9d787
docs: update interface properties description
vitaligi Jul 27, 2026
966b839
test: rename test file and update tests
vitaligi Jul 27, 2026
a48b335
feat: consume subpath for resource deletion
vitaligi Jul 28, 2026
0aafe58
chore: update FS_BASE_PATH to use internalPvc.mountPath only
vitaligi Jul 28, 2026
d5c53ca
feat: add support for available subPaths in storage configuration and…
vitaligi Jul 29, 2026
231afa1
refactor: modify log messages
vitaligi Jul 29, 2026
953beab
test: update tests with changes and add some additional tests
vitaligi Jul 29, 2026
fe69678
refactor: modify paths validity checks
vitaligi Jul 29, 2026
e749794
refactor: log fs paths deletion progress
vitaligi Jul 29, 2026
51dc59f
chore: fix config of fs
vitaligi Jul 29, 2026
609f4da
fix: tiles deletion strategy should include configured sub path
vitaligi Jul 29, 2026
0e93e2d
test: modify tests and setup to support fs sub path
vitaligi Jul 29, 2026
acd2549
refactor: enrich log message with example page response
vitaligi Jul 29, 2026
a33d514
refactor: pr comment rename deletion result interface
vitaligi Jul 29, 2026
b52f5d5
fix: enhance path validation for sub paths
vitaligi Jul 29, 2026
44470c5
fix: deletion count calculation in TilesDeletionStrategy
vitaligi Jul 29, 2026
f7e9126
fix: track processed tiles count during batch deletion
vitaligi Jul 29, 2026
1b86ddc
refactor: remove chunking since it is also done at tileDeletionStrate…
vitaligi Jul 29, 2026
f3021c8
refactor: update FS and S3 storage providers to use DI and modify con…
vitaligi Jul 30, 2026
d106d79
refactor: should short-circuit empty paths input
vitaligi Jul 30, 2026
df485bd
test: update test files with config setup validations and cover edge …
vitaligi Jul 30, 2026
479fd27
test: add mergeFailures tests
vitaligi Jul 30, 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
53 changes: 37 additions & 16 deletions config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,35 +73,56 @@
"__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",
"subPaths": {
"__name": "FS_SUB_PATHS",
"__format": "json"
}
}
},
"strategies": {
"tilesDeletion": {
"s3Bucket": "TILES_DELETION_S3_BUCKET",
"fsBasePath": "TILES_DELETION_FS_BASE_PATH",
"fsSubPath": "TILES_DELETION_FS_SUB_PATH",
"batchSize": {
"__name": "TILES_DELETION_BATCH_SIZE",
"__format": "number"
},
"concurrency": {
"__name": "TILES_DELETION_CONCURRENCY",
"__format": "number"
},
"failureSampleSize": {
"__name": "TILES_DELETION_FAILURE_SAMPLE_SIZE",
"__format": "number"
}
}
}
Expand Down
63 changes: 47 additions & 16 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": "/data",
"subPaths": {
"tilesSubPath": "tiles"
}
}
},
"strategies": {
"tilesDeletion": {
"s3Bucket": "",
"fsBasePath": "/tiles",
"fsSubPath": "tiles",
"batchSize": 1000,
"concurrency": 10,
"failureSampleSize": 3
"concurrency": 10
}
}
}
24 changes: 20 additions & 4 deletions helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
{{- $serviceUrls := fromYaml (include "common.serviceUrls.merged" .) -}}
{{- $storage := fromYaml (include "common.storage.merged" .) -}}
{{- $s3 := ($storage.s3) | default dict -}}
{{- $internalPvc := (($storage.fs).internalPvc) | default dict -}}
{{- $tilesFSBasePath := clean (printf "/%s/%s" $internalPvc.mountPath ($internalPvc.tilesSubPath | default "tiles")) -}}
{{- $fs := ($storage.fs) | default dict -}}
{{- $internalPvc := (($fs).internalPvc) | default dict -}}
{{- $fsBasePath := clean (printf "/%s" $internalPvc.mountPath) -}}
{{- $fsTilesDeletionSubPath := clean (printf "%s" ($internalPvc.tilesSubPath | default "tiles")) -}}
{{- if .Values.enabled -}}
apiVersion: v1
kind: ConfigMap
Expand Down Expand Up @@ -54,15 +56,29 @@ 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: {{ $fsBasePath | quote }}
{{- $subPaths := dict -}}
{{- range $key, $val := $internalPvc -}}
{{- if and (hasSuffix "SubPath" $key) $val -}}
{{- $_ := set $subPaths (trimSuffix "SubPath" $key) (clean $val) -}}
{{- end -}}
{{- end }}
FS_SUB_PATHS: {{ $subPaths | toJson | quote }}
TILES_DELETION_FS_SUB_PATH: {{ $fsTilesDeletionSubPath | 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 }}
{{- 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
11 changes: 8 additions & 3 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,26 @@ 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: ""
mountPath: ""
tilesSubPath: ""

tilesSubPath: "" # e.g. folder/tiles

mclabels:
component: backend
Expand Down Expand Up @@ -127,7 +133,6 @@ env:
tilesDeletion:
batchSize: 1000
concurrency: 10
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.2",
"@map-colonies/read-pkg": "^1.0.0",
"@map-colonies/schemas": "^1.20.0",
"@map-colonies/telemetry": "^10.0.1",
Expand Down
Loading
Loading