Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable parser service until we fix #2111 #2441

Merged
merged 1 commit into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 6 additions & 5 deletions docker/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,12 @@ services:
depends_on:
- test-web-content

parser:
environment:
# For development and testing, the Parser service needs to contact the users
# service directly via Docker vs through the http://localhost domain.
- USERS_URL=http://users:7000
# TODO: https://github.com/Seneca-CDOT/telescope/issues/2111
# parser:
# environment:
# # For development and testing, the Parser service needs to contact the users
# # service directly via Docker vs through the http://localhost domain.
# - USERS_URL=http://users:7000

planet:
ports:
Expand Down
60 changes: 30 additions & 30 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,36 +220,36 @@ services:
- 'traefik.http.middlewares.strip_users_prefix.stripprefix.forceSlash=true'
- 'traefik.http.routers.users.middlewares=strip_users_prefix'

# parser service
parser:
container_name: 'parser'
build:
context: ../src/api/parser
dockerfile: Dockerfile
environment:
- NODE_ENV
- PARSER_PORT
- USERS_URL
# Satellite authentication/authorization support
- JWT_ISSUER
- JWT_AUDIENCE
- SECRET
depends_on:
- traefik
- redis
- users
- elasticsearch
labels:
# Enable Traefik
- 'traefik.enable=true'
# Traefik routing for the parser service at /v1/parser
- 'traefik.http.routers.parser.rule=PathPrefix(`/${API_VERSION}/parser`)'
# Specify the parser service port
- 'traefik.http.services.parser.loadbalancer.server.port=${PARSER_PORT}'
# Add middleware to this route to strip the /v1/parser prefix
- 'traefik.http.middlewares.strip_parser_prefix.stripprefix.prefixes=/${API_VERSION}/parser'
- 'traefik.http.middlewares.strip_parser_prefix.stripprefix.forceSlash=true'
- 'traefik.http.routers.parser.middlewares=strip_parser_prefix'
# parser service - disabled, https://github.com/Seneca-CDOT/telescope/issues/2111
# parser:
# container_name: 'parser'
# build:
# context: ../src/api/parser
# dockerfile: Dockerfile
# environment:
# - NODE_ENV
# - PARSER_PORT
# - USERS_URL
# # Satellite authentication/authorization support
# - JWT_ISSUER
# - JWT_AUDIENCE
# - SECRET
# depends_on:
# - traefik
# - redis
# - users
# - elasticsearch
# labels:
# # Enable Traefik
# - 'traefik.enable=true'
# # Traefik routing for the parser service at /v1/parser
# - 'traefik.http.routers.parser.rule=PathPrefix(`/${API_VERSION}/parser`)'
# # Specify the parser service port
# - 'traefik.http.services.parser.loadbalancer.server.port=${PARSER_PORT}'
# # Add middleware to this route to strip the /v1/parser prefix
# - 'traefik.http.middlewares.strip_parser_prefix.stripprefix.prefixes=/${API_VERSION}/parser'
# - 'traefik.http.middlewares.strip_parser_prefix.stripprefix.forceSlash=true'
# - 'traefik.http.routers.parser.middlewares=strip_parser_prefix'

# planet service
planet:
Expand Down
11 changes: 6 additions & 5 deletions docker/gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ services:
depends_on:
- test-web-content

parser:
environment:
# For development and testing, the Parser service needs to contact the users
# service directly via Docker vs through the http://localhost domain.
- USERS_URL=http://users:7000
# TODO: https://github.com/Seneca-CDOT/telescope/issues/2111
# parser:
# environment:
# # For development and testing, the Parser service needs to contact the users
# # service directly via Docker vs through the http://localhost domain.
# - USERS_URL=http://users:7000
7 changes: 4 additions & 3 deletions docker/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ services:
# This will take care of copying the serviceAccountKey.json file needed by firestore.js
- ../../firebase/serviceAccountKey.json:/app/serviceAccountKey.json

# users service
parser:
restart: unless-stopped
# TODO: https://github.com/Seneca-CDOT/telescope/issues/2111
# parser service
# parser:
# restart: unless-stopped

# planet service
planet:
Expand Down
16 changes: 9 additions & 7 deletions src/api/parser/src/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
const { Satellite, isAuthenticated, isAuthorized } = require('@senecacdot/satellite');
const { router } = require('bull-board');
// TODO: https://github.com/Seneca-CDOT/telescope/issues/2345
// const { router } = require('bull-board');
// const startParserQueue = require('./parser-queue');

const service = new Satellite();

// We're commenting startParserQueue() for now so it doesn't clash with our current backend, will uncomment when tests go in and we remove the backend.
// startParserQueue();

// Re-enable as part of // TODO: https://github.com/Seneca-CDOT/telescope/issues/2345
// Only authenticated Telescope users, or other services, can hit this route
service.router.get(
'/',
isAuthenticated(),
isAuthorized((req, user) => user.roles.includes('telescope') || user.roles.includes('service')),
router
);
// service.router.get(
// '/',
// isAuthenticated(),
// isAuthorized((req, user) => user.roles.includes('telescope') || user.roles.includes('service')),
// router
// );

module.exports = service;