From ff8f7a7718a8234869250c456d962740b61c1b61 Mon Sep 17 00:00:00 2001 From: Tobias Brandt Date: Tue, 18 Oct 2022 22:30:00 +0200 Subject: [PATCH 1/5] Improves installation instructions in README.md --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7bd832e..e6a059c 100644 --- a/README.md +++ b/README.md @@ -56,10 +56,16 @@ Binaries are built for Windows, macOS and Linux for every release and can be dowloaded from [Releases](https://github.com/prql/prql-query/releases/) ([latest](https://github.com/prql/prql-query/releases/latest)). +For example on linux you could download and install `pq` with: + + VERSION=v0.0.11 wget https://github.com/prql/prql-query/releases/download/$VERSION/pq-x86_64-unknown-linux-gnu.tar.gz && \ + tar xvzf pq-x86_64-unknown-linux-gnu.tar.gz --directory ~/.local/bin && \ + rm pq-x86_64-unknown-linux-gnu.tar.gz + ### Run as a container image (Docker) - docker pull ghcr.io/prql/prql-query:v0.0.11 - alias pq="docker run --rm -it -v $(pwd):/data -w /data -u $(id -u):$(id -g) ghcr.io/prql/prql-query:v0.0.11" + docker pull ghcr.io/prql/prql-query + alias pq="docker run --rm -it -v $(pwd):/data -w /data -u $(id -u):$(id -g) ghcr.io/prql/prql-query" pq --help ### Via Rust toolchain (Cargo) From 0d2353607579654bf036d48fac968cd0b79b93a2 Mon Sep 17 00:00:00 2001 From: Tobias Brandt Date: Sun, 23 Oct 2022 08:23:24 +0200 Subject: [PATCH 2/5] Updates Dockerfile to build from crates.io instead of local working directory --- .github/workflows/release.yaml | 1 + Dockerfile | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c9b0e37..d45fb22 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -62,6 +62,7 @@ jobs: publish-gh-package: runs-on: ubuntu-latest + needs: publish-to-crates-io permissions: contents: read packages: write diff --git a/Dockerfile b/Dockerfile index 63738f6..86af94b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,9 @@ ARG RUST_VERSION=1.64.0-slim-buster ARG DEBIAN_VERSION=stable-slim -# --- crates_io --- -# Once we have pq published on crates.io we can use this -#FROM rust:$RUST_VERSION AS crates_io -#ARG PQ_VERSION -#RUN cargo install pq --version $PQ_VERSION - -# --- build --- FROM rust:$RUST_VERSION AS build + +# --- build-requirements --- RUN apt-get -yq update \ && apt install -y \ build-essential \ @@ -16,13 +11,20 @@ RUN apt-get -yq update \ libclang-dev \ && rm -rf /var/lib/apt/lists/* -WORKDIR /app -COPY . . -RUN cargo build --release +# --- build from workdir --- +#WORKDIR /app +#COPY . . +#RUN cargo build --release && \ +# mv -v /app/target/release/pq /usr/local/cargo/bin/ + +# --- build from crates.io --- +#ARG PQ_VERSION +#RUN cargo install prql-query --version $PQ_VERSION +RUN cargo install prql-query # --- image --- FROM debian:$DEBIAN_VERSION WORKDIR /data -COPY --from=build /app/target/release/pq /usr/local/bin/pq +COPY --from=build /usr/local/cargo/bin/pq /usr/local/bin/pq ENTRYPOINT ["pq"] From 30fc9591b38e4fcc6184d20c96d890092f1950a5 Mon Sep 17 00:00:00 2001 From: Tobias Brandt Date: Mon, 24 Oct 2022 21:47:13 +0200 Subject: [PATCH 3/5] Set HOME=/tmp so that .duckdb extensions can be installed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e6a059c..ebd0b81 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ For example on linux you could download and install `pq` with: ### Run as a container image (Docker) docker pull ghcr.io/prql/prql-query - alias pq="docker run --rm -it -v $(pwd):/data -w /data -u $(id -u):$(id -g) ghcr.io/prql/prql-query" + alias pq="docker run --rm -it -v $(pwd):/data -e HOME=/tmp -u $(id -u):$(id -g) ghcr.io/prql/prql-query" pq --help ### Via Rust toolchain (Cargo) From da96f00d7cb563749cf604039a2228f8976f0736 Mon Sep 17 00:00:00 2001 From: Tobias Brandt Date: Mon, 24 Oct 2022 21:53:00 +0200 Subject: [PATCH 4/5] Updates CHANGELOG --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42b94e7..a1e0462 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # pq Changelog +## 0.0.12 - Unreleased + +* Fixed Docker alias command. +* Fixed spaces in table aliases issue. + ## 0.0.11 - 2022-10-18 * Fixed metadata step in Github action. From 4eda4bdb7a416d3ae549bc6937aea35ccacd699c Mon Sep 17 00:00:00 2001 From: Tobias Brandt Date: Mon, 24 Oct 2022 22:55:40 +0200 Subject: [PATCH 5/5] Bumps version to 0.0.12 --- CHANGELOG.md | 2 +- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1e0462..9f052ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # pq Changelog -## 0.0.12 - Unreleased +## 0.0.12 - 2022-10-24 * Fixed Docker alias command. * Fixed spaces in table aliases issue. diff --git a/Cargo.lock b/Cargo.lock index 5133547..0f7e596 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2441,7 +2441,7 @@ dependencies = [ [[package]] name = "prql-query" -version = "0.0.11" +version = "0.0.12" dependencies = [ "anyhow", "arrow 23.0.0", diff --git a/Cargo.toml b/Cargo.toml index 3abb2c5..26c70db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ repository = "https://github.com/prql/prql-query" license = "MIT OR Apache-2.0" edition = "2021" rust-version = "1.64.0" -version = "0.0.11" +version = "0.0.12" [[bin]] name = "pq"