-
Notifications
You must be signed in to change notification settings - Fork 1
feat: implement CLI entrypoints and minimize docker image size #1
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
Open
simonmysun
wants to merge
70
commits into
HTW-ALADIN:master
Choose a base branch
from
simonmysun:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
486dc48
feat: add smoke test script for sql-assessment-service
simonmysun e92ced8
docs: update README
simonmysun cbec7f1
feat: implement CLI functionality for sql-assessment-service
simonmysun 061094f
feat: implement CLI functionality for josnpath-mapper-service
simonmysun 8243d8b
feat: reduce Docker image size by using multi-stage build and excludi…
simonmysun bcf5fe6
chore: switch to esbuild and minimize docker image size
simonmysun 1b3bd40
fix: update exposed port in Dockerfile from 3333 to 3000
simonmysun 54c5f8d
fix: add missing dev dependency ts-node
simonmysun 7caba67
chore: switch to esbuild and minimize docker image size
simonmysun c8aeb97
refactor: separate neo4j into its own service and remove supervisord
simonmysun 976c22c
feat: implement CLI for graph rewriting service
simonmysun c68d7d2
chore: switch to esbuild for faster builds and smaller runtime image
simonmysun ef98e83
fix: use esbuild to copy @fastify/swagger-ui static files for runtime…
simonmysun a0b1fca
feat: enhance build process to inject package version and description…
simonmysun bb475b2
Apply suggestions from code review
simonmysun 193292b
feat: add tests for DatabaseController and QueryExecutionController w…
simonmysun d80fb5a
feat: integrate PGlite support for database analysis and query execution
simonmysun 40d89e2
feat: add in-memory graph database backend
simonmysun 13a177e
feat: add smoke test script and update Makefile and README
simonmysun 0a987a2
refactor(api): introduce implicit database initialization for depende…
simonmysun 43f841d
feat(cli): add CLI tests for Neo4j backend functionality
simonmysun d2e84f6
feat(cli): include cli tests in smoke test
simonmysun ab44151
fix: fixes linting and formatting issues in cli.test.ts in graph-rewr…
simonmysun b1ced22
fix(tests): warm up PGlite WASM to reduce cold-start costs and extend…
simonmysun 9df06de
refactor: update dbGraphService type to IGraphDB in memory and neo4j …
simonmysun 5f91da7
feat(graph): integrate @grafeo-db/js for enhanced graph database func…
simonmysun 04dd404
fix: remove eslint-disable comments from generated schema files
simonmysun d14f47f
fix: update createNode method to use createNodeUuid for internalId ge…
simonmysun 1051d15
fix: update error message for missing connection info to use internat…
simonmysun 20406be
fix: update error message for missing database initialization script …
simonmysun 3bb0d8a
fix: update DatabaseService to use fs/promises for asynchronous file …
simonmysun e929786
fix: update README to correct environment variable name for OpenAI AP…
simonmysun e159a71
fix: update CLI command in README for sql generation to reflect new p…
simonmysun fed4621
fix: remove eslint-disable comments for explicit any type in database…
simonmysun b847620
fix: remove unnecessary whitespace
simonmysun 358e8d2
fix: validate PostgreSQL connection info before generating database key
simonmysun 376968e
fix: remove unnecessary blank lines in DatabaseService methods
simonmysun 0921e13
fix: update Dockerfile to use node:22-slim for compatibility and modi…
simonmysun 3242c49
fix: remove unnecessary blank line
simonmysun 9343501
fix: correct database key format in generateDatabaseKey function
simonmysun d5d7180
fix: remove unnecessary blank line
simonmysun cd16c25
fix: enhance createEdge method to validate endpoints and return error…
simonmysun 84063d6
fix: pass aliasMap to analyzePGlite method for improved schema extrac…
simonmysun 234c18d
fix: remove unnecessary blank line
simonmysun c7ca1ab
fix(sql-assessment): correctly handle composite UNIQUE constraints fo…
simonmysun dde0e4e
fix(postgres): remove unused Dockerfile for PostgreSQL 13
simonmysun 7fc6a34
fix: share single PGlite instance for init-SQL-backed databases
simonmysun 714916d
fix(cli): exit with error when --init-sql-file is missing its path ar…
simonmysun 526dc28
fix: load dotenv before createControllers() in REST API entrypoint
simonmysun 99c9857
fix(sql-assessment): populate indices from pg_catalog in PGlite schem…
simonmysun 9ad2a7a
fix: copy swagger-ui-express/dist into runtime image and mark as exte…
simonmysun 4ed3954
fix: pin uv version to 0.11.7 in Dockerfile build stage
simonmysun bf023ab
fix(test): format expect statement for clarity in resolveInitSqlFile …
simonmysun 5b4fa88
fix: enable PGlite in task-generation by moving validateConnectionInf…
simonmysun f3f480e
fix(grading): move validateConnectionInfo after auto-analyze; reject …
simonmysun 855e9e6
fix(database-service): coalesce concurrent init-SQL PGlite initialisa…
simonmysun ee0bc18
refactor(cli): replace Math.max flag lookup with explicit resolveFile…
simonmysun 3834dd3
fix(docker): bundle swagger-ui-express to resolve missing express at …
simonmysun c65af06
fix(query): forward unhandled executeQuery rejections to next() in ro…
simonmysun 3a0c098
refactor(query-execution-controller): format code for better readability
simonmysun fb00df9
feat(graph-service): add deleteEdge method to return undefined for mi…
simonmysun 1b0e3db
fix(database-service): treat explicit empty sqlContent as invalid, no…
simonmysun ac7a14f
fix(test): derive DB_KEY via generateDatabaseKey to match localhost:5…
simonmysun 9d24ef1
test(query): fix EMPTY_QUERY test to actually invoke the controller a…
simonmysun d150f44
fix(cli): scan past flags to find positional JSON body; error on -f/-…
simonmysun c4c410a
refactor(test): simplify assertion for flags-only arguments in resolv…
simonmysun ec9d74a
fix(docker): remove default NEO4J_PASSWORD to prevent weak-credential…
simonmysun 4dced91
fix(memory): update onRequest hook to ignore unused reply parameter
simonmysun 042edaf
refactor(database): type pgliteInstances as Map<string, PGlite>
simonmysun a7952fc
refactor(database): change sqlContent variable declaration to const
simonmysun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| test/ | ||
| http-tests/ | ||
| *.md | ||
| .gitignore | ||
| .demo.env | ||
| Makefile | ||
| __pycache__/ | ||
| .ruff_cache/ | ||
| .git/ | ||
| .venv/ | ||
This file contains hidden or 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,26 +1,24 @@ | ||
| FROM python:3.12-slim-trixie | ||
|
|
||
| # The installer requires curl (and certificates) to download the release archive | ||
| RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
| # ---- build stage ---- | ||
| FROM python:3.12-slim-trixie AS builder | ||
|
|
||
| # Download the latest installer | ||
| ADD https://astral.sh/uv/install.sh /uv-installer.sh | ||
| COPY --from=ghcr.io/astral-sh/uv:0.11.7 /uv /uvx /bin/ | ||
|
|
||
| # Run the installer then remove it | ||
| RUN sh /uv-installer.sh && rm /uv-installer.sh | ||
| COPY . /app | ||
| WORKDIR /app | ||
|
|
||
| # Ensure the installed binary is on the `PATH` | ||
| ENV PATH="/root/.local/bin/:$PATH" | ||
| # Sync into the project virtual environment; exclude dev dependencies | ||
| RUN uv sync --locked --no-dev | ||
|
|
||
| # Copy the project into the image | ||
| COPY . /app | ||
| # ---- runtime stage ---- | ||
| FROM python:3.12-slim-trixie | ||
|
|
||
| # Sync the project into a new environment, asserting the lockfile is up to date | ||
| # --no-dev: exclude dev dependencies (pytest, ruff) from the production image | ||
| # Copy only the application code and the ready-made virtual environment | ||
| COPY --from=builder /app /app | ||
| WORKDIR /app | ||
| RUN uv sync --locked --no-dev | ||
|
|
||
| # Place the virtual-env Python first on PATH so we don't need `uv run` | ||
| ENV PATH="/app/.venv/bin:$PATH" | ||
|
|
||
| EXPOSE 8000 | ||
|
|
||
| CMD ["uv", "run", "uvicorn", "api:app", "--host", "0.0.0.0", "--port", "8000", "--app-dir", "src"] | ||
| CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "8000", "--app-dir", "src"] |
This file contains hidden or 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 hidden or 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,7 +1,12 @@ | ||
| # App Environment. Can be one of: development, testing, production. Defaults to "development". | ||
| APP_ENV=development | ||
| # Application environment. Can be one of: development, production. Defaults to "production". | ||
| APP_ENV=production | ||
|
|
||
| # Connection data for neo4j docker container | ||
| NEO4J_URI=bolt://localhost:7687 | ||
| # Database backend: "memory" (default, no external DB needed) or "neo4j" | ||
| DB_BACKEND=memory | ||
|
|
||
| # Neo4j connection configuration (only needed when DB_BACKEND=neo4j) | ||
| # In docker-compose, the host is 'neo4j' (the service name). | ||
| # When running locally, typically 'localhost'. | ||
| NEO4J_URI=bolt://neo4j:7687 | ||
| NEO4J_USERNAME=neo4j | ||
| NEO4J_PASSWORD= | ||
| NEO4J_PASSWORD=your-secure-password-here |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.