Skip to content

Commit

Permalink
Begin work on a logrotate filesystem (#1034)
Browse files Browse the repository at this point in the history
### What does this PR do?

This commit starts a series of work that is intended to end in our
first user-defined generator, a FUSE version of our logrotate
file-gen. Although this UDG is bundled in-project I'll puruse an
independent interface and build it in a separate container, eventually,
adding the mechanism in lading for a UDG to be run.

### Additional Notes

I may eventually migrate `logrotate_rs` into a separate crate. For now
it was convenient to build it in the `lading` crate.
  • Loading branch information
blt authored Oct 28, 2024
1 parent fa03739 commit 35a65a9
Show file tree
Hide file tree
Showing 9 changed files with 797 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .github/actions/install-fuse/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'Install FUSE'
description: 'Installs FUSE on the runner OS'
runs:
using: 'composite'
steps:
- run: |
if [ "${{ runner.os }}" == "Linux" ]; then
sudo apt-get update && sudo apt-get install -y fuse3 libfuse3-dev
elif [ "${{ runner.os }}" == "macOS" ]; then
brew install macfuse
fi
shell: bash
16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ jobs:
include:
- tool: check
protobuf: true
fuse: true
components: ""
command: cargo check
- tool: fmt
protobuf: true
fuse: true
components: "rustfmt"
command: cargo fmt --all -- --check
- tool: clippy
protobuf: true
fuse: true
components: "clippy"
command: cargo clippy --all-features
steps:
Expand All @@ -35,6 +38,9 @@ jobs:
- name: Install Protobuf
if: matrix.protobuf
uses: ./.github/actions/install-protobuf
- name: Install FUSE
if: matrix.fuse
uses: ./.github/actions/install-fuse
- name: Run ${{ matrix.tool }}
run: ${{ matrix.command }}

Expand All @@ -52,6 +58,8 @@ jobs:
- uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10
- name: Install Protobuf
uses: ./.github/actions/install-protobuf
- name: Install FUSE
uses: ./.github/actions/install-fuse
- name: Install nextest
uses: taiki-e/install-action@49be99c627fae102cb8c86414e9605869641782a # nextest
- run: cargo nextest run
Expand All @@ -64,6 +72,8 @@ jobs:
- uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10
- name: Install Protobuf
uses: ./.github/actions/install-protobuf
- name: Install FUSE
uses: ./.github/actions/install-fuse
- run: cargo test -p sheepdog
timeout-minutes: 30

Expand All @@ -79,6 +89,8 @@ jobs:
- uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10
- name: Install Protobuf
uses: ./.github/actions/install-protobuf
- name: Install FUSE
uses: ./.github/actions/install-fuse
- name: Install kani
run: cargo install kani-verifier
- run: cargo kani --solver cadical
Expand All @@ -96,6 +108,8 @@ jobs:
- uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10
- name: Install Protobuf
uses: ./.github/actions/install-protobuf
- name: Install FUSE
uses: ./.github/actions/install-fuse
- name: Install nextest
uses: taiki-e/install-action@49be99c627fae102cb8c86414e9605869641782a # nextest
- run: RUSTFLAGS="--cfg loom" cargo nextest run --release
Expand Down Expand Up @@ -172,4 +186,4 @@ jobs:
actions: ".github/actions"
dockerfiles: ""
fail_on_unpinned: true
open_pr: false
open_pr: false
26 changes: 26 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM docker.io/rust:1.81.0-bullseye AS builder

RUN apt-get update && apt-get install -y \
protobuf-compiler \
protobuf-compiler fuse3 libfuse3-dev \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app
Expand Down
1 change: 1 addition & 0 deletions lading/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ flate2 = { version = "1.0.34", default-features = false, features = [
"rust_backend",
] }
futures = "0.3.31"
fuser = "0.14"
http = "0.2"
http-serde = "1.1"
hyper = { version = "0.14", features = ["client"] }
Expand Down
Loading

0 comments on commit 35a65a9

Please sign in to comment.