mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-06 19:12:50 -05:00
### Does this PR have any customer impact? yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) bugfix ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) no ### Are you introducing any new config? If yes, do you have tests with and without them being set? no ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description - enable building both locally & in docker - fix the hardcoded paths ---- #### AI description (iteration 1) #### PR Classification Enhancement: Updates to build scripts and Docker configuration to enable building the gateway both locally and in Docker. #### PR Summary This pull request revises several scripts and configuration files to integrate local and containerized build processes for the gateway. - **`/oss/scripts/emulator_entrypoint.sh`**: Refactors the configuration file handling by defining a variable and updating file permissions and copy paths. - **`/oss/scripts/build_and_start_gateway.sh`**: Introduces a local build process using Cargo (clean, build, and binary copy) and adjusts the binary execution path. - **`/oss/.github/containers/Build-Ubuntu/Dockerfile_gateway`**: Updates copy paths to place the gateway binary and configuration into the new subfolder. - **`/oss/rust-toolchain.toml` & `/oss/pg_documentdb_gw/.gitignore`**: Adds the Cargo component to the toolchain and ensures the built binary is ignored. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Signed-off-by: Shuai Tian <shuaitian@microsoft.com>
59 lines
2.2 KiB
JSON
59 lines
2.2 KiB
JSON
{
|
|
"build": {
|
|
"dockerfile": "Dockerfile",
|
|
"context": "..",
|
|
"args": {
|
|
// To include debug symbols for postgres, add -x
|
|
"POSTGRES_INSTALL_ARG": "-c",
|
|
"PG_VERSION": "16",
|
|
"CITUS_VERSION": "v12.1"
|
|
}
|
|
},
|
|
"customizations": {
|
|
"vscode": {
|
|
"extensions": [
|
|
"ms-vscode.cpptools",
|
|
"ms-vscode.cpptools-extension-pack",
|
|
"rust-lang.rust-analyzer"
|
|
],
|
|
"settings": {
|
|
"rust-analyzer.linkedProjects": [
|
|
"pg_documentdb_gw/Cargo.toml",
|
|
"pg_documentdb_gw_host/Cargo.toml"
|
|
],
|
|
"rust-analyzer.testExplorer": true,
|
|
// Performance: use a separate Cargo target directory for rust-analyzer and ad-hoc commands.
|
|
// This minimizes filesystem locking when executing cargo commands in parallel to VS Code.
|
|
"rust-analyzer.cargo.targetDir": true,
|
|
// Code style: use `crate` instead of `super` for rust-analyzer generated imports.
|
|
"rust-analyzer.imports.prefix": "crate",
|
|
// Rust-analyzer default behavior skips checking/building some parts of the Rust codebase.
|
|
// This makes it check and build everything, which can help discover issues sooner, instead of
|
|
// only in the pull request validation build. It does make the checking/building slower, though.
|
|
"rust-analyzer.cargo.allTargets": true,
|
|
"rust-analyzer.check.allTargets": true,
|
|
// Code style: automatically format Rust code on save to save manual labor.
|
|
"[rust]": {
|
|
"editor.defaultFormatter": "rust-lang.rust-analyzer",
|
|
"editor.formatOnSave": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"forwardPorts": [
|
|
9712,
|
|
10260
|
|
],
|
|
"portsAttributes": {
|
|
"9712": {
|
|
"label": "PostgresPort",
|
|
"onAutoForward": "notify",
|
|
"requireLocalPort": false
|
|
},
|
|
"10260": {
|
|
"label": "GatewayPort",
|
|
"onAutoForward": "notify",
|
|
"requireLocalPort": false
|
|
}
|
|
}
|
|
} |