Skip to content

Commit

Permalink
Bug.docker geopackage (#175)
Browse files Browse the repository at this point in the history
* [service] add better-sqlite3 dependency so geopackage does not try to use the sql.js adapter and crash loading the wasm file because node 18+ new undici url parser cannot parse the wasm url

* [service] use shrinkwrap instead of package-lock for consistent mage server deployments

* [ci] change cache reference from package-lock to shrinkwrap

* [ci] remove obsolete workflow

* [web-app] relax mage.service peer version constraint so npm can install different web-app versions without error

* [docker] install packages from npm instead of local tarballs
[skip ci]

* update changelog [skip ci]
  • Loading branch information
restjohn authored Aug 25, 2023
1 parent 41b8203 commit 54277f6
Show file tree
Hide file tree
Showing 7 changed files with 424 additions and 501 deletions.
317 changes: 0 additions & 317 deletions .github/workflows/build_and_release.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/build_test.service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
node-version: ${{ needs.config.outputs.node_versions-latest }}
cache: npm
cache-dependency-path: |
service/package-lock.json
service/npm-shrinkwrap.json
plugins/nga-msi/package-lock.json
plugins/image/service/package-lock.json
- name: build service
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
node-version: ${{ matrix.node }}
cache: npm
cache-dependency-path: |
service/package-lock.json
service/npm-shrinkwrap.json
- name: install service dependencies
run: |
npm ci --prefix service
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ MAGE adheres to [Semantic Versioning](http://semver.org/).

## [6.2.9](https://github.com/ngageoint/mage-server/releases/tag/6.2.9)
#### Features
* Docker image now installs MAGE packages from NPM registry instead of local tarballs.
* Use a [shrinkwrap](https://docs.npmjs.com/cli/v9/commands/npm-shrinkwrap) file to for consistent `@ngageoint/mage.service` installs.

#### Bug Fixes
* The server was not saving location provider information, such as accuracy and location source, e.g., `gps` or `manual`.
* Previous 6.2.x releases were missing bug fixes from [6.1.3](#6.1.3) and [6.1.2](#6.1.2).
* The service package did not always install [better-sqlite3](https://www.npmjs.com/package/better-sqlite3), which [GeoPackage](https://www.npmjs.com/package/@ngageoint/geopackage) requires to perform operations in the Node.js runtime.

## [6.2.8](https://github.com/ngageoint/mage-server/releases/tag/6.2.8)
#### Features
Expand Down
23 changes: 10 additions & 13 deletions docker/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
FROM node:18-slim

ARG service_version=latest
ARG web_version=${service_version}
ARG image_version=latest
ARG msi_version=latest

LABEL author="NGA"

WORKDIR /root/building
Expand All @@ -18,19 +23,11 @@ RUN groupadd -r mage \
USER mage
ENV MAGE_HOME /home/mage/instance
WORKDIR ${MAGE_HOME}
# add other plugin tarballs below
# TODO: this build should change to install from NPM registry now that 6.2.3+ is published there
COPY \
./ngageoint-mage.service-*.tgz \
./ngageoint-mage.web-app-*.tgz \
./ngageoint-mage.image.service-*.tgz \
./ngageoint-mage.nga-msi-*.tgz \
./
RUN ls -l && npm i --omit=dev ngageoint-mage.service-*.tgz \
&& npm i --omit=dev ngageoint-mage.web-app-*.tgz \
&& npm i --omit=dev ngageoint-mage.image.service-*.tgz \
&& npm i --omit=dev ngageoint-mage.nga-msi-*.tgz \
&& rm *.tgz \
RUN ls -l \
&& npm i --omit dev @ngageoint/mage.service@${service_version} \
&& npm i --omit dev @ngageoint/mage.web-app@${web_version} \
&& npm i --omit dev @ngageoint/mage.image.service@${image_version} \
&& npm i --omit dev @ngageoint/mage.nga-msi@${msi_version} \
&& ln -s ./node_modules/.bin/mage.service

VOLUME /var/lib/mage
Expand Down
Loading

0 comments on commit 54277f6

Please sign in to comment.