Skip to content

Commit

Permalink
Fix Rust deployment (#1932)
Browse files Browse the repository at this point in the history
* Use rustup to manage the rust version for the rust deployment workflow

* Handle converting four-component versions to semver by use of a pre-release version component

* Update Dockerfile

* Upgrade runner

* Try revert build and deploy since the config is now in Dockerfile

---------

Co-authored-by: Chang Liu <liuc223@gmail.com>
  • Loading branch information
benjaminwinger and mewim committed Aug 15, 2023
1 parent b0bbb09 commit 9529003
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
13 changes: 9 additions & 4 deletions scripts/dockerized-ci-tests-runner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@ ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils curl ca-certificates apt-transport-https gnupg software-properties-common
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get update && apt-get install -y g++ gcc clang-14 python3-dev python3-pip python-is-python3 cmake nodejs jq curl sudo git clang-format-11 lsb-release wget lcov libssl-dev libcurl4-openssl-dev rustfmt rustc cargo openjdk-17-jdk
RUN apt-get update && apt-get install -y g++ gcc clang-14 python3-dev python3-pip python-is-python3 cmake nodejs jq curl sudo git clang-format-11 lsb-release wget lcov libssl-dev libcurl4-openssl-dev openjdk-17-jdk

ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
RUN useradd --create-home runner
USER runner

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-update-default-toolchain
ENV PATH="/home/runner/.cargo/bin:${PATH}"
RUN /home/runner/.cargo/bin/rustup toolchain install 1.67


RUN mkdir /home/runner/actions-runner
WORKDIR /home/runner/actions-runner
RUN curl -o actions-runner-linux-x64-2.306.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.306.0/actions-runner-linux-x64-2.306.0.tar.gz
RUN echo "b0a090336f0d0a439dac7505475a1fb822f61bbb36420c7b3b3fe6b1bdc4dbaa actions-runner-linux-x64-2.306.0.tar.gz" | shasum -a 256 -c
RUN tar xzf ./actions-runner-linux-x64-2.306.0.tar.gz
RUN curl -o actions-runner-linux-x64-2.307.1.tar.gz -L https://github.com/actions/runner/releases/download/v2.307.1/actions-runner-linux-x64-2.307.1.tar.gz
RUN echo "038c9e98b3912c5fd6d0b277f2e4266b2a10accc1ff8ff981b9971a8e76b5441 actions-runner-linux-x64-2.307.1.tar.gz" | shasum -a 256 -c
RUN tar xzf ./actions-runner-linux-x64-2.307.1.tar.gz

COPY --chown=runner:runner start.sh start.sh
RUN chmod +x start.sh
Expand Down
9 changes: 7 additions & 2 deletions tools/rust_api/update_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ def get_kuzu_version():
with open(cmake_file) as f:
for line in f:
if line.startswith("project(Kuzu VERSION"):
return line.split(" ")[2].strip()
version = line.split(" ")[2].strip()
# Make version semver-compatible
components = version.split(".")
if len(components) >= 4:
version = ".".join(components[0:3]) + "-" + ".".join(components[3:])
return version


if __name__ == "__main__":
Expand All @@ -38,5 +43,5 @@ def get_kuzu_version():
break

if version_changed:
with open("Cargo.toml", "w", encoding="utf-8") as file:
with open(KUZU_RS_ROOT / "Cargo.toml", "w", encoding="utf-8") as file:
file.writelines(data)

0 comments on commit 9529003

Please sign in to comment.