Skip to content

Commit

Permalink
Merge pull request #1098 from Luap99/msrv
Browse files Browse the repository at this point in the history
define MSRV and check for it in CI
  • Loading branch information
openshift-merge-bot[bot] authored Oct 15, 2024
2 parents be33bb4 + 08333ad commit d02a620
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 25 deletions.
25 changes: 6 additions & 19 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,30 +224,18 @@ meta_task:
clone_script: &noop mkdir -p $CIRRUS_WORKING_DIR # source not needed
script: /usr/local/bin/entrypoint.sh

ubuntu20_build_task:
alias: ubuntu20_build
msrv_build_task:
alias: msrv_build
depends_on:
- "build"
gce_instance: *standard_gce_x86_64
container:
cpu: 2 # Do not increase, will result in scheduling delays
memory: "8Gb"
image: quay.io/libpod/ubuntu20rust
# When bumping the image always remember to update the README MSRV as well.
image: quay.io/libpod/nv-rust:1.76
script:
- cargo build


centos9_build_task:
alias: centos9_build
depends_on:
- "build"
gce_instance: *standard_gce_x86_64
container:
cpu: 2 # Do not increase, will result in scheduling delays
memory: "8Gb"
image: quay.io/libpod/centos9rust
script:
- cargo build
- make build


success_task:
Expand All @@ -263,8 +251,7 @@ success_task:
- "integration"
- "integration_aarch64"
- "meta"
- "ubuntu20_build"
- "centos9_build"
- "msrv_build"
gce_instance: *standard_gce_x86_64
env:
API_URL_BASE: "https://api.cirrus-ci.com/v1/artifact/build/${CIRRUS_BUILD_ID}"
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ Netavark is a tool for configuring networking for Linux containers. Its features
- [Podman](https://podman.io/docs) 4.0+
- [protoc](https://grpc.io/docs/protoc-installation/)

## MSRV (Minimum Supported Rust Version)

v1.76

We test that Netavark can be build on this Rust version and on some newer versions.
All newer versions should also build, and if they do not, the issue should be
reported and will be fixed. Older versions are not guaranteed to build and issues
will not be fixed.

## Build

```console
Expand Down
2 changes: 0 additions & 2 deletions contrib/container_images/Dockerfile.CentOS9

This file was deleted.

2 changes: 0 additions & 2 deletions contrib/container_images/Dockerfile.Fedora

This file was deleted.

4 changes: 4 additions & 0 deletions contrib/container_images/Dockerfile.Rust
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Source for quay.io/libpod/nv-rust
# This version should always match the MSRV, when you update this also update the version in the root README.md.
FROM docker.io/library/rust:1.76
RUN apt-get update && apt-get -y install protobuf-compiler libprotobuf-dev
2 changes: 0 additions & 2 deletions contrib/container_images/Dockerfile.UbuntuLatest

This file was deleted.

9 changes: 9 additions & 0 deletions contrib/container_images/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Rust image

The point of this image is to verify the MSRV in CI so we can catch if a code or dependency change bumped the MSRV.
If this is acceptable then update the version in the Dockerfile.Rust FROM line then build the new image see below.

# Build and publish rust image

Make sure you have valid `quay.io/libpod` credentials in order to push the image there.
Then run the script `build_and_publish_rust_image.sh` to build and push it.
19 changes: 19 additions & 0 deletions contrib/container_images/build_and_publish_rust_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -e

PODMAN=${PODMAN:-podman}
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
DOCKERFILE="$(dirname "${BASH_SOURCE[0]}")/Dockerfile.Rust"

# get the tag from the Dockerfile so we do not duplicate it
TAG=$(awk -F':' '/FROM/{print $NF}' $DOCKERFILE)
if [[ -z "$TAG" ]]; then
echo "Empty tag in $DOCKERFILE; the tag must specify the rust version to use" >&2
exit 1
fi

FULL_IMAGE_NAME="quay.io/libpod/nv-rust:$TAG"

$PODMAN build -t $FULL_IMAGE_NAME -f $DOCKERFILE
$PODMAN push $FULL_IMAGE_NAME

1 comment on commit d02a620

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podman-next COPR build failed. @containers/packit-build please check.

Please sign in to comment.