From 16c87d4a1ab2fbcc6e9165879099ac7daa409d68 Mon Sep 17 00:00:00 2001 From: Dan <39170265+chillenberger@users.noreply.github.com> Date: Thu, 19 Oct 2023 11:44:40 -0600 Subject: [PATCH 01/22] =?UTF-8?q?add=20options=20capability=20to=20range?= =?UTF-8?q?=20input,=20add=20typography=20to=20site,=20fix=20sw=E2=80=A6?= =?UTF-8?q?=20(#1094)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/inputs/range_group/mod.rs | 29 ++++++++ .../inputs/range_group/range_group.scss | 69 +++++++++++++++++ .../range_group/range_group_controller.js | 74 ++++++++++++++++++- .../inputs/range_group/template.html | 52 ++++++++++--- .../src/components/inputs/switch/switch.scss | 1 + .../static/css/scss/abstracts/variables.scss | 1 + .../static/css/scss/base/_typography.scss | 60 +++++++++++++-- .../static/css/scss/components/_forms.scss | 4 +- pgml-dashboard/static/js/playground.js | 14 +++- .../templates/content/playground.html | 53 +++++++++++++ 10 files changed, 332 insertions(+), 25 deletions(-) diff --git a/pgml-dashboard/src/components/inputs/range_group/mod.rs b/pgml-dashboard/src/components/inputs/range_group/mod.rs index 4953856ff..a42493bc6 100644 --- a/pgml-dashboard/src/components/inputs/range_group/mod.rs +++ b/pgml-dashboard/src/components/inputs/range_group/mod.rs @@ -16,6 +16,9 @@ pub struct RangeGroup { pub cost_rate: Option, pub units: String, pub group_target: StimulusTarget, + pub options: Vec>, + pub show_value: bool, + pub show_title: bool, } impl RangeGroup { @@ -32,6 +35,9 @@ impl RangeGroup { cost_rate: None, units: String::default(), group_target: StimulusTarget::new(), + options: Vec::new(), + show_value: true, + show_title: true, } } @@ -76,6 +82,29 @@ impl RangeGroup { self.group_target = target; self } + + pub fn options(mut self, options: Vec>) -> Self { + self.options = options; + self.min = 1; + self.max = self.options.len() as i64; + self.step = 1.0; + self + } + + pub fn title(mut self, title: &str) -> Self { + self.title = title.to_owned(); + self + } + + pub fn hide_title(mut self) -> Self { + self.show_title = false; + self + } + + pub fn hide_value(mut self) -> Self { + self.show_value = false; + self + } } component!(RangeGroup); diff --git a/pgml-dashboard/src/components/inputs/range_group/range_group.scss b/pgml-dashboard/src/components/inputs/range_group/range_group.scss index 16436ce80..da68a1172 100644 --- a/pgml-dashboard/src/components/inputs/range_group/range_group.scss +++ b/pgml-dashboard/src/components/inputs/range_group/range_group.scss @@ -26,4 +26,73 @@ div[data-controller="inputs-range-group"] { .unit { width: 28px; } + + .tick { + width: 5px; + height: 1.5rem; + background-color: $form-range-track-color; + border-radius: 1rem; + + &.active-color { + background-color: #{$neon-shade-100} !important; + } + } + + .input-offset { + width: 80%; + margin-left: 3%; + display: flex; + } + + .tick-container { + position: relative; + top: -24px; + margin-bottom: -24px; + display: flex; + flex-direction: row; + justify-content: space-between; + width: 80%; + margin-left: 3%; + padding-left: 10px; + padding-right: 10px; + } + + .tick-unit { + overflow: visible; + width: 5px; + } + + .tick-text { + color: #{$slate-tint-100}; + &.active-color { + color: #{$slate-tint-700}; + } + } + + .line { + width: 100%; + height: 5px; + background: linear-gradient(to right, #{$neon-shade-100} 5%, #{$form-range-track-color} 5%); + position: absolute; + top: 11px; + border-radius: 1rem; + } + + .grab-brightness { + filter: brightness(90%) !important; + } + + .range-container { + position: relative; + + &:hover { + .line { + filter: brightness(110%); + } + + .active-color { + filter: brightness(110%); + } + } + } } diff --git a/pgml-dashboard/src/components/inputs/range_group/range_group_controller.js b/pgml-dashboard/src/components/inputs/range_group/range_group_controller.js index b67d8e833..d16e868cb 100644 --- a/pgml-dashboard/src/components/inputs/range_group/range_group_controller.js +++ b/pgml-dashboard/src/components/inputs/range_group/range_group_controller.js @@ -5,7 +5,11 @@ export default class extends Controller { static targets = [ "range", "text", - "group" + "group", + "line", + "tick", + "tickText", + "smScreenText" ] static values = { @@ -15,11 +19,14 @@ export default class extends Controller { initialize() { this.textTarget.value = this.rangeTarget.value + this.updateTicks(this.rangeTarget.value) + this.updateTicksText(this.rangeTarget.value) } updateText(e) { this.textTarget.value = e.target.value - this.groupTarget.dispatchEvent(new Event("rangeInput")) + this.element.dataset.detail = e.target.value + this.groupTarget.dispatchEvent(new CustomEvent("rangeInput", { detail: e.target.value })) } updateRange(e) { @@ -34,7 +41,8 @@ export default class extends Controller { this.rangeTarget.value = e.target.value } - this.groupTarget.dispatchEvent(new Event("rangeInput")) + this.element.dataset.detail = this.rangeTarget.value + this.groupTarget.dispatchEvent(new CustomEvent("rangeInput", { detail: this.rangeTarget.value })) } isNumeric(n) { @@ -44,5 +52,65 @@ export default class extends Controller { reset() { this.rangeTarget.value = this.initialValue this.textTarget.value = this.initialValue + this.updateTicks(this.initialValue) + this.updateTicksText(this.initialValue) + this.element.dataset.detail = this.initialValue + this.groupTarget.dispatchEvent(new CustomEvent("rangeInput", { detail: this.rangeTarget.value })) + } + + on_grab () { + if(!this.hasTickTarget || !this.hasLineTarget ) return; + + this.lineTarget.classList.add("grab-brightness") + this.tickTargets.forEach((tick, index) => { + if( index < this.rangeTarget.value ) { + tick.classList.add("grab-brightness") + } else { + tick.classList.remove("grab-brightness") + }}) + } + + on_release() { + if(!this.hasTickTarget || !this.hasLineTarget ) return; + + this.lineTarget.classList.remove("grab-brightness") + this.tickTargets.forEach((tick, index) => { + if( index < this.rangeTarget.value ) { + tick.classList.remove("grab-brightness") + }}) + } + + updateTicks(value) { + if(!this.hasTickTarget) return; + + this.tickTargets.forEach((tick, index) => { + if( index < value ) { + tick.classList.add("active-color") + } else { + tick.classList.remove("active-color") + } + }) + } + + updateTicksText(value) { + if(this.hasTickTextTarget && this.hasSmScreenTextTarget) { + this.tickTextTargets.forEach((tickText, index) => { + if( index + 1 == value ) { + tickText.classList.add("active-color") + this.smScreenTextTargets[index].style.display = "flex" + } else { + tickText.classList.remove("active-color") + this.smScreenTextTargets[index].style.display = "none" + } + }) + } + } + + updateTicksEventWrapper(e) { + this.updateTicks(e.target.value) + } + + updateTicksTextEventWrapper(e) { + this.updateTicksText(e.target.value) } } diff --git a/pgml-dashboard/src/components/inputs/range_group/template.html b/pgml-dashboard/src/components/inputs/range_group/template.html index 6f48debb5..f70e5cc8c 100644 --- a/pgml-dashboard/src/components/inputs/range_group/template.html +++ b/pgml-dashboard/src/components/inputs/range_group/template.html @@ -1,14 +1,17 @@
data-action="reset->inputs-range-group#reset">
+ <% if show_title { %>
<%- title %>
-
+ <% } %> +
style="display: none"<% } %>>
<%- title %>
- > +
+ > + + <% if options.len() > 0 { %> +
+ <% for item in &options { %> +
+
+ +
+ <% for info in item { %> + + <% } %> +
+ +
+
+ <% for info in item { %> + + <% } %> +
+
+
+ <% } %> +
+
+ <% } %> +
<% if cost_rate.is_some() { %>
diff --git a/pgml-dashboard/src/components/inputs/switch/switch.scss b/pgml-dashboard/src/components/inputs/switch/switch.scss index 6641fceb8..ac8ffe4d9 100644 --- a/pgml-dashboard/src/components/inputs/switch/switch.scss +++ b/pgml-dashboard/src/components/inputs/switch/switch.scss @@ -11,6 +11,7 @@ div[data-controller="inputs-switch"] { border-radius: 5rem; text-align: center; display: flex; + justify-content: center; @extend .gap-2; } diff --git a/pgml-dashboard/static/css/scss/abstracts/variables.scss b/pgml-dashboard/static/css/scss/abstracts/variables.scss index fae66c3e7..943b80b54 100644 --- a/pgml-dashboard/static/css/scss/abstracts/variables.scss +++ b/pgml-dashboard/static/css/scss/abstracts/variables.scss @@ -174,6 +174,7 @@ $form-check-radio-checked-bg-image: none; $form-range-track-height: .4rem; $form-range-track-box-shadow: none; +$form-range-track-color: #{$gray-600}; $form-range-thumb-width: 1rem; $form-range-thumb-box-shadow: none; $form-range-thumb-transition: none; diff --git a/pgml-dashboard/static/css/scss/base/_typography.scss b/pgml-dashboard/static/css/scss/base/_typography.scss index 8ddfe763f..a1ffc9e23 100644 --- a/pgml-dashboard/static/css/scss/base/_typography.scss +++ b/pgml-dashboard/static/css/scss/base/_typography.scss @@ -1,19 +1,62 @@ // all other displays are default bootstrap styling .display-2 { - font-weight: 700; + font-weight: $font-weight-bold; font-size: 4rem; line-height: 80px; } -// TODO: Go through html and ensure headers use appropriate header class, header and class do not need to match. -// .h1 {font-weight: 700; font-size: 64px; line-height: 72px;} -// .h2 {font-weight: 700; font-size: 48px; line-height: 54px;} -// .h3 {font-weight: 700; font-size: 40px; line-height: 46px;} -// .h4 {font-weight: 700; font-size: 32px; line-height: 40px;} -// .h5 {font-weight: 700; font-size: 28px; line-height: 34px;} -// .h6 {font-weight: 700; font-size: 24px; line-height: 30px;} +.h1-big { + font-weight: $font-weight-bold; font-size: 80px; line-height: 84px; + @include media-breakpoint-down(md) { + font-size: 48px; line-height: 52px; + } +} +h1, .h1 { + font-weight: $font-weight-bold; font-size: 64px; line-height: 72px; + @include media-breakpoint-down(md) { + font-size: 44px; line-height: 48px; + } +} +h2, .h2 { + font-weight: $font-weight-bold; font-size: 48px; line-height: 54px; + @include media-breakpoint-down(md) { + font-size: 40px; line-height: 44px; + } +} +h3, .h3 { + font-weight: $font-weight-bold; font-size: 40px; line-height: 46px; + @include media-breakpoint-down(md) { + font-size: 32px; line-height: 36px; + } +} +h4, .h4 { + font-weight: $font-weight-bold; font-size: 32px; line-height: 40px; + @include media-breakpoint-down(md) { + font-size: 28px; line-height: 32px; + } +} +h5, .h5 { + font-weight: $font-weight-bold; font-size: 28px; line-height: 34px; + @include media-breakpoint-down(md) { + font-size: 24px; line-height: 28px; + } +} +h6, .h6 { + font-weight: $font-weight-bold; font-size: 24px; line-height: 30px; + @include media-breakpoint-down(md) { + font-size: 20px; line-height: 26px; + } +} + +.eyebrow { + font-weight: $font-weight-bold; font-size: 18px; line-height: 24px; + @include media-breakpoint-down(md) { + font-size: 16px; line-height: 22px; + } +} .subcopy-text { + font-family: Inter; font-size: 18px; line-height: 22px; } @@ -22,6 +65,7 @@ line-height: 20px; } .legal-text { + font-family: Inter; font-size: 12px; line-height: 16px; } diff --git a/pgml-dashboard/static/css/scss/components/_forms.scss b/pgml-dashboard/static/css/scss/components/_forms.scss index 5b211ca7a..cc11d237c 100644 --- a/pgml-dashboard/static/css/scss/components/_forms.scss +++ b/pgml-dashboard/static/css/scss/components/_forms.scss @@ -79,11 +79,11 @@ & { color: #{$neon-tint-100}; --thumb-height: 1.125em; - --track-height: 0.125em; + --track-height: 4px; --brightness-hover: 110%; --brightness-down: 90%; --clip-edges: 0.125em; - --track-color: #{$gray-600}; + --track-color: #{$form-range-track-color}; --bg-color: transparent; } diff --git a/pgml-dashboard/static/js/playground.js b/pgml-dashboard/static/js/playground.js index 0fbf32902..7da1aa83e 100644 --- a/pgml-dashboard/static/js/playground.js +++ b/pgml-dashboard/static/js/playground.js @@ -1,13 +1,17 @@ import { Controller } from '@hotwired/stimulus' export default class extends Controller { - static targets = ["test", "switch"] + static targets = ["test", "switch", "rangeOptions"] initialize() { this.errorH3 = new CustomEvent("error", { detail: "message passed through event h3" }) this.clearH3 = new Event("clear") this.errorH2 = new CustomEvent("error", { detail: "message passed through event h2" }) this.clearH2 = new Event("clear") + + this.rangeOptionsTarget.addEventListener("rangeInput", (e) => { + console.log("rangeOptionsTarget input event value = ", e.detail) + }) } @@ -39,4 +43,12 @@ export default class extends Controller { this.switchTarget.dispatchEvent(new Event("reset")) } + resetOptionsRange() { + this.rangeOptionsTarget.dispatchEvent(new Event("reset")) + } + + logOptionsRange() { + console.log("rangeOptionsTarget current value = ", this.rangeOptionsTarget.dataset.detail) + } + } diff --git a/pgml-dashboard/templates/content/playground.html b/pgml-dashboard/templates/content/playground.html index a6e641139..5dc8dcebf 100644 --- a/pgml-dashboard/templates/content/playground.html +++ b/pgml-dashboard/templates/content/playground.html @@ -123,6 +123,59 @@

Inputs

.units("GB") .cost_rate(0.144) %>
+ +
+ <%+ RangeGroup::new("range with ticks") + .initial_value(2.0) + .group_target( + StimulusTarget::new() + .controller("playground") + .name("rangeOptions") + ) + .options( + vec!( + vec!( + "4 CPU".to_owned(), + "16 GB Memory".to_owned(), + "24 GB GPU Memory".to_owned(), + ), + vec!( + "8 CPU".to_owned(), + "32 GB Memory".to_owned(), + "24 GB GPU Memory".to_owned(), + ), + vec!( + "16 CPU".to_owned(), + "64 GB Memory".to_owned(), + "24 GB GPU Memory".to_owned(), + ), + vec!( + "32 CPU".to_owned(), + "128 GB Memory".to_owned(), + "24 GB GPU Memory".to_owned(), + ), + vec!( + "32 CPU".to_owned(), + "128 GB Memory".to_owned(), + "24 GB GPU Memory".to_owned(), + ), + vec!( + "64 CPU".to_owned(), + "256 GB Memory".to_owned(), + "24 GB GPU Memory".to_owned(), + ), + vec!( + "48 CPU".to_owned(), + "192 GB Memory".to_owned(), + "96 GB GPU Memory".to_owned(), + ), + ) + ) + .hide_title() + .hide_value() %> +
+ +
From fe86516361ee09961944d339579021a4151a7a2e Mon Sep 17 00:00:00 2001 From: Dan <39170265+chillenberger@users.noreply.github.com> Date: Thu, 19 Oct 2023 12:12:29 -0600 Subject: [PATCH 02/22] fix rotation of guides text on mobile (#1098) --- pgml-dashboard/static/css/scss/components/_navs.scss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pgml-dashboard/static/css/scss/components/_navs.scss b/pgml-dashboard/static/css/scss/components/_navs.scss index d6d5fc75c..ee9c4ca48 100644 --- a/pgml-dashboard/static/css/scss/components/_navs.scss +++ b/pgml-dashboard/static/css/scss/components/_navs.scss @@ -149,7 +149,9 @@ } } [aria-expanded=false] { - transform: rotate(-90deg); + span.material-symbols-outlined { + transform: rotate(-90deg); + } } @include media-breakpoint-down(xxl) { border-radius: 0px; From 90bbb5f4a0cf70c36a106085794d655ade51cd28 Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Thu, 19 Oct 2023 14:25:36 -0400 Subject: [PATCH 03/22] Move autogptq into its own req file (#1100) --- packages/postgresml-python/build.sh | 7 +++++++ .../content/docs/guides/setup/v2/installation.md | 1 + pgml-docs/docs/guides/developer-docs/installation.md | 1 + pgml-extension/requirements-autogptq.txt | 1 + pgml-extension/requirements.txt | 1 - 5 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 pgml-extension/requirements-autogptq.txt diff --git a/packages/postgresml-python/build.sh b/packages/postgresml-python/build.sh index cf60c3717..d9d5e9cd3 100644 --- a/packages/postgresml-python/build.sh +++ b/packages/postgresml-python/build.sh @@ -29,12 +29,19 @@ rm "$deb_dir/release.sh" (cat ${SCRIPT_DIR}/DEBIAN/postrm | envsubst '${PGVERSION}') > "$deb_dir/DEBIAN/postrm" cp ${SCRIPT_DIR}/../../pgml-extension/requirements.txt "$deb_dir/etc/postgresml-python/requirements.txt" +cp ${SCRIPT_DIR}/../../pgml-extension/requirements-autogptq.txt "$deb_dir/etc/postgresml-python/requirements-autogptq.txt" cp ${SCRIPT_DIR}/../../pgml-extension/requirements-xformers.txt "$deb_dir/etc/postgresml-python/requirements-xformers.txt" virtualenv --python="python$PYTHON_VERSION" "$deb_dir/var/lib/postgresml-python/pgml-venv" source "$deb_dir/var/lib/postgresml-python/pgml-venv/bin/activate" python -m pip install -r "${deb_dir}/etc/postgresml-python/requirements.txt" + +# No source included, can't build on non x86 platforms +set +e +python -m pip install -r "${deb_dir}/etc/postgresml-python/requirements-autogptq.txt" +set -e + python -m pip install -r "${deb_dir}/etc/postgresml-python/requirements-xformers.txt" --no-dependencies deactivate diff --git a/pgml-dashboard/content/docs/guides/setup/v2/installation.md b/pgml-dashboard/content/docs/guides/setup/v2/installation.md index 3dd865f33..acbcf281a 100644 --- a/pgml-dashboard/content/docs/guides/setup/v2/installation.md +++ b/pgml-dashboard/content/docs/guides/setup/v2/installation.md @@ -65,6 +65,7 @@ To install the necessary Python packages into a virtual environment, use the `vi virtualenv pgml-venv && \ source pgml-venv/bin/activate && \ pip install -r requirements.txt && \ +pip install -r requirements-autogptq.txt && \ pip install -r requirements-xformers.txt --no-dependencies ``` diff --git a/pgml-docs/docs/guides/developer-docs/installation.md b/pgml-docs/docs/guides/developer-docs/installation.md index 3099fcc83..0eec9949a 100644 --- a/pgml-docs/docs/guides/developer-docs/installation.md +++ b/pgml-docs/docs/guides/developer-docs/installation.md @@ -64,6 +64,7 @@ To install the necessary Python packages into a virtual environment, use the `vi virtualenv pgml-venv && \ source pgml-venv/bin/activate && \ pip install -r requirements.txt && \ +pip install -r requirements-autogptq.txt && \ pip install -r requirements-xformers.txt --no-dependencies ``` diff --git a/pgml-extension/requirements-autogptq.txt b/pgml-extension/requirements-autogptq.txt new file mode 100644 index 000000000..8417750cc --- /dev/null +++ b/pgml-extension/requirements-autogptq.txt @@ -0,0 +1 @@ +auto-gptq==0.4.2 diff --git a/pgml-extension/requirements.txt b/pgml-extension/requirements.txt index 1f5446beb..89b3c2742 100644 --- a/pgml-extension/requirements.txt +++ b/pgml-extension/requirements.txt @@ -1,5 +1,4 @@ accelerate==0.22.0 -auto-gptq==0.4.2 bitsandbytes==0.41.1 catboost==1.2 ctransformers==0.2.27 From f37c505c6a2fe49bfdbb59a44506dafce6ec9a13 Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Thu, 19 Oct 2023 14:39:51 -0400 Subject: [PATCH 04/22] Update to pgrx 0.11.0 & Postgres 16 (#1099) --- .github/workflows/ci.yml | 2 +- .../ubuntu-packages-and-docker-image.yml | 12 ++- .../content/docs/guides/setup/developers.md | 2 +- .../docs/guides/setup/v2/installation.md | 4 +- .../self-hosting/building-from-source.md | 4 +- pgml-extension/Cargo.lock | 74 +++++++++---------- pgml-extension/Cargo.toml | 10 +-- 7 files changed, 57 insertions(+), 51 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5f65aed0..a9a19a9ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: run: | curl https://sh.rustup.rs -sSf | sh -s -- -y source ~/.cargo/env - cargo install cargo-pgrx --version "0.10.0" --locked + cargo install cargo-pgrx --version "0.11.0" --locked if [[ ! -d ~/.pgrx ]]; then cargo pgrx init diff --git a/.github/workflows/ubuntu-packages-and-docker-image.yml b/.github/workflows/ubuntu-packages-and-docker-image.yml index 681c084ee..c6e09bf18 100644 --- a/.github/workflows/ubuntu-packages-and-docker-image.yml +++ b/.github/workflows/ubuntu-packages-and-docker-image.yml @@ -72,16 +72,16 @@ jobs: libpq-dev \ libclang-dev \ wget \ + postgresql-16 \ postgresql-15 \ postgresql-14 \ postgresql-13 \ postgresql-12 \ - postgresql-11 \ + postgresql-server-dev-16 \ postgresql-server-dev-15 \ postgresql-server-dev-14 \ postgresql-server-dev-13 \ postgresql-server-dev-12 \ - postgresql-server-dev-11 \ lsb-release \ python3.10 \ python3-pip \ @@ -98,7 +98,7 @@ jobs: with: working-directory: pgml-extension command: install - args: cargo-pgrx --version "0.10.0" --locked + args: cargo-pgrx --version "0.11.0" --locked - name: pgrx init uses: postgresml/gh-actions-cargo@master with: @@ -135,6 +135,12 @@ jobs: working-directory: pgml-extension command: pgrx args: package --pg-config /usr/lib/postgresql/15/bin/pg_config + name: Build Postgres 16 + uses: postgresml/gh-actions-cargo@master + with: + working-directory: pgml-extension + command: pgrx + args: package --pg-config /usr/lib/postgresql/16/bin/pg_config - name: Build debs env: AWS_ACCESS_KEY_ID: ${{ vars.AWS_ACCESS_KEY_ID }} diff --git a/pgml-dashboard/content/docs/guides/setup/developers.md b/pgml-dashboard/content/docs/guides/setup/developers.md index 659e81424..24c3b536b 100644 --- a/pgml-dashboard/content/docs/guides/setup/developers.md +++ b/pgml-dashboard/content/docs/guides/setup/developers.md @@ -70,7 +70,7 @@ Once there, you can initialize `pgrx` and get going: #### Pgrx command line and environments ```commandline -cargo install cargo-pgrx --version "0.10.0" --locked && \ +cargo install cargo-pgrx --version "0.11.0" --locked && \ cargo pgrx init # This will take a few minutes ``` diff --git a/pgml-dashboard/content/docs/guides/setup/v2/installation.md b/pgml-dashboard/content/docs/guides/setup/v2/installation.md index acbcf281a..99566090d 100644 --- a/pgml-dashboard/content/docs/guides/setup/v2/installation.md +++ b/pgml-dashboard/content/docs/guides/setup/v2/installation.md @@ -36,7 +36,7 @@ brew bundle PostgresML is written in Rust, so you'll need to install the latest compiler from [rust-lang.org](https://rust-lang.org). Additionally, we use the Rust PostgreSQL extension framework `pgrx`, which requires some initialization steps: ```bash -cargo install cargo-pgrx --version 0.10.0 && \ +cargo install cargo-pgrx --version 0.11.0 && \ cargo pgrx init ``` @@ -294,7 +294,7 @@ We use the `pgrx` Postgres Rust extension framework, which comes with its own in ```bash cd pgml-extension && \ -cargo install cargo-pgrx --version 0.10.0 && \ +cargo install cargo-pgrx --version 0.11.0 && \ cargo pgrx init ``` diff --git a/pgml-docs/docs/guides/deploying-postgresml/self-hosting/building-from-source.md b/pgml-docs/docs/guides/deploying-postgresml/self-hosting/building-from-source.md index 64d6d9f30..f2f4e4fb3 100644 --- a/pgml-docs/docs/guides/deploying-postgresml/self-hosting/building-from-source.md +++ b/pgml-docs/docs/guides/deploying-postgresml/self-hosting/building-from-source.md @@ -40,12 +40,12 @@ For a typical deployment in production, you would need to compile and install th #### Install pgrx -`pgrx` is open source and available from crates.io. We are currently using the `0.10.0` version. It's important that your `pgrx` version matches what we're using, since there are some hard dependencies between our code and `pgrx`. +`pgrx` is open source and available from crates.io. We are currently using the `0.11.0` version. It's important that your `pgrx` version matches what we're using, since there are some hard dependencies between our code and `pgrx`. To install `pgrx`, simply run: ``` -cargo install cargo-pgrx --version "0.10.0" +cargo install cargo-pgrx --version "0.11.0" ``` Before using `pgrx`, it needs to be initialized against the installed version of PostgreSQL. In this example, we'll be using the Ubuntu 22.04 default PostgreSQL 14 installation: diff --git a/pgml-extension/Cargo.lock b/pgml-extension/Cargo.lock index 725e6ed5b..5b2945b0b 100644 --- a/pgml-extension/Cargo.lock +++ b/pgml-extension/Cargo.lock @@ -251,9 +251,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.66.1" +version = "0.68.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" +checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" dependencies = [ "bitflags 2.4.0", "cexpr 0.6.0", @@ -366,9 +366,9 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cargo_toml" -version = "0.15.3" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "599aa35200ffff8f04c1925aa1acc92fa2e08874379ef42e210a80e527e60838" +checksum = "e3f9629bc6c4388ea699781dc988c2b99766d7679b151c81990b4fa1208fafd3" dependencies = [ "serde", "toml", @@ -794,18 +794,18 @@ checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "enum-map" -version = "2.6.2" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e10d4d903e79b6181943defcdc36f61f8f608e5892eca719fb0677799d3f8fe" +checksum = "c188012f8542dee7b3996e44dd89461d64aa471b0a7c71a1ae2f595d259e96e5" dependencies = [ "enum-map-derive", ] [[package]] name = "enum-map-derive" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccb14d927583dd5c2eac0f2cf264fc4762aefe1ae14c47a8a20fc1939d3a5fc0" +checksum = "04d0b288e3bb1d861c4403c1774a6f7a798781dfc519b3647df2a3dd4ae95f25" dependencies = [ "proc-macro2", "quote 1.0.33", @@ -1244,9 +1244,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libloading" @@ -1876,9 +1876,9 @@ dependencies = [ [[package]] name = "pgrx" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb7ee7e7abe8a74124732d05fdbccd11179b4778c08736995fdfc8ca9d2e9c24" +checksum = "bd3c4b36fbe84329b86c83bfd33b9514a50606f00074f47085f99062a7dd8c9c" dependencies = [ "atomic-traits", "bitflags 2.4.0", @@ -1901,9 +1901,9 @@ dependencies = [ [[package]] name = "pgrx-macros" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6d5a93b4c6ceb3735605205267a002584fd3d7fa87eed3133cba6c74f7431" +checksum = "9c6a41e021321a814fac1aa27bd4266208b4507709ecbc28fc99693adfbd0c41" dependencies = [ "pgrx-sql-entity-graph", "proc-macro2", @@ -1913,9 +1913,9 @@ dependencies = [ [[package]] name = "pgrx-pg-config" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14a7885744ba92cd19ad87f2bf195352a9533cd2bb10a1ebbeef7ef9d65126aa" +checksum = "17da1e26800e747d501b8d8bb8aeee4530a07d93a39c3fb2c4229a8feff213b2" dependencies = [ "cargo_toml", "dirs 5.0.1", @@ -1931,11 +1931,11 @@ dependencies = [ [[package]] name = "pgrx-pg-sys" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "916a552934ebfcf3c56277e682526c8d92264b4c9ba58a7d0a3cddf1e03c6825" +checksum = "f9032b517525ec71579cc68e92905b5f5f63e892c094834202313c42f2f1a669" dependencies = [ - "bindgen 0.66.1", + "bindgen 0.68.1", "eyre", "libc", "memoffset 0.9.0", @@ -1953,9 +1953,9 @@ dependencies = [ [[package]] name = "pgrx-sql-entity-graph" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db087888395237259e1c643777ff619077ace10afa670e5bb4b8d510db63dac0" +checksum = "2e4a88203974b887bca8bfdea17ab9936411fb7e84957763dc0124df78d07907" dependencies = [ "convert_case", "eyre", @@ -1968,9 +1968,9 @@ dependencies = [ [[package]] name = "pgrx-tests" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18b3449cbdfdbd25bc24ae7d962fdc0c8eac2a839b5bfee7a295b6c8931b0c0b" +checksum = "c80deb4310538e6ef14f4cbb30b56eb24b6d7aae66bfd4e516f153987159e65e" dependencies = [ "clap-cargo", "eyre", @@ -2077,9 +2077,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -2312,25 +2312,25 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.5" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.7.5", + "regex-syntax 0.8.2", ] [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.8.2", ] [[package]] @@ -2341,9 +2341,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rmp" @@ -3039,9 +3039,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.6" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" dependencies = [ "serde", "serde_spanned", @@ -3060,9 +3060,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ "indexmap 2.0.0", "serde", diff --git a/pgml-extension/Cargo.toml b/pgml-extension/Cargo.toml index 02e34ce08..e2e761f14 100644 --- a/pgml-extension/Cargo.toml +++ b/pgml-extension/Cargo.toml @@ -7,20 +7,20 @@ edition = "2021" crate-type = ["lib", "cdylib"] [features] -default = ["pg15", "python"] -pg11 = ["pgrx/pg11", "pgrx-tests/pg11"] +default = ["pg16", "python"] pg12 = ["pgrx/pg12", "pgrx-tests/pg12"] pg13 = ["pgrx/pg13", "pgrx-tests/pg13"] pg14 = ["pgrx/pg14", "pgrx-tests/pg14"] pg15 = ["pgrx/pg15", "pgrx-tests/pg15"] +pg16 = ["pgrx/pg16", "pgrx-tests/pg16"] use_as_lib = [] pg_test = [] python = ["pyo3"] cuda = ["xgboost/cuda", "lightgbm/cuda"] [dependencies] -pgrx = "=0.10.0" -pgrx-pg-sys = "=0.10.0" +pgrx = "=0.11.0" +pgrx-pg-sys = "=0.11.0" xgboost = { git = "https://github.com/postgresml/rust-xgboost.git", branch = "master" } once_cell = { version = "1", features = ["parking_lot"] } rand = "0.8" @@ -51,7 +51,7 @@ flate2 = "1.0" csv = "1.2" [dev-dependencies] -pgrx-tests = "=0.10.0" +pgrx-tests = "=0.11.0" [build-dependencies] vergen = { version = "8", features = ["build", "git", "gitcl"] } From aa3155b35d15bff86b4c5c60ad0949fbd2ce30d8 Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Thu, 19 Oct 2023 14:43:10 -0400 Subject: [PATCH 05/22] Revert "Update to pgrx 0.11.0 & Postgres 16" (#1101) --- .github/workflows/ci.yml | 2 +- .../ubuntu-packages-and-docker-image.yml | 12 +-- .../content/docs/guides/setup/developers.md | 2 +- .../docs/guides/setup/v2/installation.md | 4 +- .../self-hosting/building-from-source.md | 4 +- pgml-extension/Cargo.lock | 74 +++++++++---------- pgml-extension/Cargo.toml | 10 +-- 7 files changed, 51 insertions(+), 57 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9a19a9ae..c5f65aed0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: run: | curl https://sh.rustup.rs -sSf | sh -s -- -y source ~/.cargo/env - cargo install cargo-pgrx --version "0.11.0" --locked + cargo install cargo-pgrx --version "0.10.0" --locked if [[ ! -d ~/.pgrx ]]; then cargo pgrx init diff --git a/.github/workflows/ubuntu-packages-and-docker-image.yml b/.github/workflows/ubuntu-packages-and-docker-image.yml index c6e09bf18..681c084ee 100644 --- a/.github/workflows/ubuntu-packages-and-docker-image.yml +++ b/.github/workflows/ubuntu-packages-and-docker-image.yml @@ -72,16 +72,16 @@ jobs: libpq-dev \ libclang-dev \ wget \ - postgresql-16 \ postgresql-15 \ postgresql-14 \ postgresql-13 \ postgresql-12 \ - postgresql-server-dev-16 \ + postgresql-11 \ postgresql-server-dev-15 \ postgresql-server-dev-14 \ postgresql-server-dev-13 \ postgresql-server-dev-12 \ + postgresql-server-dev-11 \ lsb-release \ python3.10 \ python3-pip \ @@ -98,7 +98,7 @@ jobs: with: working-directory: pgml-extension command: install - args: cargo-pgrx --version "0.11.0" --locked + args: cargo-pgrx --version "0.10.0" --locked - name: pgrx init uses: postgresml/gh-actions-cargo@master with: @@ -135,12 +135,6 @@ jobs: working-directory: pgml-extension command: pgrx args: package --pg-config /usr/lib/postgresql/15/bin/pg_config - name: Build Postgres 16 - uses: postgresml/gh-actions-cargo@master - with: - working-directory: pgml-extension - command: pgrx - args: package --pg-config /usr/lib/postgresql/16/bin/pg_config - name: Build debs env: AWS_ACCESS_KEY_ID: ${{ vars.AWS_ACCESS_KEY_ID }} diff --git a/pgml-dashboard/content/docs/guides/setup/developers.md b/pgml-dashboard/content/docs/guides/setup/developers.md index 24c3b536b..659e81424 100644 --- a/pgml-dashboard/content/docs/guides/setup/developers.md +++ b/pgml-dashboard/content/docs/guides/setup/developers.md @@ -70,7 +70,7 @@ Once there, you can initialize `pgrx` and get going: #### Pgrx command line and environments ```commandline -cargo install cargo-pgrx --version "0.11.0" --locked && \ +cargo install cargo-pgrx --version "0.10.0" --locked && \ cargo pgrx init # This will take a few minutes ``` diff --git a/pgml-dashboard/content/docs/guides/setup/v2/installation.md b/pgml-dashboard/content/docs/guides/setup/v2/installation.md index 99566090d..acbcf281a 100644 --- a/pgml-dashboard/content/docs/guides/setup/v2/installation.md +++ b/pgml-dashboard/content/docs/guides/setup/v2/installation.md @@ -36,7 +36,7 @@ brew bundle PostgresML is written in Rust, so you'll need to install the latest compiler from [rust-lang.org](https://rust-lang.org). Additionally, we use the Rust PostgreSQL extension framework `pgrx`, which requires some initialization steps: ```bash -cargo install cargo-pgrx --version 0.11.0 && \ +cargo install cargo-pgrx --version 0.10.0 && \ cargo pgrx init ``` @@ -294,7 +294,7 @@ We use the `pgrx` Postgres Rust extension framework, which comes with its own in ```bash cd pgml-extension && \ -cargo install cargo-pgrx --version 0.11.0 && \ +cargo install cargo-pgrx --version 0.10.0 && \ cargo pgrx init ``` diff --git a/pgml-docs/docs/guides/deploying-postgresml/self-hosting/building-from-source.md b/pgml-docs/docs/guides/deploying-postgresml/self-hosting/building-from-source.md index f2f4e4fb3..64d6d9f30 100644 --- a/pgml-docs/docs/guides/deploying-postgresml/self-hosting/building-from-source.md +++ b/pgml-docs/docs/guides/deploying-postgresml/self-hosting/building-from-source.md @@ -40,12 +40,12 @@ For a typical deployment in production, you would need to compile and install th #### Install pgrx -`pgrx` is open source and available from crates.io. We are currently using the `0.11.0` version. It's important that your `pgrx` version matches what we're using, since there are some hard dependencies between our code and `pgrx`. +`pgrx` is open source and available from crates.io. We are currently using the `0.10.0` version. It's important that your `pgrx` version matches what we're using, since there are some hard dependencies between our code and `pgrx`. To install `pgrx`, simply run: ``` -cargo install cargo-pgrx --version "0.11.0" +cargo install cargo-pgrx --version "0.10.0" ``` Before using `pgrx`, it needs to be initialized against the installed version of PostgreSQL. In this example, we'll be using the Ubuntu 22.04 default PostgreSQL 14 installation: diff --git a/pgml-extension/Cargo.lock b/pgml-extension/Cargo.lock index 5b2945b0b..725e6ed5b 100644 --- a/pgml-extension/Cargo.lock +++ b/pgml-extension/Cargo.lock @@ -251,9 +251,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.68.1" +version = "0.66.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" +checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" dependencies = [ "bitflags 2.4.0", "cexpr 0.6.0", @@ -366,9 +366,9 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cargo_toml" -version = "0.16.3" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3f9629bc6c4388ea699781dc988c2b99766d7679b151c81990b4fa1208fafd3" +checksum = "599aa35200ffff8f04c1925aa1acc92fa2e08874379ef42e210a80e527e60838" dependencies = [ "serde", "toml", @@ -794,18 +794,18 @@ checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "enum-map" -version = "2.6.3" +version = "2.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c188012f8542dee7b3996e44dd89461d64aa471b0a7c71a1ae2f595d259e96e5" +checksum = "4e10d4d903e79b6181943defcdc36f61f8f608e5892eca719fb0677799d3f8fe" dependencies = [ "enum-map-derive", ] [[package]] name = "enum-map-derive" -version = "0.14.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04d0b288e3bb1d861c4403c1774a6f7a798781dfc519b3647df2a3dd4ae95f25" +checksum = "ccb14d927583dd5c2eac0f2cf264fc4762aefe1ae14c47a8a20fc1939d3a5fc0" dependencies = [ "proc-macro2", "quote 1.0.33", @@ -1244,9 +1244,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libloading" @@ -1876,9 +1876,9 @@ dependencies = [ [[package]] name = "pgrx" -version = "0.11.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd3c4b36fbe84329b86c83bfd33b9514a50606f00074f47085f99062a7dd8c9c" +checksum = "eb7ee7e7abe8a74124732d05fdbccd11179b4778c08736995fdfc8ca9d2e9c24" dependencies = [ "atomic-traits", "bitflags 2.4.0", @@ -1901,9 +1901,9 @@ dependencies = [ [[package]] name = "pgrx-macros" -version = "0.11.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c6a41e021321a814fac1aa27bd4266208b4507709ecbc28fc99693adfbd0c41" +checksum = "26c6d5a93b4c6ceb3735605205267a002584fd3d7fa87eed3133cba6c74f7431" dependencies = [ "pgrx-sql-entity-graph", "proc-macro2", @@ -1913,9 +1913,9 @@ dependencies = [ [[package]] name = "pgrx-pg-config" -version = "0.11.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17da1e26800e747d501b8d8bb8aeee4530a07d93a39c3fb2c4229a8feff213b2" +checksum = "14a7885744ba92cd19ad87f2bf195352a9533cd2bb10a1ebbeef7ef9d65126aa" dependencies = [ "cargo_toml", "dirs 5.0.1", @@ -1931,11 +1931,11 @@ dependencies = [ [[package]] name = "pgrx-pg-sys" -version = "0.11.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9032b517525ec71579cc68e92905b5f5f63e892c094834202313c42f2f1a669" +checksum = "916a552934ebfcf3c56277e682526c8d92264b4c9ba58a7d0a3cddf1e03c6825" dependencies = [ - "bindgen 0.68.1", + "bindgen 0.66.1", "eyre", "libc", "memoffset 0.9.0", @@ -1953,9 +1953,9 @@ dependencies = [ [[package]] name = "pgrx-sql-entity-graph" -version = "0.11.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e4a88203974b887bca8bfdea17ab9936411fb7e84957763dc0124df78d07907" +checksum = "db087888395237259e1c643777ff619077ace10afa670e5bb4b8d510db63dac0" dependencies = [ "convert_case", "eyre", @@ -1968,9 +1968,9 @@ dependencies = [ [[package]] name = "pgrx-tests" -version = "0.11.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c80deb4310538e6ef14f4cbb30b56eb24b6d7aae66bfd4e516f153987159e65e" +checksum = "18b3449cbdfdbd25bc24ae7d962fdc0c8eac2a839b5bfee7a295b6c8931b0c0b" dependencies = [ "clap-cargo", "eyre", @@ -2077,9 +2077,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -2312,25 +2312,25 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.2", + "regex-syntax 0.7.5", ] [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.7.5", ] [[package]] @@ -2341,9 +2341,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "rmp" @@ -3039,9 +3039,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.2" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" dependencies = [ "serde", "serde_spanned", @@ -3060,9 +3060,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.20.2" +version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ "indexmap 2.0.0", "serde", diff --git a/pgml-extension/Cargo.toml b/pgml-extension/Cargo.toml index e2e761f14..02e34ce08 100644 --- a/pgml-extension/Cargo.toml +++ b/pgml-extension/Cargo.toml @@ -7,20 +7,20 @@ edition = "2021" crate-type = ["lib", "cdylib"] [features] -default = ["pg16", "python"] +default = ["pg15", "python"] +pg11 = ["pgrx/pg11", "pgrx-tests/pg11"] pg12 = ["pgrx/pg12", "pgrx-tests/pg12"] pg13 = ["pgrx/pg13", "pgrx-tests/pg13"] pg14 = ["pgrx/pg14", "pgrx-tests/pg14"] pg15 = ["pgrx/pg15", "pgrx-tests/pg15"] -pg16 = ["pgrx/pg16", "pgrx-tests/pg16"] use_as_lib = [] pg_test = [] python = ["pyo3"] cuda = ["xgboost/cuda", "lightgbm/cuda"] [dependencies] -pgrx = "=0.11.0" -pgrx-pg-sys = "=0.11.0" +pgrx = "=0.10.0" +pgrx-pg-sys = "=0.10.0" xgboost = { git = "https://github.com/postgresml/rust-xgboost.git", branch = "master" } once_cell = { version = "1", features = ["parking_lot"] } rand = "0.8" @@ -51,7 +51,7 @@ flate2 = "1.0" csv = "1.2" [dev-dependencies] -pgrx-tests = "=0.11.0" +pgrx-tests = "=0.10.0" [build-dependencies] vergen = { version = "8", features = ["build", "git", "gitcl"] } From 14a59761a4a13850c8cc54426b0930b37058fdee Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Thu, 19 Oct 2023 17:19:14 -0400 Subject: [PATCH 06/22] Update to pgrx 0.11.0 & Postgres 16 (#1102) --- .github/workflows/ci.yml | 2 +- .../ubuntu-packages-and-docker-image.yml | 12 ++- .../content/docs/guides/setup/developers.md | 2 +- .../docs/guides/setup/v2/installation.md | 4 +- .../self-hosting/README.md | 2 +- .../self-hosting/building-from-source.md | 4 +- pgml-extension/Cargo.lock | 76 +++++++++---------- pgml-extension/Cargo.toml | 12 +-- pgml-extension/sql/pgml--2.7.10--2.7.11.sql | 0 9 files changed, 60 insertions(+), 54 deletions(-) create mode 100644 pgml-extension/sql/pgml--2.7.10--2.7.11.sql diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5f65aed0..a9a19a9ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: run: | curl https://sh.rustup.rs -sSf | sh -s -- -y source ~/.cargo/env - cargo install cargo-pgrx --version "0.10.0" --locked + cargo install cargo-pgrx --version "0.11.0" --locked if [[ ! -d ~/.pgrx ]]; then cargo pgrx init diff --git a/.github/workflows/ubuntu-packages-and-docker-image.yml b/.github/workflows/ubuntu-packages-and-docker-image.yml index 681c084ee..dc94df6a2 100644 --- a/.github/workflows/ubuntu-packages-and-docker-image.yml +++ b/.github/workflows/ubuntu-packages-and-docker-image.yml @@ -72,16 +72,16 @@ jobs: libpq-dev \ libclang-dev \ wget \ + postgresql-16 \ postgresql-15 \ postgresql-14 \ postgresql-13 \ postgresql-12 \ - postgresql-11 \ + postgresql-server-dev-16 \ postgresql-server-dev-15 \ postgresql-server-dev-14 \ postgresql-server-dev-13 \ postgresql-server-dev-12 \ - postgresql-server-dev-11 \ lsb-release \ python3.10 \ python3-pip \ @@ -98,7 +98,7 @@ jobs: with: working-directory: pgml-extension command: install - args: cargo-pgrx --version "0.10.0" --locked + args: cargo-pgrx --version "0.11.0" --locked - name: pgrx init uses: postgresml/gh-actions-cargo@master with: @@ -135,6 +135,12 @@ jobs: working-directory: pgml-extension command: pgrx args: package --pg-config /usr/lib/postgresql/15/bin/pg_config + - name: Build Postgres 16 + uses: postgresml/gh-actions-cargo@master + with: + working-directory: pgml-extension + command: pgrx + args: package --pg-config /usr/lib/postgresql/16/bin/pg_config - name: Build debs env: AWS_ACCESS_KEY_ID: ${{ vars.AWS_ACCESS_KEY_ID }} diff --git a/pgml-dashboard/content/docs/guides/setup/developers.md b/pgml-dashboard/content/docs/guides/setup/developers.md index 659e81424..24c3b536b 100644 --- a/pgml-dashboard/content/docs/guides/setup/developers.md +++ b/pgml-dashboard/content/docs/guides/setup/developers.md @@ -70,7 +70,7 @@ Once there, you can initialize `pgrx` and get going: #### Pgrx command line and environments ```commandline -cargo install cargo-pgrx --version "0.10.0" --locked && \ +cargo install cargo-pgrx --version "0.11.0" --locked && \ cargo pgrx init # This will take a few minutes ``` diff --git a/pgml-dashboard/content/docs/guides/setup/v2/installation.md b/pgml-dashboard/content/docs/guides/setup/v2/installation.md index acbcf281a..99566090d 100644 --- a/pgml-dashboard/content/docs/guides/setup/v2/installation.md +++ b/pgml-dashboard/content/docs/guides/setup/v2/installation.md @@ -36,7 +36,7 @@ brew bundle PostgresML is written in Rust, so you'll need to install the latest compiler from [rust-lang.org](https://rust-lang.org). Additionally, we use the Rust PostgreSQL extension framework `pgrx`, which requires some initialization steps: ```bash -cargo install cargo-pgrx --version 0.10.0 && \ +cargo install cargo-pgrx --version 0.11.0 && \ cargo pgrx init ``` @@ -294,7 +294,7 @@ We use the `pgrx` Postgres Rust extension framework, which comes with its own in ```bash cd pgml-extension && \ -cargo install cargo-pgrx --version 0.10.0 && \ +cargo install cargo-pgrx --version 0.11.0 && \ cargo pgrx init ``` diff --git a/pgml-docs/docs/guides/deploying-postgresml/self-hosting/README.md b/pgml-docs/docs/guides/deploying-postgresml/self-hosting/README.md index e64677886..45c04b606 100644 --- a/pgml-docs/docs/guides/deploying-postgresml/self-hosting/README.md +++ b/pgml-docs/docs/guides/deploying-postgresml/self-hosting/README.md @@ -31,7 +31,7 @@ Finally, you can install PostgresML: sudo apt install -y postgresml-14 ``` -Ubuntu 22.04 ships with PostgreSQL 14, but if you have a different version installed on your system, just change `14` in the package name to your Postgres version. We currently support all versions supported by the community: Postgres 12 through 15. +Ubuntu 22.04 ships with PostgreSQL 14, but if you have a different version installed on your system, just change `14` in the package name to your Postgres version. We currently support all versions supported by the community: Postgres 12 through 16. ### Validate your installation diff --git a/pgml-docs/docs/guides/deploying-postgresml/self-hosting/building-from-source.md b/pgml-docs/docs/guides/deploying-postgresml/self-hosting/building-from-source.md index 64d6d9f30..f2f4e4fb3 100644 --- a/pgml-docs/docs/guides/deploying-postgresml/self-hosting/building-from-source.md +++ b/pgml-docs/docs/guides/deploying-postgresml/self-hosting/building-from-source.md @@ -40,12 +40,12 @@ For a typical deployment in production, you would need to compile and install th #### Install pgrx -`pgrx` is open source and available from crates.io. We are currently using the `0.10.0` version. It's important that your `pgrx` version matches what we're using, since there are some hard dependencies between our code and `pgrx`. +`pgrx` is open source and available from crates.io. We are currently using the `0.11.0` version. It's important that your `pgrx` version matches what we're using, since there are some hard dependencies between our code and `pgrx`. To install `pgrx`, simply run: ``` -cargo install cargo-pgrx --version "0.10.0" +cargo install cargo-pgrx --version "0.11.0" ``` Before using `pgrx`, it needs to be initialized against the installed version of PostgreSQL. In this example, we'll be using the Ubuntu 22.04 default PostgreSQL 14 installation: diff --git a/pgml-extension/Cargo.lock b/pgml-extension/Cargo.lock index 725e6ed5b..aa5df2371 100644 --- a/pgml-extension/Cargo.lock +++ b/pgml-extension/Cargo.lock @@ -251,9 +251,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.66.1" +version = "0.68.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" +checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" dependencies = [ "bitflags 2.4.0", "cexpr 0.6.0", @@ -366,9 +366,9 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cargo_toml" -version = "0.15.3" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "599aa35200ffff8f04c1925aa1acc92fa2e08874379ef42e210a80e527e60838" +checksum = "e3f9629bc6c4388ea699781dc988c2b99766d7679b151c81990b4fa1208fafd3" dependencies = [ "serde", "toml", @@ -794,18 +794,18 @@ checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "enum-map" -version = "2.6.2" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e10d4d903e79b6181943defcdc36f61f8f608e5892eca719fb0677799d3f8fe" +checksum = "c188012f8542dee7b3996e44dd89461d64aa471b0a7c71a1ae2f595d259e96e5" dependencies = [ "enum-map-derive", ] [[package]] name = "enum-map-derive" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccb14d927583dd5c2eac0f2cf264fc4762aefe1ae14c47a8a20fc1939d3a5fc0" +checksum = "04d0b288e3bb1d861c4403c1774a6f7a798781dfc519b3647df2a3dd4ae95f25" dependencies = [ "proc-macro2", "quote 1.0.33", @@ -1244,9 +1244,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libloading" @@ -1840,7 +1840,7 @@ dependencies = [ [[package]] name = "pgml" -version = "2.7.10" +version = "2.7.11" dependencies = [ "anyhow", "blas", @@ -1876,9 +1876,9 @@ dependencies = [ [[package]] name = "pgrx" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb7ee7e7abe8a74124732d05fdbccd11179b4778c08736995fdfc8ca9d2e9c24" +checksum = "bd3c4b36fbe84329b86c83bfd33b9514a50606f00074f47085f99062a7dd8c9c" dependencies = [ "atomic-traits", "bitflags 2.4.0", @@ -1901,9 +1901,9 @@ dependencies = [ [[package]] name = "pgrx-macros" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6d5a93b4c6ceb3735605205267a002584fd3d7fa87eed3133cba6c74f7431" +checksum = "9c6a41e021321a814fac1aa27bd4266208b4507709ecbc28fc99693adfbd0c41" dependencies = [ "pgrx-sql-entity-graph", "proc-macro2", @@ -1913,9 +1913,9 @@ dependencies = [ [[package]] name = "pgrx-pg-config" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14a7885744ba92cd19ad87f2bf195352a9533cd2bb10a1ebbeef7ef9d65126aa" +checksum = "17da1e26800e747d501b8d8bb8aeee4530a07d93a39c3fb2c4229a8feff213b2" dependencies = [ "cargo_toml", "dirs 5.0.1", @@ -1931,11 +1931,11 @@ dependencies = [ [[package]] name = "pgrx-pg-sys" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "916a552934ebfcf3c56277e682526c8d92264b4c9ba58a7d0a3cddf1e03c6825" +checksum = "f9032b517525ec71579cc68e92905b5f5f63e892c094834202313c42f2f1a669" dependencies = [ - "bindgen 0.66.1", + "bindgen 0.68.1", "eyre", "libc", "memoffset 0.9.0", @@ -1953,9 +1953,9 @@ dependencies = [ [[package]] name = "pgrx-sql-entity-graph" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db087888395237259e1c643777ff619077ace10afa670e5bb4b8d510db63dac0" +checksum = "2e4a88203974b887bca8bfdea17ab9936411fb7e84957763dc0124df78d07907" dependencies = [ "convert_case", "eyre", @@ -1968,9 +1968,9 @@ dependencies = [ [[package]] name = "pgrx-tests" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18b3449cbdfdbd25bc24ae7d962fdc0c8eac2a839b5bfee7a295b6c8931b0c0b" +checksum = "c80deb4310538e6ef14f4cbb30b56eb24b6d7aae66bfd4e516f153987159e65e" dependencies = [ "clap-cargo", "eyre", @@ -2077,9 +2077,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -2312,25 +2312,25 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.5" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.7.5", + "regex-syntax 0.8.2", ] [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.8.2", ] [[package]] @@ -2341,9 +2341,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rmp" @@ -3039,9 +3039,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.6" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" dependencies = [ "serde", "serde_spanned", @@ -3060,9 +3060,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ "indexmap 2.0.0", "serde", diff --git a/pgml-extension/Cargo.toml b/pgml-extension/Cargo.toml index 02e34ce08..722c8aa5e 100644 --- a/pgml-extension/Cargo.toml +++ b/pgml-extension/Cargo.toml @@ -1,26 +1,26 @@ [package] name = "pgml" -version = "2.7.10" +version = "2.7.11" edition = "2021" [lib] crate-type = ["lib", "cdylib"] [features] -default = ["pg15", "python"] -pg11 = ["pgrx/pg11", "pgrx-tests/pg11"] +default = ["pg16", "python"] pg12 = ["pgrx/pg12", "pgrx-tests/pg12"] pg13 = ["pgrx/pg13", "pgrx-tests/pg13"] pg14 = ["pgrx/pg14", "pgrx-tests/pg14"] pg15 = ["pgrx/pg15", "pgrx-tests/pg15"] +pg16 = ["pgrx/pg16", "pgrx-tests/pg16"] use_as_lib = [] pg_test = [] python = ["pyo3"] cuda = ["xgboost/cuda", "lightgbm/cuda"] [dependencies] -pgrx = "=0.10.0" -pgrx-pg-sys = "=0.10.0" +pgrx = "=0.11.0" +pgrx-pg-sys = "=0.11.0" xgboost = { git = "https://github.com/postgresml/rust-xgboost.git", branch = "master" } once_cell = { version = "1", features = ["parking_lot"] } rand = "0.8" @@ -51,7 +51,7 @@ flate2 = "1.0" csv = "1.2" [dev-dependencies] -pgrx-tests = "=0.10.0" +pgrx-tests = "=0.11.0" [build-dependencies] vergen = { version = "8", features = ["build", "git", "gitcl"] } diff --git a/pgml-extension/sql/pgml--2.7.10--2.7.11.sql b/pgml-extension/sql/pgml--2.7.10--2.7.11.sql new file mode 100644 index 000000000..e69de29bb From e22134f633819db9cc4cf1cf8e538f88e2121670 Mon Sep 17 00:00:00 2001 From: Montana Low Date: Thu, 19 Oct 2023 22:26:53 +0000 Subject: [PATCH 07/22] GITBOOK-72: Fix broken Pipelines and Search and add a bit more info --- .../self-hosting/README.md | 2 +- .../self-hosting/building-from-source.md | 4 +- .../guides/developer-docs/installation.md | 1 - .../docs/guides/getting-started/sign-up.md | 1 + .../data-pre-processing.md | 8 +- pgml-docs/docs/guides/sdks/pipelines.md | 98 +++++++---- pgml-docs/docs/guides/sdks/search.md | 161 +++++++++--------- 7 files changed, 153 insertions(+), 122 deletions(-) diff --git a/pgml-docs/docs/guides/deploying-postgresml/self-hosting/README.md b/pgml-docs/docs/guides/deploying-postgresml/self-hosting/README.md index 45c04b606..e64677886 100644 --- a/pgml-docs/docs/guides/deploying-postgresml/self-hosting/README.md +++ b/pgml-docs/docs/guides/deploying-postgresml/self-hosting/README.md @@ -31,7 +31,7 @@ Finally, you can install PostgresML: sudo apt install -y postgresml-14 ``` -Ubuntu 22.04 ships with PostgreSQL 14, but if you have a different version installed on your system, just change `14` in the package name to your Postgres version. We currently support all versions supported by the community: Postgres 12 through 16. +Ubuntu 22.04 ships with PostgreSQL 14, but if you have a different version installed on your system, just change `14` in the package name to your Postgres version. We currently support all versions supported by the community: Postgres 12 through 15. ### Validate your installation diff --git a/pgml-docs/docs/guides/deploying-postgresml/self-hosting/building-from-source.md b/pgml-docs/docs/guides/deploying-postgresml/self-hosting/building-from-source.md index f2f4e4fb3..64d6d9f30 100644 --- a/pgml-docs/docs/guides/deploying-postgresml/self-hosting/building-from-source.md +++ b/pgml-docs/docs/guides/deploying-postgresml/self-hosting/building-from-source.md @@ -40,12 +40,12 @@ For a typical deployment in production, you would need to compile and install th #### Install pgrx -`pgrx` is open source and available from crates.io. We are currently using the `0.11.0` version. It's important that your `pgrx` version matches what we're using, since there are some hard dependencies between our code and `pgrx`. +`pgrx` is open source and available from crates.io. We are currently using the `0.10.0` version. It's important that your `pgrx` version matches what we're using, since there are some hard dependencies between our code and `pgrx`. To install `pgrx`, simply run: ``` -cargo install cargo-pgrx --version "0.11.0" +cargo install cargo-pgrx --version "0.10.0" ``` Before using `pgrx`, it needs to be initialized against the installed version of PostgreSQL. In this example, we'll be using the Ubuntu 22.04 default PostgreSQL 14 installation: diff --git a/pgml-docs/docs/guides/developer-docs/installation.md b/pgml-docs/docs/guides/developer-docs/installation.md index 0eec9949a..3099fcc83 100644 --- a/pgml-docs/docs/guides/developer-docs/installation.md +++ b/pgml-docs/docs/guides/developer-docs/installation.md @@ -64,7 +64,6 @@ To install the necessary Python packages into a virtual environment, use the `vi virtualenv pgml-venv && \ source pgml-venv/bin/activate && \ pip install -r requirements.txt && \ -pip install -r requirements-autogptq.txt && \ pip install -r requirements-xformers.txt --no-dependencies ``` diff --git a/pgml-docs/docs/guides/getting-started/sign-up.md b/pgml-docs/docs/guides/getting-started/sign-up.md index 11fd8b1b7..9ec627997 100644 --- a/pgml-docs/docs/guides/getting-started/sign-up.md +++ b/pgml-docs/docs/guides/getting-started/sign-up.md @@ -5,6 +5,7 @@ 1. Go to [https://postgresml.org/signup](https://postgresml.org/signup) 2. Sign up using your email or using Google or Github authentication 3. Login using your account +4. [data-pre-processing.md](../machine-learning/supervised-learning/data-pre-processing.md "mention") diff --git a/pgml-docs/docs/guides/machine-learning/supervised-learning/data-pre-processing.md b/pgml-docs/docs/guides/machine-learning/supervised-learning/data-pre-processing.md index 90a65132b..321ef59a6 100644 --- a/pgml-docs/docs/guides/machine-learning/supervised-learning/data-pre-processing.md +++ b/pgml-docs/docs/guides/machine-learning/supervised-learning/data-pre-processing.md @@ -25,9 +25,9 @@ In this example: There are 3 steps to preprocessing data: -* [Encoding](#categorical-encodings) categorical values into quantitative values -* [Imputing](#imputing-missing-values) NULL values to some quantitative value -* [Scaling](#scaling-values) quantitative values across all variables to similar ranges +* [Encoding](../../../../../pgml-dashboard/content/docs/guides/training/preprocessing.md#categorical-encodings) categorical values into quantitative values +* [Imputing](../../../../../pgml-dashboard/content/docs/guides/training/preprocessing.md#imputing-missing-values) NULL values to some quantitative value +* [Scaling](../../../../../pgml-dashboard/content/docs/guides/training/preprocessing.md#scaling-values) quantitative values across all variables to similar ranges These preprocessing steps may be specified on a per-column basis to the [train()](../../../../../docs/guides/training/overview) function. By default, PostgresML does minimal preprocessing on training data, and will raise an error during analysis if NULL values are encountered without a preprocessor. All types other than `TEXT` are treated as quantitative variables and cast to floating point representations before passing them to the underlying algorithm implementations. @@ -71,7 +71,7 @@ Encoding categorical variables is an O(N log(M)) where N is the number of rows, | **name** | **description** | | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | `none` | **Default** - Casts the variable to a 32-bit floating point representation compatible with numerics. This is the default for non-`TEXT` values. | -| `target` | Encodes the variable as the average value of the target label for all members of the category. This is the default for `TEXT` variables. | +| `target` | Encodes the variable as the mean value of the target label for all members of the category. This is the default for `TEXT` variables. | | `one_hot` | Encodes the variable as multiple independent boolean columns. | | `ordinal` | Encodes the variable as integer values provided by their position in the input array. NULLS are always 0. | diff --git a/pgml-docs/docs/guides/sdks/pipelines.md b/pgml-docs/docs/guides/sdks/pipelines.md index 8fe5ea3ab..287734772 100644 --- a/pgml-docs/docs/guides/sdks/pipelines.md +++ b/pgml-docs/docs/guides/sdks/pipelines.md @@ -17,7 +17,7 @@ model = Model() {% tab title="JavaScript" %} ```javascript -model = pgml.newModel() +const model = pgml.newModel() ``` {% endtab %} {% endtabs %} @@ -36,9 +36,10 @@ model = Model( {% tab title="JavaScript" %} ```javascript -model = pgml.newModel( - name="hkunlp/instructor-base", - parameters={instruction: "Represent the Wikipedia document for retrieval: "} +const model = pgml.newModel( + "hkunlp/instructor-base", + "pgml", + { instruction: "Represent the Wikipedia document for retrieval: " } ) ``` {% endtab %} @@ -55,7 +56,7 @@ model = Model(name="text-embedding-ada-002", source="openai") {% tab title="JavaScript" %} ```javascript -model = pgml.newModel(name="text-embedding-ada-002", source="openai") +const model = pgml.newModel("text-embedding-ada-002", "openai") ``` {% endtab %} {% endtabs %} @@ -75,7 +76,7 @@ splitter = Splitter() {% tab title="JavaScript" %} ```javascript -splitter = pgml.newSplitter() +const splitter = pgml.newSplitter() ``` {% endtab %} {% endtabs %} @@ -95,8 +96,8 @@ splitter = Splitter( {% tab title="JavaScript" %} ```javascript splitter = pgml.newSplitter( - name="recursive_character", - parameters={chunk_size: 1500, chunk_overlap: 40} + "recursive_character", + { chunk_size: 1500, chunk_overlap: 40 } ) ``` {% endtab %} @@ -120,9 +121,9 @@ await collection.add_pipeline(pipeline) {% tab title="JavaScript" %} ```javascript -model = pgml.newModel() -splitter = pgml.newSplitter() -pipeline = pgml.newPipeline("test_pipeline", model, splitter) +const model = pgml.newModel() +const splitter = pgml.newSplitter() +const pipeline = pgml.newPipeline("test_pipeline", model, splitter) await collection.add_pipeline(pipeline) ``` {% endtab %} @@ -151,17 +152,51 @@ await collection.add_pipeline(pipeline) {% tab title="JavaScript" %} ```javascript -model = pgml.newModel() -splitter = pgml.newSplitter() -pipeline = pgml.newPipeline("test_pipeline", model, splitter, { - "full_text_search": { - active: True, - configuration: "english" +const model = pgml.newModel() +const splitter = pgml.newSplitter() +const pipeline = pgml.newPipeline("test_pipeline", model, splitter, { + full_text_search: { + active: true, + configuration: "english" + } +}) +await collection.add_pipeline(pipeline) +``` +{% endtab %} +{% endtabs %} + +### Customizing the HNSW Index + +By default the SDK uses HNSW indexes to efficiently perform vector recall. The default HNSW index sets `m` to 16 and `ef_construction` to 64. These defaults can be customized when the Pipeline is created. + +{% tabs %} +{% tab title="Python" %} +```python +model = Model() +splitter = Splitter() +pipeline = Pipeline("test_pipeline", model, splitter, { + "hnsw": { + "m": 16, + "ef_construction": 64 } }) await collection.add_pipeline(pipeline) ``` {% endtab %} + +{% tab title="JavaScript" %} +```javascript +const model = pgml.newModel() +const splitter = pgml.newSplitter() +const pipeline = pgml.newPipeline("test_pipeline", model, splitter, { + hnsw: { + m: 16, + ef_construction: 64 + } +}) +await collection.add_pipeline(pipeline) +``` +{% endtab %} {% endtabs %} ## Searching with Pipelines @@ -179,19 +214,17 @@ results = await collection.query().vector_recall("Why is PostgresML the best?", {% tab title="JavaScript" %} ```javascript -pipeline = pgml.newPipeline("test_pipeline") -collection = pgml.newCollection("test_collection") -results = await collection.query().vector_recall("Why is PostgresML the best?", pipeline).fetch_all() +const pipeline = pgml.newPipeline("test_pipeline") +const collection = pgml.newCollection("test_collection") +const results = await collection.query().vector_recall("Why is PostgresML the best?", pipeline).fetch_all() ``` {% endtab %} {% endtabs %} - +## **Disable a Pipeline** Pipelines can be disabled or removed to prevent them from running automatically when documents are upserted. -## **Disable a Pipeline** - {% tabs %} {% tab title="Python" %} ```python @@ -203,8 +236,8 @@ await collection.disable_pipeline(pipeline) {% tab title="JavaScript" %} ```javascript -pipeline = pgml.newPipeline("test_pipeline") -collection = pgml.newCollection("test_collection") +const pipeline = pgml.newPipeline("test_pipeline") +const collection = pgml.newCollection("test_collection") await collection.disable_pipeline(pipeline) ``` {% endtab %} @@ -214,6 +247,8 @@ Disabling a Pipeline prevents it from running automatically, but leaves all chun ## **Enable a Pipeline** +Disabled pipelines can be re-enabled. + {% tabs %} {% tab title="Python" %} ```python @@ -225,8 +260,8 @@ await collection.enable_pipeline(pipeline) {% tab title="JavaScript" %} ```javascript -pipeline = pgml.newPipeline("test_pipeline") -collection = pgml.newCollection("test_collection") +const pipeline = pgml.newPipeline("test_pipeline") +const collection = pgml.newCollection("test_collection") await collection.enable_pipeline(pipeline) ``` {% endtab %} @@ -246,11 +281,10 @@ await collection.remove_pipeline(pipeline) {% endtab %} {% tab title="JavaScript" %} -```javascript -pipeline = pgml.newPipeline("test_pipeline") -collection = pgml.newCollection("test_collection") -await collection.remove_pipeline(pipeline) -``` +
const pipeline = pgml.newPipeline("test_pipeline")
+const collection = pgml.newCollection("test_collection")
+await collection.remove_pipeline(pipeline)
+
{% endtab %} {% endtabs %} diff --git a/pgml-docs/docs/guides/sdks/search.md b/pgml-docs/docs/guides/sdks/search.md index 500aed1a6..a22c729be 100644 --- a/pgml-docs/docs/guides/sdks/search.md +++ b/pgml-docs/docs/guides/sdks/search.md @@ -14,11 +14,10 @@ results = await collection.query().vector_recall("Why is PostgresML the best?", {% endtab %} {% tab title="JavaScript" %} -```javascript -collection = pgml.newCollection("test_collection") -pipeline = pgml.newPipeline("test_pipeline") -results = await collection.query().vector_recall("Why is PostgresML the best?", pipeline).fetch_all() -``` +
const collection = pgml.newCollection("test_collection")
+const pipeline = pgml.newPipeline("test_pipeline")
+const results = await collection.query().vector_recall("Why is PostgresML the best?", pipeline).fetch_all()
+
{% endtab %} {% endtabs %} @@ -35,9 +34,9 @@ results = await collection.query().vector_recall("Why is PostgresML the best?", {% tab title="JavaScript" %} ```javascript -collection = pgml.newCollection("test_collection") -pipeline = pgml.newPipeline("test_pipeline") -results = await collection.query().vector_recall("Why is PostgresML the best?", pipeline).limit(10).fetch_all() +const collection = pgml.newCollection("test_collection") +const pipeline = pgml.newPipeline("test_pipeline") +const results = await collection.query().vector_recall("Why is PostgresML the best?", pipeline).limit(10).fetch_all() ``` {% endtab %} {% endtabs %} @@ -50,9 +49,8 @@ We provide powerful and flexible arbitrarly nested metadata filtering based off {% tabs %} {% tab title="Python" %} -```python -collection = Collection("test_collection") -pipeline = Pipeline("test_pipeline") +
collection = Collection("test_collection")
+pipeline = Pipeline("test_pipeline")
 results = (
     await collection.query()
     .vector_recall("Here is some query", pipeline)
@@ -66,24 +64,24 @@ results = (
     })
     .fetch_all()
 )
-```
+
{% endtab %} {% tab title="JavaScript" %} ```javascript -collection = pgml.newCollection("test_collection") -pipeline = pgml.newPipeline("test_pipeline") -results = await collection.query() - .vector_recall("Here is some query", pipeline) - .limit(10) - .filter({ - "metadata": { - "uuid": { - "$eq": 1 - } - } - }) - .fetch_all() +const collection = pgml.newCollection("test_collection") +const pipeline = pgml.newPipeline("test_pipeline") +const results = await collection.query() + .vector_recall("Here is some query", pipeline) + .limit(10) + .filter({ + metadata: { + uuid: { + $eq: 1 + } + } + }) + .fetch_all() ``` {% endtab %} {% endtabs %} @@ -115,25 +113,24 @@ results = ( {% tab title="JavaScript" %} ```javascript -collection = pgml.newCollection("test_collection") -pipeline = pgml.newPipeline("test_pipeline") -results = await collection.query() - .vector_recall("Here is some query", pipeline) - .limit(10) - .filter({ - "metadata": { - "index": { - "$gte": 3 - } - } - }) - .fetch_all() -) +const collection = pgml.newCollection("test_collection") +const pipeline = pgml.newPipeline("test_pipeline") +const results = await collection.query() + .vector_recall("Here is some query", pipeline) + .limit(10) + .filter({ + metadata: { + index: { + $gte: 3 + } + } + }) + .fetch_all() ``` {% endtab %} {% endtabs %} -The above query would filter out all documents that do not contain a key `index` with a value greater than `3`. +The above query would filter out all documents that do not contain a key `index` with a value greater than or equal to `3`. **Vector search with $or and $and metadata filtering** @@ -178,37 +175,37 @@ results = ( {% tab title="JavaScript" %} ```javascript -collection = pgml.newCollection("test_collection") -pipeline = pgml.newPipeline("test_pipeline") -results = await collection.query() - .vector_recall("Here is some query", pipeline) - .limit(10) - .filter({ - "metadata": { - "$or": [ - { - "$and": [ - { - "$eq": { - "uuid": 1 - } - }, - { - "$lt": { - "index": 100 - } - } - ] - }, - { - "special": { - "$ne": True - } - } - ] +const collection = pgml.newCollection("test_collection") +const pipeline = pgml.newPipeline("test_pipeline") +const results = await collection.query() + .vector_recall("Here is some query", pipeline) + .limit(10) + .filter({ + metadata: { + $or: [ + { + $and: [ + { + $eq: { + uuid: 1 + } + }, + { + $lt: { + index: 100 + } + } + ] + }, + { + special: { + $ne: True + } } - }) - .fetch_all() + ] + } + }) + .fetch_all() ``` {% endtab %} {% endtabs %} @@ -241,18 +238,18 @@ results = ( {% tab title="JavaScript" %} ```javascript -collection = pgml.newCollection("test_collection") -pipeline = pgml.newPipeline("test_pipeline") -results = await collection.query() - .vector_recall("Here is some query", pipeline) - .limit(10) - .filter({ - "full_text": { - "configuration": "english", - "text": "Match Me" - } - }) - .fetch_all() +const collection = pgml.newCollection("test_collection") +const pipeline = pgml.newPipeline("test_pipeline") +const results = await collection.query() + .vector_recall("Here is some query", pipeline) + .limit(10) + .filter({ + full_text: { + configuration: "english", + text: "Match Me" + } + }) + .fetch_all() ``` {% endtab %} {% endtabs %} From 108b052c1035b8d863857ac4308b4f93e6eebadf Mon Sep 17 00:00:00 2001 From: Montana Low Date: Thu, 19 Oct 2023 17:16:59 -0700 Subject: [PATCH 08/22] Add support for XGBoost `eval_metrics` and `objective` (#1103) --- pgml-extension/examples/regression.sql | 3 +- pgml-extension/src/bindings/xgboost.rs | 101 ++++++++++++++++++++++--- pgml-extension/src/orm/model.rs | 48 ++++++------ pgml-extension/src/orm/snapshot.rs | 11 ++- 4 files changed, 124 insertions(+), 39 deletions(-) diff --git a/pgml-extension/examples/regression.sql b/pgml-extension/examples/regression.sql index c800fc957..2970e7e59 100644 --- a/pgml-extension/examples/regression.sql +++ b/pgml-extension/examples/regression.sql @@ -106,7 +106,8 @@ SELECT * FROM pgml.deployed_models ORDER BY deployed_at DESC LIMIT 5; -- do a hyperparam search on your favorite algorithm SELECT pgml.train( 'Diabetes Progression', - algorithm => 'xgboost', + algorithm => 'xgboost', + hyperparams => '{"eval_metric": "rmse"}'::JSONB, search => 'grid', search_params => '{ "max_depth": [1, 2], diff --git a/pgml-extension/src/bindings/xgboost.rs b/pgml-extension/src/bindings/xgboost.rs index 3521560a2..be3d2b09f 100644 --- a/pgml-extension/src/bindings/xgboost.rs +++ b/pgml-extension/src/bindings/xgboost.rs @@ -128,7 +128,9 @@ fn get_tree_params(hyperparams: &Hyperparams) -> tree::TreeBoosterParameters { }, "max_leaves" => params.max_leaves(value.as_u64().unwrap() as u32), "max_bin" => params.max_bin(value.as_u64().unwrap() as u32), - "booster" | "n_estimators" | "boost_rounds" => &mut params, // Valid but not relevant to this section + "booster" | "n_estimators" | "boost_rounds" | "eval_metric" | "objective" => { + &mut params + } // Valid but not relevant to this section "nthread" => &mut params, "random_state" => &mut params, _ => panic!("Unknown hyperparameter {:?}: {:?}", key, value), @@ -152,6 +154,52 @@ pub fn fit_classification( ) } +fn eval_metric_from_string(name: &str) -> learning::EvaluationMetric { + match name { + "rmse" => learning::EvaluationMetric::RMSE, + "mae" => learning::EvaluationMetric::MAE, + "logloss" => learning::EvaluationMetric::LogLoss, + "merror" => learning::EvaluationMetric::MultiClassErrorRate, + "mlogloss" => learning::EvaluationMetric::MultiClassLogLoss, + "auc" => learning::EvaluationMetric::AUC, + "ndcg" => learning::EvaluationMetric::NDCG, + "ndcg-" => learning::EvaluationMetric::NDCGNegative, + "map" => learning::EvaluationMetric::MAP, + "map-" => learning::EvaluationMetric::MAPNegative, + "poisson-nloglik" => learning::EvaluationMetric::PoissonLogLoss, + "gamma-nloglik" => learning::EvaluationMetric::GammaLogLoss, + "cox-nloglik" => learning::EvaluationMetric::CoxLogLoss, + "gamma-deviance" => learning::EvaluationMetric::GammaDeviance, + "tweedie-nloglik" => learning::EvaluationMetric::TweedieLogLoss, + _ => error!("Unknown eval_metric: {:?}", name), + } +} + +fn objective_from_string(name: &str, dataset: &Dataset) -> learning::Objective { + match name { + "reg:linear" => learning::Objective::RegLinear, + "reg:logistic" => learning::Objective::RegLogistic, + "binary:logistic" => learning::Objective::BinaryLogistic, + "binary:logitraw" => learning::Objective::BinaryLogisticRaw, + "gpu:reg:linear" => learning::Objective::GpuRegLinear, + "gpu:reg:logistic" => learning::Objective::GpuRegLogistic, + "gpu:binary:logistic" => learning::Objective::GpuBinaryLogistic, + "gpu:binary:logitraw" => learning::Objective::GpuBinaryLogisticRaw, + "count:poisson" => learning::Objective::CountPoisson, + "survival:cox" => learning::Objective::SurvivalCox, + "multi:softmax" => { + learning::Objective::MultiSoftmax(dataset.num_distinct_labels.try_into().unwrap()) + } + "multi:softprob" => { + learning::Objective::MultiSoftprob(dataset.num_distinct_labels.try_into().unwrap()) + } + "rank:pairwise" => learning::Objective::RankPairwise, + "reg:gamma" => learning::Objective::RegGamma, + "reg:tweedie" => learning::Objective::RegTweedie(Some(dataset.num_distinct_labels as f32)), + _ => error!("Unknown objective: {:?}", name), + } +} + fn fit( dataset: &Dataset, hyperparams: &Hyperparams, @@ -170,14 +218,40 @@ fn fit( Some(value) => value.as_u64().unwrap(), None => 0, }; - let learning_params = learning::LearningTaskParametersBuilder::default() - .objective(objective) + let eval_metrics = match hyperparams.get("eval_metric") { + Some(metrics) => { + if metrics.is_array() { + learning::Metrics::Custom( + metrics + .as_array() + .unwrap() + .iter() + .map(|metric| eval_metric_from_string(metric.as_str().unwrap())) + .collect(), + ) + } else { + learning::Metrics::Custom(Vec::from([eval_metric_from_string( + metrics.as_str().unwrap(), + )])) + } + } + None => learning::Metrics::Auto, + }; + let learning_params = match learning::LearningTaskParametersBuilder::default() + .objective(match hyperparams.get("objective") { + Some(value) => objective_from_string(value.as_str().unwrap(), dataset), + None => objective, + }) + .eval_metrics(eval_metrics) .seed(seed) .build() - .unwrap(); + { + Ok(params) => params, + Err(e) => error!("Failed to parse learning params:\n\n{}", e), + }; // overall configuration for Booster - let booster_params = BoosterParametersBuilder::default() + let booster_params = match BoosterParametersBuilder::default() .learning_params(learning_params) .booster_type(match hyperparams.get("booster") { Some(value) => match value.as_str().unwrap() { @@ -195,7 +269,10 @@ fn fit( ) .verbose(true) .build() - .unwrap(); + { + Ok(params) => params, + Err(e) => error!("Failed to configure booster:\n\n{}", e), + }; let mut builder = TrainingParametersBuilder::default(); // number of training iterations is aliased @@ -207,7 +284,7 @@ fn fit( }, }; - let params = builder + let params = match builder // dataset to train with .dtrain(&dtrain) // optional datasets to evaluate against in each iteration @@ -215,10 +292,16 @@ fn fit( // model parameters .booster_params(booster_params) .build() - .unwrap(); + { + Ok(params) => params, + Err(e) => error!("Failed to create training parameters:\n\n{}", e), + }; // train model, and print evaluation data - let booster = Booster::train(¶ms).unwrap(); + let booster = match Booster::train(¶ms) { + Ok(booster) => booster, + Err(e) => error!("Failed to train model:\n\n{}", e), + }; Ok(Box::new(Estimator { estimator: booster })) } diff --git a/pgml-extension/src/orm/model.rs b/pgml-extension/src/orm/model.rs index 89a23888c..370ae7b02 100644 --- a/pgml-extension/src/orm/model.rs +++ b/pgml-extension/src/orm/model.rs @@ -2,6 +2,7 @@ use anyhow::{anyhow, bail, Result}; use parking_lot::Mutex; use std::collections::HashMap; use std::fmt::{Display, Error, Formatter}; +use std::num::NonZeroUsize; use std::str::FromStr; use std::sync::Arc; use std::time::Instant; @@ -962,16 +963,13 @@ impl Model { pub fn numeric_encode_features(&self, rows: &[pgrx::datum::AnyElement]) -> Vec { // TODO handle FLOAT4[] as if it were pgrx::datum::AnyElement, skipping all this, and going straight to predict let mut features = Vec::new(); // TODO pre-allocate space - let columns = &self.snapshot.columns; for row in rows { match row.oid() { pgrx_pg_sys::RECORDOID => { let tuple = unsafe { PgHeapTuple::from_composite_datum(row.datum()) }; - for index in 1..tuple.len() + 1 { - let column = &columns[index - 1]; - let attribute = tuple - .get_attribute_by_index(index.try_into().unwrap()) - .unwrap(); + for (i, column) in self.snapshot.features().enumerate() { + let index = NonZeroUsize::new(i + 1).unwrap(); + let attribute = tuple.get_attribute_by_index(index).unwrap(); match &column.statistics.categories { Some(_categories) => { let key = match attribute.atttypid { @@ -982,14 +980,14 @@ impl Model { | pgrx_pg_sys::VARCHAROID | pgrx_pg_sys::BPCHAROID => { let element: Result, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); element .unwrap() .unwrap_or(snapshot::NULL_CATEGORY_KEY.to_string()) } pgrx_pg_sys::BOOLOID => { let element: Result, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); element .unwrap() .map_or(snapshot::NULL_CATEGORY_KEY.to_string(), |k| { @@ -998,7 +996,7 @@ impl Model { } pgrx_pg_sys::INT2OID => { let element: Result, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); element .unwrap() .map_or(snapshot::NULL_CATEGORY_KEY.to_string(), |k| { @@ -1007,7 +1005,7 @@ impl Model { } pgrx_pg_sys::INT4OID => { let element: Result, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); element .unwrap() .map_or(snapshot::NULL_CATEGORY_KEY.to_string(), |k| { @@ -1016,7 +1014,7 @@ impl Model { } pgrx_pg_sys::INT8OID => { let element: Result, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); element .unwrap() .map_or(snapshot::NULL_CATEGORY_KEY.to_string(), |k| { @@ -1025,7 +1023,7 @@ impl Model { } pgrx_pg_sys::FLOAT4OID => { let element: Result, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); element .unwrap() .map_or(snapshot::NULL_CATEGORY_KEY.to_string(), |k| { @@ -1034,7 +1032,7 @@ impl Model { } pgrx_pg_sys::FLOAT8OID => { let element: Result, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); element .unwrap() .map_or(snapshot::NULL_CATEGORY_KEY.to_string(), |k| { @@ -1056,79 +1054,79 @@ impl Model { } pgrx_pg_sys::BOOLOID => { let element: Result, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); features.push( element.unwrap().map_or(f32::NAN, |v| v as u8 as f32), ); } pgrx_pg_sys::INT2OID => { let element: Result, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); features .push(element.unwrap().map_or(f32::NAN, |v| v as f32)); } pgrx_pg_sys::INT4OID => { let element: Result, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); features .push(element.unwrap().map_or(f32::NAN, |v| v as f32)); } pgrx_pg_sys::INT8OID => { let element: Result, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); features .push(element.unwrap().map_or(f32::NAN, |v| v as f32)); } pgrx_pg_sys::FLOAT4OID => { let element: Result, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); features.push(element.unwrap().map_or(f32::NAN, |v| v)); } pgrx_pg_sys::FLOAT8OID => { let element: Result, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); features .push(element.unwrap().map_or(f32::NAN, |v| v as f32)); } // TODO handle NULL to NaN for arrays pgrx_pg_sys::BOOLARRAYOID => { let element: Result>, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); for j in element.as_ref().unwrap().as_ref().unwrap() { features.push(*j as i8 as f32); } } pgrx_pg_sys::INT2ARRAYOID => { let element: Result>, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); for j in element.as_ref().unwrap().as_ref().unwrap() { features.push(*j as f32); } } pgrx_pg_sys::INT4ARRAYOID => { let element: Result>, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); for j in element.as_ref().unwrap().as_ref().unwrap() { features.push(*j as f32); } } pgrx_pg_sys::INT8ARRAYOID => { let element: Result>, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); for j in element.as_ref().unwrap().as_ref().unwrap() { features.push(*j as f32); } } pgrx_pg_sys::FLOAT4ARRAYOID => { let element: Result>, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); for j in element.as_ref().unwrap().as_ref().unwrap() { features.push(*j); } } pgrx_pg_sys::FLOAT8ARRAYOID => { let element: Result>, TryFromDatumError> = - tuple.get_by_index(index.try_into().unwrap()); + tuple.get_by_index(index); for j in element.as_ref().unwrap().as_ref().unwrap() { features.push(*j as f32); } diff --git a/pgml-extension/src/orm/snapshot.rs b/pgml-extension/src/orm/snapshot.rs index 2a665efcc..6cf6f776c 100644 --- a/pgml-extension/src/orm/snapshot.rs +++ b/pgml-extension/src/orm/snapshot.rs @@ -74,7 +74,7 @@ pub(crate) enum Encode { #[default] native, // Encode each category as the mean of the target - target_mean, + target, // Encode each category as one boolean column per category one_hot, // Encode each category as ascending integer values @@ -230,7 +230,7 @@ impl Column { target: &ndarray::ArrayView, ) { // target encode if necessary before analyzing - if self.preprocessor.encode == Encode::target_mean { + if self.preprocessor.encode == Encode::target { let categories = self.statistics.categories.as_mut().unwrap(); let mut sums = vec![0_f32; categories.len() + 1]; Zip::from(array).and(target).for_each(|&value, &target| { @@ -261,6 +261,9 @@ impl Column { statistics.mean = data.iter().sum::() / data.len() as f32; statistics.median = data[data.len() / 2]; statistics.missing = array.len() - data.len(); + if self.label && statistics.missing > 0 { + error!("The training data labels in \"{}\" contain {} NULL values. Consider filtering these values from the training data by creating a VIEW that includes a SQL filter like `WHERE {} IS NOT NULL`.", self.name, statistics.missing, self.name); + } statistics.variance = data .iter() .map(|i| { @@ -535,7 +538,7 @@ impl Snapshot { Some(preprocessor) => { let preprocessor = preprocessor.clone(); if Column::categorical_type(&pg_type) { - if preprocessor.impute == Impute::mean && preprocessor.encode != Encode::target_mean { + if preprocessor.impute == Impute::mean && preprocessor.encode != Encode::target { error!("Error initializing preprocessor for column: {:?}.\n\n You can not specify {{\"impute: mean\"}} for a categorical variable unless it is also encoded using `target_mean`, because there is no \"average\" category. `{{\"impute: mode\"}}` is valid alternative, since there is a most common category. Another option would be to encode using target_mean, and then the target mean will be imputed for missing categoricals.", name); } } else if preprocessor.encode != Encode::native { @@ -1014,7 +1017,7 @@ impl Snapshot { let value = match key.as_str() { NULL_CATEGORY_KEY => 0_f32, // NULL values are always Category 0 _ => match &column.preprocessor.encode { - Encode::target_mean | Encode::native | Encode::one_hot { .. } => len as f32, + Encode::target | Encode::native | Encode::one_hot { .. } => len as f32, Encode::ordinal(values) => match values.iter().position(|v| v == key.as_str()) { Some(i) => (i + 1) as f32, None => error!("value is not present in ordinal: {:?}. Valid values: {:?}", key, values), From e47e907a74a9246e4415d050227f189305ec1d6b Mon Sep 17 00:00:00 2001 From: Silas Marvin <19626586+SilasMarvin@users.noreply.github.com> Date: Fri, 20 Oct 2023 09:38:55 -0700 Subject: [PATCH 09/22] Added new marketing text classes (#1105) --- .../static/css/scss/base/_typography.scss | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pgml-dashboard/static/css/scss/base/_typography.scss b/pgml-dashboard/static/css/scss/base/_typography.scss index a1ffc9e23..c0f01b4ad 100644 --- a/pgml-dashboard/static/css/scss/base/_typography.scss +++ b/pgml-dashboard/static/css/scss/base/_typography.scss @@ -105,3 +105,24 @@ h6, .h6 { .text-gradient-purple { @include text-gradient($gradient-purple); } + + +.marketing-body-large { + font-size: 20px; + line-height: 26px; + color: #{$gray-200}; + @include media-breakpoint-down(md) { + font-size: 18px; + line-height: 24px; + } +} + +.marketing-body { + font-size: 18px; + line-height: 22px; + color: #{$gray-200}; + @include media-breakpoint-down(md) { + font-size: 16px; + line-height: 20px; + } +} From f25ab3fb4c978dc75fef702a1b6ca3cbf427991f Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Sat, 21 Oct 2023 00:02:55 +0000 Subject: [PATCH 10/22] GITBOOK-75: Fix crash because of empty header --- .../guides/deploying-postgresml/self-hosting/running-on-ec2.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/pgml-docs/docs/guides/deploying-postgresml/self-hosting/running-on-ec2.md b/pgml-docs/docs/guides/deploying-postgresml/self-hosting/running-on-ec2.md index d649c1745..d25c30368 100644 --- a/pgml-docs/docs/guides/deploying-postgresml/self-hosting/running-on-ec2.md +++ b/pgml-docs/docs/guides/deploying-postgresml/self-hosting/running-on-ec2.md @@ -69,5 +69,3 @@ RAIDZ1 protects against single volume failure, allowing you to replace an EBS vo A RAID configuration with 4 volumes allows up to 4x read throughput of a single volume which, in EBS terms, can produce up to 600MBps, without having to pay for additional IOPS. -#### - From 7627d4d97f50875f903a5621075a47bc22de79cb Mon Sep 17 00:00:00 2001 From: Lev Date: Fri, 20 Oct 2023 17:08:07 -0700 Subject: [PATCH 11/22] Fix crashn in docs --- pgml-dashboard/src/utils/markdown.rs | 20 +++++++++++++------ .../templates/content/playground.html | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/pgml-dashboard/src/utils/markdown.rs b/pgml-dashboard/src/utils/markdown.rs index e708c483c..ad83651d3 100644 --- a/pgml-dashboard/src/utils/markdown.rs +++ b/pgml-dashboard/src/utils/markdown.rs @@ -640,9 +640,13 @@ pub fn get_title<'a>(root: &'a AstNode<'a>) -> anyhow::Result { match &node.data.borrow().value { &NodeValue::Heading(ref header) => { if header.level == 1 { - let content = node - .first_child() - .ok_or(anyhow::anyhow!("markdown heading has no child"))?; + let content = match node.first_child() { + Some(child) => child, + None => { + warn!("markdown heading has no child"); + return Ok(false); + } + }; match &content.data.borrow().value { &NodeValue::Text(ref text) => { title = Some(text.to_owned()); @@ -703,9 +707,13 @@ pub fn get_toc<'a>(root: &'a AstNode<'a>) -> anyhow::Result> { &NodeValue::Heading(ref header) => { header_counter += 1; if header.level != 1 { - let sibling = node - .first_child() - .ok_or(anyhow::anyhow!("markdown heading has no child"))?; + let sibling = match node.first_child() { + Some(child) => child, + None => { + warn!("markdown heading has no child"); + return Ok(false); + } + }; match &sibling.data.borrow().value { &NodeValue::Text(ref text) => { links.push(TocLink::new(text, header_counter - 1).level(header.level)); diff --git a/pgml-dashboard/templates/content/playground.html b/pgml-dashboard/templates/content/playground.html index 5dc8dcebf..f90591c6a 100644 --- a/pgml-dashboard/templates/content/playground.html +++ b/pgml-dashboard/templates/content/playground.html @@ -5,7 +5,7 @@ use crate::components::inputs::text::editable_header::{EditableHeader, Headers}; use crate::components::stimulus::stimulus_target::StimulusTarget; use crate::components::stimulus::stimulus_action::StimulusAction; -use crate::components::stimulus::stimulus_action::StimulusEvents; +// use crate::components::stimulus::stimulus_action::StimulusEvents; use crate::components::inputs::select::Select; use crate::components::inputs::switch::Switch; %> From 7225d9f38e9ddd36227e3c4fcc0b843b2d926469 Mon Sep 17 00:00:00 2001 From: Lev Date: Fri, 20 Oct 2023 17:42:21 -0700 Subject: [PATCH 12/22] Add lock ability to pgml-components --- packages/cargo-pgml-components/Cargo.lock | 13 ++++- packages/cargo-pgml-components/Cargo.toml | 3 +- .../src/frontend/sass.rs | 2 - .../src/frontend/tools.rs | 10 ++++ packages/cargo-pgml-components/src/main.rs | 53 +++++++++++++++++-- 5 files changed, 74 insertions(+), 7 deletions(-) diff --git a/packages/cargo-pgml-components/Cargo.lock b/packages/cargo-pgml-components/Cargo.lock index d9e3aec63..6d6f89f31 100644 --- a/packages/cargo-pgml-components/Cargo.lock +++ b/packages/cargo-pgml-components/Cargo.lock @@ -126,7 +126,7 @@ dependencies = [ [[package]] name = "cargo-pgml-components" -version = "0.1.18-alpha.2" +version = "0.1.19" dependencies = [ "anyhow", "assert_cmd", @@ -134,6 +134,7 @@ dependencies = [ "clap", "convert_case", "env_logger", + "file-lock", "glob", "log", "md5", @@ -280,6 +281,16 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +[[package]] +name = "file-lock" +version = "2.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec788ff423b138c9c5faf201347926573b605c517fb1c5a56aa632b218bf47bb" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "filetime" version = "0.2.22" diff --git a/packages/cargo-pgml-components/Cargo.toml b/packages/cargo-pgml-components/Cargo.toml index 6b006482f..9638e05a2 100644 --- a/packages/cargo-pgml-components/Cargo.toml +++ b/packages/cargo-pgml-components/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-pgml-components" -version = "0.1.18-alpha.2" +version = "0.1.19" edition = "2021" authors = ["PostgresML "] license = "MIT" @@ -21,6 +21,7 @@ sailfish = "0.8" regex = "1" toml = "0.7" serde = { version = "1", features = ["derive"] } +file-lock = "2" [dev-dependencies] assert_cmd = "2" diff --git a/packages/cargo-pgml-components/src/frontend/sass.rs b/packages/cargo-pgml-components/src/frontend/sass.rs index d07517113..259feb584 100644 --- a/packages/cargo-pgml-components/src/frontend/sass.rs +++ b/packages/cargo-pgml-components/src/frontend/sass.rs @@ -72,8 +72,6 @@ fn cleanup_old_bundles() { /// Entrypoint. pub fn bundle() { - crate::frontend::tools::install(); - assemble_modules(); cleanup_old_bundles(); diff --git a/packages/cargo-pgml-components/src/frontend/tools.rs b/packages/cargo-pgml-components/src/frontend/tools.rs index 9b91a172f..0017fdb1a 100644 --- a/packages/cargo-pgml-components/src/frontend/tools.rs +++ b/packages/cargo-pgml-components/src/frontend/tools.rs @@ -116,3 +116,13 @@ fn install_node() { warn("installed node") } } + +pub fn debug() { + let node = unwrap_or_exit!(execute_with_nvm(Command::new("which").arg("node"))); + println!("node: {}", node.trim()); + + for tool in TOOLS { + let output = unwrap_or_exit!(execute_with_nvm(Command::new("which").arg(tool))); + println!("{}: {}", tool, output.trim()); + } +} diff --git a/packages/cargo-pgml-components/src/main.rs b/packages/cargo-pgml-components/src/main.rs index e879d2bd1..0e978fc45 100644 --- a/packages/cargo-pgml-components/src/main.rs +++ b/packages/cargo-pgml-components/src/main.rs @@ -1,8 +1,10 @@ //! A tool to assemble and bundle our frontend components. use clap::{Args, Parser, Subcommand}; +use file_lock::{FileLock, FileOptions}; use std::env::{current_dir, set_current_dir}; -use std::fs::create_dir_all; +use std::fs::{create_dir_all, File}; +use std::io::Write; use std::path::Path; #[macro_use] @@ -58,6 +60,12 @@ enum Commands { Bundle { #[arg(short, long, default_value = "false")] minify: bool, + + #[arg(short, long, default_value = "false")] + debug: bool, + + #[arg(short, long, default_value = "false")] + lock: bool, }, /// Add new elements to the project. @@ -91,7 +99,11 @@ fn main() { CargoSubcommands::PgmlComponents(pgml_commands) => { validate_project(pgml_commands.project_path); match pgml_commands.command { - Commands::Bundle { minify } => bundle(config, minify), + Commands::Bundle { + minify, + debug, + lock, + } => bundle(config, minify, debug, lock), Commands::Add(command) => match command { AddCommands::Component { name } => { crate::frontend::components::add(&Path::new(&name), pgml_commands.overwrite) @@ -131,10 +143,45 @@ fn validate_project(project_path: Option) { } /// Bundle SASS and JavaScript into neat bundle files. -fn bundle(config: Config, minify: bool) { +fn bundle(config: Config, minify: bool, debug: bool, lock: bool) { + let lock = if lock { Some(acquire_lock()) } else { None }; + + if debug { + frontend::tools::debug(); + } + + frontend::tools::install(); + + if debug { + frontend::tools::debug(); + } + frontend::sass::bundle(); frontend::javascript::bundle(config, minify); frontend::components::update_modules(); info("bundle complete"); + + if let Some(lock) = lock { + unwrap_or_exit!(lock.unlock()); + } +} + +fn acquire_lock() -> FileLock { + print!("acquiring lock..."); + unwrap_or_exit!(std::io::stdout().flush()); + + let file = "/tmp/pgml-components-lock"; + + // Create file if not exists + if !Path::new(file).exists() { + unwrap_or_exit!(File::create(file)); + } + + let options = FileOptions::new().write(true).create(true).append(true); + + let lock = unwrap_or_exit!(FileLock::lock(file, true, options)); + + info("ok"); + lock } From 55beb6b39d9bd70517c2b6f7c1650d3126a042ce Mon Sep 17 00:00:00 2001 From: Lev Date: Fri, 20 Oct 2023 17:45:37 -0700 Subject: [PATCH 13/22] Lock build dir to avoid concurrency bugs --- pgml-dashboard/build.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/pgml-dashboard/build.rs b/pgml-dashboard/build.rs index 0c9604dee..8017afafb 100644 --- a/pgml-dashboard/build.rs +++ b/pgml-dashboard/build.rs @@ -14,6 +14,7 @@ fn main() { let status = Command::new("cargo") .arg("pgml-components") .arg("bundle") + .arg("--lock") .status() .expect("failed to run 'cargo pgml-bundle'"); From 3403f25d9a67005684adac657b4bacfb4f1b8246 Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Fri, 20 Oct 2023 19:23:28 -0700 Subject: [PATCH 14/22] Fix ToC and touch up syntax highlighting (#1106) --- pgml-dashboard/src/utils/markdown.rs | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/pgml-dashboard/src/utils/markdown.rs b/pgml-dashboard/src/utils/markdown.rs index ad83651d3..0533b8b6c 100644 --- a/pgml-dashboard/src/utils/markdown.rs +++ b/pgml-dashboard/src/utils/markdown.rs @@ -3,7 +3,10 @@ use crate::{templates::docs::TocLink, utils::config}; use std::cell::RefCell; use std::collections::{HashMap, HashSet}; use std::path::{Path, PathBuf}; -use std::sync::Arc; +use std::sync::{ + atomic::{AtomicUsize, Ordering}, + Arc, +}; use aho_corasick::{AhoCorasick, AhoCorasickBuilder, MatchKind}; use anyhow::Result; @@ -13,7 +16,6 @@ use comrak::{ nodes::{Ast, AstNode, NodeValue}, parse_document, Arena, ComrakExtensionOptions, ComrakOptions, ComrakRenderOptions, }; -use convert_case::Casing; use itertools::Itertools; use lazy_static::lazy_static; use tantivy::collector::TopDocs; @@ -26,17 +28,23 @@ use url::Url; use crate::templates::docs::NavLink; use std::fmt; -pub struct MarkdownHeadings {} +pub struct MarkdownHeadings { + counter: Arc, +} impl MarkdownHeadings { pub fn new() -> Self { - Self {} + Self { + counter: Arc::new(AtomicUsize::new(0)), + } } } impl HeadingAdapter for MarkdownHeadings { fn enter(&self, meta: &HeadingMeta) -> String { - let id = meta.content.to_case(convert_case::Case::Kebab); + // let id = meta.content.to_case(convert_case::Case::Kebab); + let id = self.counter.fetch_add(1, Ordering::SeqCst); + let id = format!("header-{}", id); match meta.level { 1 => format!(r#"

"#), @@ -217,7 +225,9 @@ impl SyntaxHighlighterAdapter for SyntaxHighlighter { let code = match options.lang { "postgresql" | "sql" | "postgresql-line-nums" => { lazy_static! { - static ref SQL_KEYS: [&'static str; 66] = [ + static ref SQL_KEYS: [&'static str; 68] = [ + "PARTITION OF", + "PARTITION BY", "CASCADE", "INNER ", "ON ", @@ -285,7 +295,9 @@ impl SyntaxHighlighterAdapter for SyntaxHighlighter { "pgml.predict", "pgml.transform", ]; - static ref SQL_KEYS_REPLACEMENTS: [&'static str; 66] = [ + static ref SQL_KEYS_REPLACEMENTS: [&'static str; 68] = [ + r#"PARTITION OF"#, + r#"PARTITION BY"#, "CASCADE", "INNER ", "ON ", From bfc682bbd6de237a1c76ff62402d9433dde2f6d1 Mon Sep 17 00:00:00 2001 From: Montana Low Date: Sat, 21 Oct 2023 09:10:54 -0700 Subject: [PATCH 15/22] 2.7.12 (#1107) --- .github/workflows/ubuntu-packages-and-docker-image.yml | 2 +- .github/workflows/ubuntu-postgresml-python-package.yaml | 2 +- README.md | 2 +- packages/postgresml-dashboard/build.sh | 2 +- packages/postgresml-dashboard/release.sh | 2 +- packages/postgresml-python/build.sh | 2 +- packages/postgresml-python/release.sh | 2 +- packages/postgresml/DEBIAN/control | 2 +- packages/postgresml/build.sh | 2 +- packages/postgresml/release.sh | 2 +- packages/postgresql-pgml/release.sh | 2 +- pgml-dashboard/content/docs/guides/setup/developers.md | 2 +- .../content/docs/guides/setup/quick_start_with_docker.md | 6 +++--- pgml-dashboard/content/docs/guides/setup/v2/installation.md | 2 +- .../docs/guides/deploying-postgresml/self-hosting/pooler.md | 2 +- pgml-docs/docs/guides/developer-docs/contributing.md | 2 +- pgml-docs/docs/guides/developer-docs/installation.md | 2 +- .../docs/guides/developer-docs/quick-start-with-docker.md | 6 +++--- pgml-extension/Cargo.lock | 2 +- pgml-extension/Cargo.toml | 2 +- pgml-extension/sql/pgml--2.7.11--2.7.12.sql | 0 21 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 pgml-extension/sql/pgml--2.7.11--2.7.12.sql diff --git a/.github/workflows/ubuntu-packages-and-docker-image.yml b/.github/workflows/ubuntu-packages-and-docker-image.yml index dc94df6a2..339f356cf 100644 --- a/.github/workflows/ubuntu-packages-and-docker-image.yml +++ b/.github/workflows/ubuntu-packages-and-docker-image.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: packageVersion: - default: "2.7.10" + default: "2.7.12" jobs: # # PostgresML extension. diff --git a/.github/workflows/ubuntu-postgresml-python-package.yaml b/.github/workflows/ubuntu-postgresml-python-package.yaml index 895ad8aef..ede7a100a 100644 --- a/.github/workflows/ubuntu-postgresml-python-package.yaml +++ b/.github/workflows/ubuntu-postgresml-python-package.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: packageVersion: - default: "2.7.10" + default: "2.7.12" jobs: postgresml-python: diff --git a/README.md b/README.md index 3a34cb672..5c2bf25b9 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ docker run \ -v postgresml_data:/var/lib/postgresql \ -p 5433:5432 \ -p 8000:8000 \ - ghcr.io/postgresml/postgresml:2.7.4 \ + ghcr.io/postgresml/postgresml:2.7.12 \ sudo -u postgresml psql -d postgresml ``` diff --git a/packages/postgresml-dashboard/build.sh b/packages/postgresml-dashboard/build.sh index 97d944227..c5b524031 100644 --- a/packages/postgresml-dashboard/build.sh +++ b/packages/postgresml-dashboard/build.sh @@ -5,7 +5,7 @@ dir="/tmp/postgresml-dashboard" deb_dir="$dir/deb-build" source_dir="$dir/source" SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -export PACKAGE_VERSION=${1:-"2.7.4"} +export PACKAGE_VERSION=${1:-"2.7.12"} export GITHUB_STARS=$(curl -s "https://api.github.com/repos/postgresml/postgresml" | grep stargazers_count | cut -d : -f 2 | tr -d " " | tr -d ",") if [[ $(arch) == "x86_64" ]]; then export ARCH=amd64 diff --git a/packages/postgresml-dashboard/release.sh b/packages/postgresml-dashboard/release.sh index d530dcae0..7252068dd 100644 --- a/packages/postgresml-dashboard/release.sh +++ b/packages/postgresml-dashboard/release.sh @@ -5,7 +5,7 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) package_version="$1" if [[ -z "$package_version" ]]; then - echo "Usage: $0 " + echo "Usage: $0 " exit 1 fi diff --git a/packages/postgresml-python/build.sh b/packages/postgresml-python/build.sh index d9d5e9cd3..5b60ceaac 100644 --- a/packages/postgresml-python/build.sh +++ b/packages/postgresml-python/build.sh @@ -7,7 +7,7 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) deb_dir="/tmp/postgresml-python/deb-build" major=${1:-"14"} -export PACKAGE_VERSION=${1:-"2.7.10"} +export PACKAGE_VERSION=${1:-"2.7.12"} export PYTHON_VERSION=${2:-"3.10"} if [[ $(arch) == "x86_64" ]]; then diff --git a/packages/postgresml-python/release.sh b/packages/postgresml-python/release.sh index 8409d158a..a7c2ad95d 100644 --- a/packages/postgresml-python/release.sh +++ b/packages/postgresml-python/release.sh @@ -12,7 +12,7 @@ fi if [[ -z "$package_version" ]]; then echo "postgresml-python package build and release script" - echo "usage: $0 " + echo "usage: $0 " exit 1 fi diff --git a/packages/postgresml/DEBIAN/control b/packages/postgresml/DEBIAN/control index 86bbdf2ef..7e7daff92 100644 --- a/packages/postgresml/DEBIAN/control +++ b/packages/postgresml/DEBIAN/control @@ -3,7 +3,7 @@ Version: ${PACKAGE_VERSION} Section: database Priority: optional Architecture: all -Depends: postgresml-python (>= 2.7.10), postgresql-pgml-${PGVERSION} (>= ${PACKAGE_VERSION}) +Depends: postgresml-python (>= 2.7.12), postgresql-pgml-${PGVERSION} (>= ${PACKAGE_VERSION}) Maintainer: PostgresML Homepage: https://postgresml.org Description: PostgresML - Generative AI and Simple ML inside PostgreSQL diff --git a/packages/postgresml/build.sh b/packages/postgresml/build.sh index c52538f1b..5bef341ee 100644 --- a/packages/postgresml/build.sh +++ b/packages/postgresml/build.sh @@ -3,7 +3,7 @@ set -e SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -export PACKAGE_VERSION=${1:-"2.7.10"} +export PACKAGE_VERSION=${1:-"2.7.12"} export PGVERSION=${2:-"14"} deb_dir="/tmp/postgresml/deb-build" diff --git a/packages/postgresml/release.sh b/packages/postgresml/release.sh index 2b0b2a31f..9e1775cec 100644 --- a/packages/postgresml/release.sh +++ b/packages/postgresml/release.sh @@ -6,7 +6,7 @@ package_version="$1" if [[ -z "$package_version" ]]; then echo "postgresml package build and release script" - echo "usage: $0 " + echo "usage: $0 " exit 1 fi diff --git a/packages/postgresql-pgml/release.sh b/packages/postgresql-pgml/release.sh index 8e3118d24..7f945a79c 100644 --- a/packages/postgresql-pgml/release.sh +++ b/packages/postgresql-pgml/release.sh @@ -4,7 +4,7 @@ set -e SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) if [[ -z "${1}" ]]; then - echo "Usage: $0 " + echo "Usage: $0 " exit 1 fi diff --git a/pgml-dashboard/content/docs/guides/setup/developers.md b/pgml-dashboard/content/docs/guides/setup/developers.md index 24c3b536b..af2085299 100644 --- a/pgml-dashboard/content/docs/guides/setup/developers.md +++ b/pgml-dashboard/content/docs/guides/setup/developers.md @@ -127,7 +127,7 @@ SELECT pgml.version(); postgres=# select pgml.version(); version ------------------- - 2.7.4 + 2.7.12 (1 row) ``` diff --git a/pgml-dashboard/content/docs/guides/setup/quick_start_with_docker.md b/pgml-dashboard/content/docs/guides/setup/quick_start_with_docker.md index aa2aba667..6a8b29d76 100644 --- a/pgml-dashboard/content/docs/guides/setup/quick_start_with_docker.md +++ b/pgml-dashboard/content/docs/guides/setup/quick_start_with_docker.md @@ -18,7 +18,7 @@ docker run \ -v postgresml_data:/var/lib/postgresql \ -p 5433:5432 \ -p 8000:8000 \ - ghcr.io/postgresml/postgresml:2.7.3 \ + ghcr.io/postgresml/postgresml:2.7.12 \ sudo -u postgresml psql -d postgresml ``` @@ -44,7 +44,7 @@ docker run \ --gpus all \ -p 5433:5432 \ -p 8000:8000 \ - ghcr.io/postgresml/postgresml:2.7.3 \ + ghcr.io/postgresml/postgresml:2.7.12 \ sudo -u postgresml psql -d postgresml ``` @@ -82,7 +82,7 @@ Time: 41.520 ms postgresml=# SELECT pgml.version(); version --------- - 2.7.3 + 2.7.12 (1 row) ``` diff --git a/pgml-dashboard/content/docs/guides/setup/v2/installation.md b/pgml-dashboard/content/docs/guides/setup/v2/installation.md index 99566090d..f5df06ef6 100644 --- a/pgml-dashboard/content/docs/guides/setup/v2/installation.md +++ b/pgml-dashboard/content/docs/guides/setup/v2/installation.md @@ -135,7 +135,7 @@ CREATE EXTENSION pgml_test=# SELECT pgml.version(); version --------- - 2.7.4 + 2.7.12 (1 row) ``` diff --git a/pgml-docs/docs/guides/deploying-postgresml/self-hosting/pooler.md b/pgml-docs/docs/guides/deploying-postgresml/self-hosting/pooler.md index 5887a9220..b03a3c87c 100644 --- a/pgml-docs/docs/guides/deploying-postgresml/self-hosting/pooler.md +++ b/pgml-docs/docs/guides/deploying-postgresml/self-hosting/pooler.md @@ -115,6 +115,6 @@ Type "help" for help. postgresml=> SELECT pgml.version(); version --------- - 2.7.9 + 2.7.12 (1 row) ``` diff --git a/pgml-docs/docs/guides/developer-docs/contributing.md b/pgml-docs/docs/guides/developer-docs/contributing.md index 75aa933fa..185553788 100644 --- a/pgml-docs/docs/guides/developer-docs/contributing.md +++ b/pgml-docs/docs/guides/developer-docs/contributing.md @@ -126,7 +126,7 @@ SELECT pgml.version(); postgres=# select pgml.version(); version ------------------- - 2.7.4 + 2.7.12 (1 row) ``` diff --git a/pgml-docs/docs/guides/developer-docs/installation.md b/pgml-docs/docs/guides/developer-docs/installation.md index 3099fcc83..ee75491c9 100644 --- a/pgml-docs/docs/guides/developer-docs/installation.md +++ b/pgml-docs/docs/guides/developer-docs/installation.md @@ -133,7 +133,7 @@ CREATE EXTENSION pgml_test=# SELECT pgml.version(); version --------- - 2.7.4 + 2.7.12 (1 row) ``` diff --git a/pgml-docs/docs/guides/developer-docs/quick-start-with-docker.md b/pgml-docs/docs/guides/developer-docs/quick-start-with-docker.md index 53d623220..83d671ce0 100644 --- a/pgml-docs/docs/guides/developer-docs/quick-start-with-docker.md +++ b/pgml-docs/docs/guides/developer-docs/quick-start-with-docker.md @@ -18,7 +18,7 @@ docker run \ -v postgresml_data:/var/lib/postgresql \ -p 5433:5432 \ -p 8000:8000 \ - ghcr.io/postgresml/postgresml:2.7.3 \ + ghcr.io/postgresml/postgresml:2.7.12 \ sudo -u postgresml psql -d postgresml ``` @@ -43,7 +43,7 @@ docker run \ --gpus all \ -p 5433:5432 \ -p 8000:8000 \ - ghcr.io/postgresml/postgresml:2.7.3 \ + ghcr.io/postgresml/postgresml:2.7.12 \ sudo -u postgresml psql -d postgresml ``` @@ -80,7 +80,7 @@ Time: 41.520 ms postgresml=# SELECT pgml.version(); version --------- - 2.7.3 + 2.7.12 (1 row) ``` diff --git a/pgml-extension/Cargo.lock b/pgml-extension/Cargo.lock index aa5df2371..fa6d5ec83 100644 --- a/pgml-extension/Cargo.lock +++ b/pgml-extension/Cargo.lock @@ -1840,7 +1840,7 @@ dependencies = [ [[package]] name = "pgml" -version = "2.7.11" +version = "2.7.12" dependencies = [ "anyhow", "blas", diff --git a/pgml-extension/Cargo.toml b/pgml-extension/Cargo.toml index 722c8aa5e..4dd01e4b1 100644 --- a/pgml-extension/Cargo.toml +++ b/pgml-extension/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pgml" -version = "2.7.11" +version = "2.7.12" edition = "2021" [lib] diff --git a/pgml-extension/sql/pgml--2.7.11--2.7.12.sql b/pgml-extension/sql/pgml--2.7.11--2.7.12.sql new file mode 100644 index 000000000..e69de29bb From 5797d26a47f43e2a24ee5b075dff7d6e3d7e0c14 Mon Sep 17 00:00:00 2001 From: Montana Low Date: Sat, 21 Oct 2023 11:39:31 -0700 Subject: [PATCH 16/22] update dependencies for dashboard (#1108) --- pgml-dashboard/Cargo.lock | 235 +++++---- pgml-dashboard/Cargo.toml | 18 +- pgml-dashboard/src/main.rs | 2 +- pgml-dashboard/src/templates/head.rs | 2 +- pgml-extension/Cargo.lock | 751 +++++++++++---------------- 5 files changed, 438 insertions(+), 570 deletions(-) diff --git a/pgml-dashboard/Cargo.lock b/pgml-dashboard/Cargo.lock index 8830f565a..0c605a37d 100644 --- a/pgml-dashboard/Cargo.lock +++ b/pgml-dashboard/Cargo.lock @@ -86,9 +86,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -165,9 +165,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" dependencies = [ "backtrace", ] @@ -300,9 +300,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "bigdecimal" @@ -382,7 +382,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" dependencies = [ "memchr", - "regex-automata 0.3.3", + "regex-automata 0.3.7", "serde", ] @@ -424,17 +424,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets 0.48.1", ] [[package]] @@ -538,10 +537,11 @@ dependencies = [ [[package]] name = "console-api" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2895653b4d9f1538a83970077cb01dfc77a4810524e51a110944688e916b18e" +checksum = "fd326812b3fd01da5bb1af7d340d0d555fd3d4b641e7f1dfcf5962a902952787" dependencies = [ + "futures-core", "prost", "prost-types", "tonic", @@ -550,14 +550,14 @@ dependencies = [ [[package]] name = "console-subscriber" -version = "0.1.10" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4cf42660ac07fcebed809cfe561dd8730bcd35b075215e6479c516bcd0d11cb" +checksum = "7481d4c57092cd1c19dd541b92bdce883de840df30aa5d03fd48a3935c01842e" dependencies = [ "console-api", "crossbeam-channel", "crossbeam-utils", - "futures", + "futures-task", "hdrhistogram", "humantime", "prost-types", @@ -583,18 +583,18 @@ dependencies = [ [[package]] name = "cookie" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7efb37c3e1ccb1ff97164ad95ac1606e8ccd35b3fa0a7d99a304c7f4a428cc24" +checksum = "3cd91cf61412820176e137621345ee43b3f4423e589e7ae4e50d601d93e35ef8" dependencies = [ "aes-gcm", - "base64 0.21.2", + "base64 0.21.4", "hkdf", "percent-encoding", "rand", "sha2", "subtle", - "time 0.3.23", + "time", "version_check", ] @@ -818,6 +818,16 @@ dependencies = [ "uuid", ] +[[package]] +name = "deranged" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", + "serde", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -1314,7 +1324,7 @@ checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", ] [[package]] @@ -1614,7 +1624,6 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", - "serde", ] [[package]] @@ -1625,6 +1634,7 @@ checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ "equivalent", "hashbrown 0.14.0", + "serde", ] [[package]] @@ -1803,9 +1813,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "loom" @@ -1838,7 +1848,7 @@ dependencies = [ "md5", "nom", "rayon", - "time 0.3.23", + "time", "weezl", ] @@ -1865,9 +1875,9 @@ checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" [[package]] name = "markdown" -version = "1.0.0-alpha.13" +version = "1.0.0-alpha.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e9ce98969bb1391c8d6fdac320897ea7e86c4d356e8f220a5abd28b142e512" +checksum = "d2a51befc5a2b4a052c473ffbc9ad462e358de59dcc2fde4997fd2a16403dcbd" dependencies = [ "unicode-id", ] @@ -1984,7 +1994,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.48.0", ] @@ -2125,9 +2135,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] @@ -2399,11 +2409,11 @@ dependencies = [ [[package]] name = "pgml-dashboard" -version = "2.7.6" +version = "2.7.12" dependencies = [ "aho-corasick 0.7.20", "anyhow", - "base64 0.21.2", + "base64 0.21.4", "chrono", "comrak", "console-subscriber", @@ -2435,7 +2445,7 @@ dependencies = [ "serde_json", "sqlx", "tantivy", - "time 0.3.23", + "time", "tokio", "url", "yaml-rust", @@ -2578,12 +2588,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdc0001cfea3db57a2e24bc0d818e9e20e554b5f97fabb9bc231dc240269ae06" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "indexmap 1.9.3", "line-wrap", "quick-xml", "serde", - "time 0.3.23", + "time", ] [[package]] @@ -2624,7 +2634,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b7fa9f396f51dffd61546fd8573ee20592287996568e6175ceb0f8699ad75d" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "byteorder", "bytes", "fallible-iterator", @@ -2647,6 +2657,12 @@ dependencies = [ "postgres-protocol", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -2683,9 +2699,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.11.9" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +checksum = "f4fdd22f3b9c31b53c060df4a0613a1c7f062d4115a2b984dd15b1858f7e340d" dependencies = [ "bytes", "prost-derive", @@ -2693,22 +2709,22 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.11.9" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +checksum = "265baba7fabd416cf5078179f7d2cbeca4ce7a9041111900675ea7c4cb8a4c32" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.32", ] [[package]] name = "prost-types" -version = "0.11.9" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +checksum = "e081b29f63d83a4bc75cfc9f3fe424f9156cf92d8a4f0c9407cce9a1b67327cf" dependencies = [ "prost", ] @@ -2834,14 +2850,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.1" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" dependencies = [ - "aho-corasick 1.0.2", + "aho-corasick 1.1.2", "memchr", - "regex-automata 0.3.3", - "regex-syntax 0.7.4", + "regex-automata 0.3.7", + "regex-syntax 0.7.5", ] [[package]] @@ -2855,13 +2871,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.3" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" dependencies = [ - "aho-corasick 1.0.2", + "aho-corasick 1.1.2", "memchr", - "regex-syntax 0.7.4", + "regex-syntax 0.7.5", ] [[package]] @@ -2872,17 +2888,17 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "reqwest" -version = "0.11.20" +version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "bytes", "encoding_rs", "futures-core", @@ -2903,6 +2919,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "system-configuration", "tokio", "tokio-native-tls", "tower-service", @@ -2931,7 +2948,7 @@ dependencies = [ [[package]] name = "rocket" version = "0.5.0-rc.3" -source = "git+https://github.com/SergioBenitez/Rocket#ddeac5ddcf252d081d69f1b1cec8467ab9ec4d26" +source = "git+https://github.com/SergioBenitez/Rocket#07fe79796f058ab12683ff9e344558bece263274" dependencies = [ "async-stream", "async-trait", @@ -2941,7 +2958,7 @@ dependencies = [ "either", "figment", "futures", - "indexmap 1.9.3", + "indexmap 2.0.0", "log", "memchr", "multer", @@ -2956,7 +2973,7 @@ dependencies = [ "serde_json", "state", "tempfile", - "time 0.3.23", + "time", "tokio", "tokio-stream", "tokio-util", @@ -2968,29 +2985,30 @@ dependencies = [ [[package]] name = "rocket_codegen" version = "0.5.0-rc.3" -source = "git+https://github.com/SergioBenitez/Rocket#ddeac5ddcf252d081d69f1b1cec8467ab9ec4d26" +source = "git+https://github.com/SergioBenitez/Rocket#07fe79796f058ab12683ff9e344558bece263274" dependencies = [ "devise", "glob", - "indexmap 1.9.3", + "indexmap 2.0.0", "proc-macro2", "quote", "rocket_http", "syn 2.0.32", "unicode-xid", + "version_check", ] [[package]] name = "rocket_http" version = "0.5.0-rc.3" -source = "git+https://github.com/SergioBenitez/Rocket#ddeac5ddcf252d081d69f1b1cec8467ab9ec4d26" +source = "git+https://github.com/SergioBenitez/Rocket#07fe79796f058ab12683ff9e344558bece263274" dependencies = [ "cookie", "either", "futures", "http", "hyper", - "indexmap 1.9.3", + "indexmap 2.0.0", "log", "memchr", "pear", @@ -3001,7 +3019,7 @@ dependencies = [ "smallvec", "stable-pattern", "state", - "time 0.3.23", + "time", "tokio", "uncased", ] @@ -3107,7 +3125,7 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", ] [[package]] @@ -3458,25 +3476,25 @@ dependencies = [ "serde", "serde_json", "thiserror", - "time 0.3.23", + "time", "url", "uuid", ] [[package]] name = "serde" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", @@ -3485,9 +3503,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.103" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -3702,7 +3720,7 @@ dependencies = [ "sqlx-rt", "stringprep", "thiserror", - "time 0.3.23", + "time", "tokio-stream", "url", "uuid", @@ -3878,6 +3896,27 @@ dependencies = [ "yaml-rust", ] +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tantivy" version = "0.19.2" @@ -3925,7 +3964,7 @@ dependencies = [ "tantivy-query-grammar", "tempfile", "thiserror", - "time 0.3.23", + "time", "uuid", "winapi", ] @@ -4043,22 +4082,13 @@ dependencies = [ [[package]] name = "time" -version = "0.1.45" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ + "deranged", "itoa", + "powerfmt", "serde", "time-core", "time-macros", @@ -4066,15 +4096,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -4242,16 +4272,15 @@ dependencies = [ [[package]] name = "tonic" -version = "0.9.2" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" +checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" dependencies = [ + "async-stream", "async-trait", "axum", - "base64 0.21.2", + "base64 0.21.4", "bytes", - "futures-core", - "futures-util", "h2", "http", "http-body", @@ -4494,7 +4523,7 @@ version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b11c96ac7ee530603dcdf68ed1557050f374ce55a5a07193ebf8cbc9f8927e9" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "log", "native-tls", "once_cell", @@ -4503,9 +4532,9 @@ dependencies = [ [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -4578,12 +4607,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/pgml-dashboard/Cargo.toml b/pgml-dashboard/Cargo.toml index 2eeea9f99..fc6c2b2ee 100644 --- a/pgml-dashboard/Cargo.toml +++ b/pgml-dashboard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pgml-dashboard" -version = "2.7.6" +version = "2.7.12" edition = "2021" authors = ["PostgresML "] license = "MIT" @@ -17,20 +17,26 @@ base64 = "0.21" comrak = "0.17" chrono = "0.4" csv-async = "1" +console-subscriber = "*" convert_case = "0.6" dotenv = "0.15" env_logger = "0.10" +glob = "*" itertools = "0.10" parking_lot = "0.12" lazy_static = "1.4" log = "0.4" -markdown = "1.0.0-alpha.13" +markdown = "1.0.0-alpha.14" num-traits = "0.2" once_cell = "1.18" +pgml = { version = "0.9.4", path = "../pgml-sdks/pgml/" } +pgml-components = { path = "../packages/pgml-components" } +pgvector = { version = "0.2.2", features = [ "sqlx", "postgres" ] } rand = "0.8" regex = "1.9" +reqwest = { version = "0.11", features = ["json"] } rocket = { git = "https://github.com/SergioBenitez/Rocket", features = ["secrets", "json"] } -sailfish = "0.8" +sailfish = "0.8.0" # 0.8.1 has breaking changes scraper = "0.17" serde = "1" sentry = "0.31" @@ -44,9 +50,3 @@ tokio = { version = "1", features = ["full"] } url = "2.4" yaml-rust = "0.4" zoomies = { git="https://github.com/HyperparamAI/zoomies.git", branch="master" } -pgvector = { version = "0.2.2", features = [ "sqlx", "postgres" ] } -console-subscriber = "*" -glob = "*" -pgml-components = { path = "../packages/pgml-components" } -reqwest = { version = "0.11.20", features = ["json"] } -pgml = { version = "0.9.2", path = "../pgml-sdks/pgml/" } diff --git a/pgml-dashboard/src/main.rs b/pgml-dashboard/src/main.rs index 66abda9b2..436a41ce1 100644 --- a/pgml-dashboard/src/main.rs +++ b/pgml-dashboard/src/main.rs @@ -140,7 +140,7 @@ mod test { async fn rocket() -> Rocket { dotenv::dotenv().ok(); - pgml_dashboard::migrate(Cluster::default().pool()) + pgml_dashboard::migrate(Cluster::default(None).pool()) .await .unwrap(); diff --git a/pgml-dashboard/src/templates/head.rs b/pgml-dashboard/src/templates/head.rs index bc0df7def..27eb4e6b6 100644 --- a/pgml-dashboard/src/templates/head.rs +++ b/pgml-dashboard/src/templates/head.rs @@ -121,12 +121,12 @@ mod default_head_template_test { fn default() { let head = DefaultHeadTemplate::new(None); let rendered = head.render_once().unwrap(); + assert!( rendered.contains(r#""#) && rendered.contains(r#" – PostgresML"#) && rendered.contains(r#""#) && !rendered.contains("preload") && - rendered.contains(r#"