-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
cli/sql: trim down the deps of the SQL shell to achieve a binary smaller than 10MiB #67470
Closed
15 of 17 tasks
Labels
A-cli-client
CLI commands that pertain to using SQL features
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-server-and-security
DB Server & Security
Comments
knz
added
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
A-cli-client
CLI commands that pertain to using SQL features
labels
Jul 10, 2021
This was referenced Jul 10, 2021
craig bot
pushed a commit
that referenced
this issue
Jul 14, 2021
66850: sqlproxyccl: statistically load balance across tenants r=chrisseto a=chrisseto Previously, the SQLProxy's Directory implementation would always select the first instance from the pods list. As part of the SQLProxy's duty is load balancing, this was inadequate. This commit upgrades the tenant dir to have pods report their CPU load. This load is then used to perform a weighted distribution across all running tenant pods. Release note: None 67276: roachtest: remove test which exercised 20.2-21.1 upgrade r=postamar a=ajwerner We no longer use the master roachtest for old branches. Given that, the answer is to just remove this test from master. This test fails because in #67053 I removed compatibility between 20.2 and master. We should never be trying to do that upgrade. Fixes #67182 Release note: None 67460: cli: move the demo cluster to new sub-package `democluster` (5/) r=otan a=knz First 15 commits are from #67459 and prior. Please ignore those (they will disappear once the prefix PR is merged) Only the last 5 commits belong to this PR. This is part of a family of PRs that aim to encapsulate CLI functionality into finer grained packages. 67461: cli: SQL shell cleanups and better encapsulation (6/) r=otan a=knz First 20 commits are from #67460 and prior. Please ignore those (they will disappear once the prefix PR is merged) Only the last 4 commits belong to this PR. This is part of a family of PRs that aim to encapsulate CLI functionality into finer grained packages. 67474: cli: new sub-package `clisqlcfg` to ease the creation of a standalone SQL shell (8/) r=otan a=knz First 28 commits are from #67462 and prior. Please ignore those (they will disappear once the prefix PR is merged) Only the last 2 commits belong to this PR. This is part of a family of PRs that aim to encapsulate CLI functionality into finer grained packages. 67484: clisqlclient: drop the dependency on 'security' r=otan a=knz Fixes #67481. Informs #67470. This PR only contains 1 commit (the last). All commits except for the last belong to #67469 and prior PRs. Ignore them during review. The 'security' package is quite large. There is no reason to embark it into a standalone SQL shell. Towards achieving this, this patch removes the dependency on the 'security' package from `clisqlclient` by moving the password prompt code into a sub-package. Release note: None 67588: compare_test: account for more differences from postgres r=otan a=rafiss - explicit cast for constants #62602 (comment) - don't use postgis_script builtin #62602 (comment) - handle differences in timezone offset display #62602 (comment) Release note: None 67594: build: update go to 1.16.6 r=rail a=rail * [ ] Adjust the Pebble tests to run in new version. * [x] Adjust version in Docker image ([source](./builder/Dockerfile)). * [x] Adjust version in the TeamCity agent image ([setup script](./packer/teamcity-agent.sh)) * [x] Rebuild and push the Docker image (following [Basic Process](#basic-process)) * [x] Bump the version in `WORKSPACE` under `go_register_toolchains`. You may need to bump [rules_go](https://github.com/bazelbuild/rules_go/releases). * [x] Bump the version in `builder.sh` accordingly ([source](./builder.sh#L6)). * [x] Bump the version in `go-version-check.sh` ([source](./go-version-check.sh)), unless bumping to a new patch release. * [x] Bump the go version in `go.mod`. You may also need to rerun `make vendor_rebuild` if vendoring has changed. * [x] Bump the default installed version of Go in `bootstrap-debian.sh` ([source](./bootstrap/bootstrap-debian.sh)). * [x] Replace other mentions of the older version of go (grep for `golang:<old_version>` and `go<old_version>`). * [ ] Update the `builder.dockerImage` parameter in the TeamCity [`Cockroach`](https://teamcity.cockroachdb.com/admin/editProject.html?projectId=Cockroach&tab=projectParams) and [`Internal`](https://teamcity.cockroachdb.com/admin/editProject.html?projectId=Internal&tab=projectParams) projects. * [ ] Ask the Developer Infrastructure team to deploy new TeamCity agent images according to [packer/README.md](./packer/README.md) Release note: None 67603: roachtest: re-mark `pkg/cmd/roachtest` tests as `broken_in_bazel` r=rail a=rickystewart `faa4c2ccdaeca01eca3ccee29a8a64973cf8b043` removed this tag, which caused all Bazel test runs to begin failing. Closes #67595. Release note: None Co-authored-by: Chris Seto <[email protected]> Co-authored-by: Andrew Werner <[email protected]> Co-authored-by: Raphael 'kena' Poss <[email protected]> Co-authored-by: Rafi Shamim <[email protected]> Co-authored-by: Rail Aliiev <[email protected]> Co-authored-by: Ricky Stewart <[email protected]>
craig bot
pushed a commit
that referenced
this issue
Jul 15, 2021
67489: clisqlclient: trim down dependencies r=otan a=knz Fixes #67482. Informs #67470. 67669: bazel: upgrade gazelle to latest r=rail a=rickystewart This helps to avoid bazel-contrib/rules_go#2479. Release note: None Co-authored-by: Raphael 'kena' Poss <[email protected]> Co-authored-by: Ricky Stewart <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-cli-client
CLI commands that pertain to using SQL features
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-server-and-security
DB Server & Security
PR #67469 is introducing a standalone
cockroach-sql
which only contains the SQL shell via the new packagesclisqlshell
and related.These are intended to only contain the minimum client code sufficient to run a shell, however unfortunately the generated binary is still 100-200MB large.
We want to trim down this size by breaking the dependencies on the crdb server code.
Here are some discrete tasks to achieve this:
clisqlclient: trim down dependencies #67482
tree.ParseDInterval
to interpret the results ofSHOW LAST QUERY STATISTICS
. Instead, use a lightweight parser local to the SQL shell.tree.Name
to quote the database name. Use the underlying function from thelex
package directly (which is lightweight)roachpb.NodeID
and use int32 instead.security.PromptForPassword()
into a lightweight dependency package and use that instead ofsecurity
#67481clisqlexec: trim down dependencies #67490
tree
in the SQL formatter (tree.Name
andtree.DString
) by using the underlying functions fromlex
#67491sessiondatapb
by liftingBytesEncodeEscape
into a lightweight dependency package and use thatlex
by liftingEncodeByteArrayToRawBytes
intolexbase
or another lightweight dep packagetrim down
clisqlshell
parser
package by fixing sql/parser: splitscan.go
into a separate package with few dependencies #64710parser
package:parser.LastLexicalToken
tolexbase
packagesql
by moving the txn constants to a sub-packagetrim down the binary by reducing the size of the
log
packageutil/tracing
package optional inlog
using dependency injection, and don't use it in the CLI codecc @kernfeld-cockroach
cc @cockroachdb/sql-experience
The text was updated successfully, but these errors were encountered: