Skip to content

Commit

Permalink
Add a composefs Rust crate
Browse files Browse the repository at this point in the history
Right now this includes just a parser/generator for dump files,
which is helpful for e.g. a flow like taking a tarball, parsing
it in Rust, and then serializing the entry to a composefs dumpfile line.

I'd like to add more opinionated and advanced functionality
related to composefs implemented in this crate - *especially* integration
with containers/OCI.  My thought is that in the short term we can
publish this crate without having the core
C code depend on it.

I plan to use this crate in bootc.

However, more medium term, it may make sense to offer a CLI
tool from this crate, in which case there will be some tension with
the CLI tools that happen to be implemented in C, as commonly
people would

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed May 28, 2024
1 parent 650aa59 commit 9729b45
Show file tree
Hide file tree
Showing 7 changed files with 703 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Inspired by https://github.com/rust-analyzer/rust-analyzer/blob/master/.github/workflows/ci.yaml
# but tweaked in several ways. If you make changes here, consider doing so across other
# repositories in e.g. ostreedev etc.
name: Rust

permissions:
actions: read

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch: {}

env:
CARGO_TERM_COLOR: always

jobs:
tests:
runs-on: ubuntu-latest
container: quay.io/coreos-assembler/fcos-buildroot:testing-devel
steps:
- uses: actions/checkout@v3
# xref containers/containers-image-proxy-rs
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
with:
key: "tests"
- name: cargo fmt (check)
run: cargo fmt -- --check -l
- name: Build
run: cargo test --no-run
- name: Run tests
run: cargo test -- --nocapture --quiet
cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
log-level: warn
command: check bans sources licenses
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ composefs.spec
libtool
ltmain.sh
missing
target/
Cargo.lock
27 changes: 27 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "composefs"
version = "0.1.0"
edition = "2021"
description = "Rust composefs"
keywords = ["composefs", "oci", "opencontainers", "docker", "podman"]
license = "MIT"
repository = "https://github.com/containers/composefs"
rust-version = "1.70.0"

include = [
"/COPYING",
"/README.md",
"/rust/**",
]

[lib]
name = "composefs"
path = "rust/src/lib.rs"

[dependencies]
anyhow = "1.0"
libc = "0.2"

[dev-dependencies]
tar = "0.4.38"
tempfile = "3.2.0"
10 changes: 10 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[licenses]
unlicensed = "deny"
allow = ["Apache-2.0", "Apache-2.0 WITH LLVM-exception", "MIT", "BSD-3-Clause", "BSD-2-Clause", "Unicode-DFS-2016"]

[bans]

[sources]
unknown-registry = "deny"
unknown-git = "deny"
allow-git = []
Loading

0 comments on commit 9729b45

Please sign in to comment.