Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust agent and quickstarter updates of January 2025 #1088

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ jobs:
working-directory: common/jenkins-agents/rust/docker
run: |
docker build --tag agent-rust-test-ubi8 --file Dockerfile.ubi8 \
--build-arg rustVersion=1.81.0 \
--build-arg rustVersion=1.83.0 \
--build-arg rustToolchain=x86_64-unknown-linux-gnu \
--build-arg cargoNextestVersion=0.9.78 \
--build-arg cargoLlvmCovVersion=0.6.13 \
--build-arg cargoGenerateVersion=0.22.0 \
--build-arg cargoDenyVersion=0.16.1 \
--build-arg cargoNextestVersion=0.9.87 \
--build-arg cargoLlvmCovVersion=0.6.15 \
--build-arg cargoGenerateVersion=0.22.1 \
--build-arg cargoDenyVersion=0.16.3 \
.

jenkins-agent-terraform-2306-ubi8:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- Change PDF report zip file name in Cypress Quickstarter ([#1082](https://github.com/opendevstack/ods-quickstarters/pull/1082))
- Included small fixes in e2e-cypress ([#1086](https://github.com/opendevstack/ods-quickstarters/pull/1086))
- Mobile testing enablement adding Appium & Sauce Labs in e2e-spock-geb quickstarter ([#1083](https://github.com/opendevstack/ods-quickstarters/pull/1083))
- Rust Jenkins agent and Quickstarter updates of January 2025 ([#1087](https://github.com/opendevstack/ods-quickstarters/issues/1087))

### Added

Expand Down
16 changes: 6 additions & 10 deletions be-rust-axum/Jenkinsfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,13 @@ def stageCI(def context) {
mkdir -p build/test-results/test
mkdir -p build/test-results/coverage

# Tests with JUnit XML report as defined in .config/nextest.toml
cargo nextest run --profile ci

# Coverage with LLVM lcov report from tests
# generate the lcov.info report
cargo llvm-cov nextest --lcov --output-path ./build/test-results/coverage/lcov.info
# generate the html report
cargo llvm-cov nextest report --html

# Tests with JUnit XML report, as defined in .config/nextest.toml, and coverage LLVM cov report
cargo llvm-cov nextest --profile ci --lcov --output-path ./build/test-results/coverage/lcov.info
cp -r target/nextest/ci/results.xml build/test-results/test
cp -r target/llvm-cov/html/ build/test-results/coverage

# (optional) generate the html report and store it in build/test-results/coverage
# cargo llvm-cov nextest report --html
# cp -r target/llvm-cov/html/ build/test-results/coverage
"""
}
}
4 changes: 2 additions & 2 deletions be-rust-axum/rust-template/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.19.1
rev: v8.22.1
hooks:
- id: gitleaks
- repo: https://github.com/EmbarkStudios/cargo-deny
rev: 0.16.1
rev: 0.16.3
hooks:
- id: cargo-deny
args: ["--all-features", "check"] # optionally modify the arguments for cargo-deny (default arguments shown here)
Expand Down
6 changes: 3 additions & 3 deletions be-rust-axum/rust-template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"

[dependencies]
# one can add more dependencies via cargo to Cargo.toml as shown next: cargo add axum -F axum/http2
axum = { version = "0.7", features = ["http2"] }
axum = { version = "0.8", features = ["http2"] }
tokio = { version = "1.40", features = ["rt-multi-thread", "macros", "signal"] }

serde = { version = "1.0", features = ["derive"] }
Expand All @@ -19,7 +19,7 @@ http = "1.1"
http-body-util = "0.1"
bytes = "1.7"

thiserror = "1.0"
thiserror = "2.0"

tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["tracing", "env-filter"] }
Expand All @@ -31,7 +31,7 @@ dotenvy = "0.15"

# Nice HTTP middlewares from Tower crate, to be added to router.rs.
# Uncomment as per need, check official docs.
# tower-http = { version = "0.5", features = [
# tower-http = { version = "0.6", features = [
# "trace",
# "compression-br",
# "propagate-header",
Expand Down
2 changes: 1 addition & 1 deletion be-rust-axum/rust-template/deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ allow = [
"MIT",
"Apache-2.0",
"Apache-2.0 WITH LLVM-exception",
"Unicode-DFS-2016",
"Unicode-3.0",
"BSD-3-Clause",
"BSL-1.0"
]
Expand Down
2 changes: 1 addition & 1 deletion be-rust-axum/rust-template/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Axum - Rust web framework
description: "Axum is an ergonomic and modular web framework built with Tokio, Tower, and Hyper; written in Rust. Technologies: Axum 0.7.x, Rust 1.81.x"
description: "Axum is an ergonomic and modular web framework built with Tokio, Tower, and Hyper; written in Rust. Technologies: Axum 0.8.x, Rust 1.83.x"
supplier: https://github.com/tokio-rs/axum
version: 4.x
type: ods
10 changes: 5 additions & 5 deletions common/jenkins-agents/rust/ocp-config/bc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@ parameters:
- name: RUST_VERSION
description: "The Rust version"
required: true
value: "1.81.0"
value: "1.83.0"
- name: RUST_TOOLCHAIN
description: "The Rust target toolchain"
required: true
value: "x86_64-unknown-linux-gnu"
- name: CARGO_NEXTEST_VERSION
description: "The Cargo Nextest testing framework version"
required: true
value: "0.9.78"
value: "0.9.87"
- name: CARGO_LLVM_COV_VERSION
description: "The Cargo LLVM Coverage tool version"
required: true
value: "0.6.13"
value: "0.6.15"
- name: CARGO_GENERATE_VERSION
description: "The Cargo Generate tool version"
required: true
value: "0.22.0"
value: "0.22.1"
- name: CARGO_DENY_VERSION
description: "The Cargo Deny tool version"
required: true
value: "0.16.1"
value: "0.16.3"
objects:
- apiVersion: build.openshift.io/v1
kind: BuildConfig
Expand Down
3 changes: 2 additions & 1 deletion docs/modules/jenkins-agents/pages/rust.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This agent is used to build / execute Rust code and tools.
The image is built in the global `ods` project and is named `jenkins-agent-rust`.
It can be referenced in a `Jenkinsfile` with `ods/jenkins-agent-rust`.

Minimum Supported Rust Version (MSRV) **1.79**. It can build **Rust** versions **1.79.x or higher**.
Minimum Supported Rust Version (MSRV) **1.83**.

**NOTE**: Current Rust edition in use is **2021**. See https://doc.rust-lang.org/edition-guide/introduction.html[Rust Edition Guide] for further information.

Expand All @@ -20,3 +20,4 @@ Minimum Supported Rust Version (MSRV) **1.79**. It can build **Rust** versions *

== Known limitations
No special HTTP Proxy configuration.
Fixed Rust compiler version (although dependending on specific project's dependencies, it can build on lower or higher Minor **Rust** versions from **1.83.x**).
12 changes: 7 additions & 5 deletions docs/modules/quickstarters/pages/be-rust-axum.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ It contains the basic setup for Docker, Jenkins, SonarQube and OpenShift.

== Frameworks used

* https://www.rust-lang.org/[Rust 1.81.x]
* https://github.com/tokio-rs/axum[Axum 0.7.x]
* https://www.rust-lang.org/[Rust 1.83.x]
* https://github.com/tokio-rs/axum[Axum 0.8.x]
* https://nexte.st/[Nextest 0.9.x]
* https://github.com/taiki-e/cargo-llvm-cov/[LLVM coverage 0.6.x]
* https://github.com/EmbarkStudios/cargo-deny/[Deny 0.16.x]

== Usage - how do you start after you provisioned this quickstarter

Expand Down Expand Up @@ -136,7 +138,7 @@ version: 1.0.1
type: ods
role: backend
runtime: rust
runtimeVersion: 1.81.0
runtimeVersion: 1.83.0
```

== How this quickstarter is built through Jenkins
Expand Down Expand Up @@ -176,7 +178,7 @@ The Jenkinsfile is provisioned with this quick starter to ease CI/CD process. In
[source,bash]
----
cargo nextest run --profile ci
cargo llvm-cov nextest --lcov
cargo llvm-cov nextest --profile ci --lcov
----

* *Build* - Builds the release target binary and moves it to the docker folder:
Expand All @@ -192,7 +194,7 @@ include::partials$secret-scanning-with-gitleaks.adoc

This quickstarter uses https://www.opendevstack.org/ods-documentation/opendevstack/latest/jenkins-agents/rust.html[Rust] Jenkins builder agent.

**NOTE**: The ODS Jenkins Rust Agent supports Rust versions 1.75.x and above.
**NOTE**: The ODS Jenkins Rust Agent supports Rust versions 1.83.x, and depending on project's dependencies it can also handle Minor Rust versions above and below the supported one.

See the docker spec and openshift templates https://github.com/opendevstack/ods-quickstarters/tree/master/common/jenkins-agents/rust[here].

Expand Down
Loading