-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feature/meditor 937 upgrade and simplify meditor #69
Changes from 11 commits
3b1176f
7321ce0
1d5a999
6e80b53
c6d7877
52d1c48
942a581
6c9474c
bb101d4
dc441d8
1f3fc31
3c6babd
ba48d7d
5ecb56e
7812f0a
8b34c94
11651f8
f0b2cb4
6fc25c7
73660e4
c54689b
690f096
4b7d817
1ac04df
4549552
97abd90
faa5fa9
67003d2
cae9cae
0c6349f
24d7c0f
6945a5c
6f2d50b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Docker has introduced "develop" parameters that only take effect when developing locally, making a separate override compose unnecessary |
This file was deleted.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Most of this is merging the two docker compose files together, noting where there are new items or updates There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I'll need your help to get this running. I must have something misconfigured, but a docker system prune + rebuild and a few minutes of searching around yielded nothing. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
services: | ||
notebookviewer: | ||
depends_on: | ||
- legacy-api | ||
container_name: meditor_notebookviewer | ||
build: packages/notebook-viewer | ||
environment: | ||
- FLASK_ENV=development | ||
env_file: | ||
- .env | ||
volumes: | ||
- ./packages/notebook-viewer:/usr/src/app | ||
|
||
proxy: | ||
container_name: meditor_proxy | ||
build: packages/proxy | ||
restart: on-failure | ||
ports: | ||
- "127.0.0.1:80:8080" | ||
depends_on: | ||
- legacy-api | ||
- nats | ||
- app | ||
- database | ||
|
@@ -16,36 +24,72 @@ services: | |
notifier: | ||
depends_on: | ||
- nats | ||
container_name: meditor_notifier | ||
build: packages/notifier | ||
restart: on-failure | ||
env_file: | ||
- .env | ||
volumes: | ||
- ./packages/notifier:/usr/src/app | ||
- /usr/src/app/node_modules | ||
|
||
app: | ||
depends_on: | ||
- legacy-api | ||
container_name: meditor_app | ||
build: packages/app | ||
restart: on-failure | ||
env_file: | ||
- .env | ||
ports: | ||
- "127.0.0.1:4000:4000" | ||
develop: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New develop section for the app, makes volume mounting unnecessary. If you do |
||
watch: | ||
- action: sync | ||
path: ./packages/app | ||
target: /usr/src/app | ||
ignore: | ||
- node_modules/ | ||
- .next/ | ||
- action: rebuild | ||
path: package.json | ||
|
||
docs: | ||
container_name: meditor_docs | ||
build: packages/docs | ||
env_file: | ||
- .env | ||
ports: | ||
- "127.0.0.1:3030:3030" | ||
depends_on: | ||
- legacy-api | ||
- app | ||
|
||
legacy-api: | ||
depends_on: | ||
- database | ||
- nats | ||
|
||
database: | ||
image: ${REGISTRY}mongo:4.1.4 | ||
container_name: meditor_database | ||
volumes: | ||
- ./mongo-data:/data/db | ||
ports: | ||
- "127.0.0.1:27018:27017" | ||
|
||
nats: | ||
image: ${REGISTRY}nats-streaming:0.15.1 | ||
container_name: meditor_nats | ||
volumes: | ||
- ./nats-data:/nats/data | ||
ports: | ||
- "127.0.0.1:4222:4222" | ||
- "127.0.0.1:8222:8222" | ||
|
||
monitor: | ||
image: ${REGISTRY}portainer/portainer:1.20.0 | ||
container_name: meditor_monitor | ||
command: -H unix:///var/run/docker.sock | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- monitor-data:/data | ||
|
||
agent: | ||
image: ${REGISTRY}portainer/agent:1.1.2 | ||
container_name: meditor_agent | ||
environment: | ||
AGENT_CLUSTER_ADDR: tasks.agent | ||
volumes: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
DB_NAME=meditor | ||
HOST='http://localhost:3000/meditor' | ||
NEXT_PUBLIC_API_BASE_PATH='/meditor/api' | ||
NEXT_PUBLIC_IMAGE_UPLOAD_URL='https://lb.gesdisc.eosdis.nasa.gov/images/upload' | ||
NEXT_PUBLIC_NOTEBOOKVIEWER_URL='/meditor/notebookviewer/' | ||
NEXTAUTH_URL=http://localhost:3000/meditor/api/auth | ||
NEXTAUTH_URL_INTERNAL=http://localhost:3000/meditor/api/auth |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
DB_NAME=meditor | ||
HOST='https://lb.gesdisc.eosdis.nasa.gov/meditor' | ||
NEXT_PUBLIC_API_BASE_PATH='/meditor/api' | ||
NEXT_PUBLIC_IMAGE_UPLOAD_URL='https://lb.gesdisc.eosdis.nasa.gov/images/upload' | ||
NEXT_PUBLIC_NOTEBOOKVIEWER_URL='/meditor/notebookviewer/' | ||
NEXTAUTH_URL=https://lb.gesdisc.eosdis.nasa.gov/meditor/api/auth | ||
NEXTAUTH_URL_INTERNAL=https://meditor_app:3000/meditor/api/auth |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Auto-updated from ESLint upgrade |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
"extends": "next/core-web-vitals", | ||
"rules": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding a couple rules to ignore here, both personal bias so please share any thoughts:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the flat file configuration was deprecated in ESLint 9. Here's what works for me:
import { FlatCompat } from '@eslint/eslintrc'
const compat = new FlatCompat({
// import.meta.dirname is available after Node.js v20.11.0
baseDirectory: import.meta.dirname,
})
const eslintConfig = [
...compat.config({
// extends: ['next/core-web-vitals', 'next/typescript'],
extends: ['next/core-web-vitals'],
}),
{
rules: {
'react-hooks/exhaustive-deps': 'off',
'@next/next/no-html-link-for-pages': 1,
},
},
]
export default eslintConfig |
||
"react-hooks/exhaustive-deps": "off" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,21 @@ class UsersDb { | |
}) | ||
.toArray() | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These two new queries support NextAuth. Creating a user account on sign in and retrieving the mEditor user (to get at the user's roles) |
||
async getMeditorUserByUid(uid: string): Promise<Document> { | ||
const user = await this.#db | ||
// the mEditor user record is a generic, dynamic document, like any other model's document (see the "Users" model) | ||
.collection<Document>(this.#USERS_COLLECTION) | ||
.findOne( | ||
{ | ||
id: uid, | ||
'x-meditor.deletedOn': { $exists: false }, // filter out deleted users | ||
}, | ||
{ sort: { 'x-meditor.modifiedOn': -1 } } | ||
) | ||
|
||
return makeSafeObjectIDs(user) | ||
} | ||
} | ||
|
||
const db = new UsersDb() | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused file |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mEditor can now be run without Docker.
.env updates include NextAuth ENV vars and local URLs