-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integration test setup for uploading/processing
This is a significant change to how the app is setup. Config has been strictly refactored. Striving for all ENV in .env and accessing all config through values set in config.js. I suspect the build process had become unfocussed overtime so I've attempted to somewhat start from scratch. There is now a simpler Dockerfile and docker-compose setup and LocalOAM has been removed. There is now no test-specific code in the codebase. Includes a single test that runs against the dockerised API, uploads some imagery and waits for it to be processed.
- Loading branch information
Showing
50 changed files
with
304 additions
and
839 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
Dockerfile | ||
node_modules | ||
newrelic_agent.log | ||
npm-debug.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,38 @@ | ||
LOCALOAM_VOLUME=~/hotosm/data | ||
HOST_PREFIX=http://localhost:4999 | ||
# Environment variables. | ||
# | ||
# * This is a canonical refrence. *All* ENV vars needed in *all* | ||
# environments should be placed here. | ||
# * A `.env` is a requirement of *all* environments, including tests. | ||
# * Copy `.env.sample` to `.env` for it to be automatically sourced. | ||
# * See /config.js for individual explanations of each variable. | ||
# * Dont use "" quotes | ||
|
||
# API | ||
PORT=4000 | ||
HOST=0.0.0.0 | ||
COOKIE_PASSWORD=123abc | ||
DB_URI=mongodb://localhost:27017/oam-api | ||
|
||
# OAM-specific | ||
# OAM_DEBUG=true|false should be used on the command line | ||
OIN_REGISTER_URL=http://localhost:8080/catalog/fixtures/oin-buckets-testing.json | ||
OIN_BUCKET=oin-hotosm-staging | ||
UPLOAD_BUCKET=oam-uploader-staging-temp | ||
# Run quickly like this only for non-production | ||
CRON_TIME=* * * * * | ||
GDRIVE_KEY=abc123 | ||
MAX_WORKERS=1 | ||
TILER_BASE_URL=http://tiles.openaerialmap.org | ||
|
||
# Third party | ||
NEW_RELIC_LICENSE_KEY=123abc | ||
SENDGRID_API_KEY=123 | ||
SENDGRID_FROM=[email protected] | ||
AWS_ACCESS_KEY_ID=123 | ||
AWS_SECRET_ACCESS_KEY=abc | ||
AWS_REGION=us-east-1 | ||
|
||
# To be deprecated | ||
ADMIN_USERNAME=admin | ||
ADMIN_PASSWORD=admin | ||
SECRET_TOKEN=insecuretoken |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,11 @@ | ||
FROM quay.io/hotosm/oam-dynamic-tiler-tools | ||
ENV NPM_CONFIG_LOGLEVEL warn | ||
|
||
# Install app dependencies | ||
ADD package.json /tmp/package.json | ||
RUN cd /tmp && npm install | ||
|
||
# Create app directory | ||
RUN mkdir -p /usr/src/app && cp -a /tmp/node_modules /usr/src/app | ||
WORKDIR /usr/src/app | ||
|
||
# Bundle app source | ||
ADD . /usr/src/app | ||
|
||
# Go ahead and install nodemon for convenience while developing | ||
RUN \ | ||
npm install -g nodemon \ | ||
&& rm -rf /root/.npm | ||
|
||
# Set TMPDIR environment variable | ||
ENV TMPDIR /tmp | ||
|
||
RUN mkdir -p /app | ||
COPY . /app | ||
|
||
WORKDIR /app | ||
|
||
RUN \ | ||
npm install \ | ||
&& rm -rf /root/.npm | ||
RUN npm install | ||
|
||
EXPOSE 4000 | ||
|
||
CMD [ "node", "index.js" ] | ||
|
||
CMD ["./node_modules/.bin/nf", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
web: node index.js | ||
worker: node catalog-worker.js |
Oops, something went wrong.