Skip to content

Commit

Permalink
Estimate free space calc (#35)
Browse files Browse the repository at this point in the history
* feat: first commit - storage check part

* chore: adding logic to calculate estimated size of gpkg

* chore: third commit - feature without testing

* chore: commit for pr

* chore: lint fix

* chore: lint fix

* chore: updating node for git workflow

* chore: fixing linter problems

* chore: update node version

* chore: pr notes

* test: adding integration + unit + pr notes
  • Loading branch information
ronenkapelian authored Nov 7, 2022
1 parent f05a0e6 commit 8d73a5a
Show file tree
Hide file tree
Showing 22 changed files with 14,738 additions and 76 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12
node-version: 16

- name: Install dependencies
run: npm ci
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12.x, 14.x]
node: [14.x, 16.x]

steps:
- name: Check out Git repository
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:12 as build
FROM node:16 as build


WORKDIR /tmp/buildApp
Expand All @@ -9,7 +9,7 @@ RUN npm install
COPY . .
RUN npm run build

FROM node:12.20.1-alpine3.9 as production
FROM node:16.14.2-alpine3.14 as production

RUN apk add dumb-init

Expand Down
8 changes: 8 additions & 0 deletions config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@
"taskType": "WORKER_TYPES_TILES_TASK_TYPE"
}
},
"jpegTileEstimatedSizeInBytes": {
"__name": "JPEG_TILE_ESTIMATED_SIZE_IN_BYTES",
"__format": "number"
},
"storageFactorBuffer": {
"__name": "STORAGE_FACTOR_BUFFER",
"__format": "number"
},
"tilesProvider": "TILES_PROVIDER",
"gpkgsLocation": "GPKGS_LOCATION",
"downloadServerUrl": "DOWNLOAD_SERVER_URL",
Expand Down
2 changes: 2 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"taskType": "rasterTilesExporter"
}
},
"jpegTileEstimatedSizeInBytes": 12500,
"storageFactorBuffer": 1.25,
"tilesProvider": "S3",
"gpkgsLocation": "/app/tiles_outputs/gpkgs",
"downloadServerUrl": "http://download-service",
Expand Down
2 changes: 2 additions & 0 deletions helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ data:
TILES_PROVIDER: {{ .Values.rasterCommon.storage.tilesStorageProvider | quote }}
DOWNLOAD_SERVER_URL: {{ .Values.rasterCommon.serviceUrls.downloadServer | quote }}
POLLING_TIMEOUT_MS: {{ .Values.env.pollingTimeoutMS | quote }}
JPEG_TILE_ESTIMATED_SIZE_IN_BYTES: {{ .Values.env.estimatedStorageCalculation.jpegTileEstimatedSizeInBytes | quote }}
STORAGE_FACTOR_BUFFER: {{ .Values.env.estimatedStorageCalculation.storageFactorBuffer | quote }}
{{- end }}
3 changes: 3 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ env:
attempts: 5
delay: exponential
shouldResetTimeout: true
estimatedStorageCalculation:
jpegTileEstimatedSizeInBytes: 12500
storageFactorBuffer: 1.25

resources:
enabled: true
Expand Down
6 changes: 6 additions & 0 deletions openapi3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/error'
'507':
description: Insufficient Storage on disk for exporting
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'500':
description: Internal Server Error
content:
Expand Down
Loading

0 comments on commit 8d73a5a

Please sign in to comment.