Skip to content

Commit 63411a0

Browse files
authored
feat: refactor encoderfile core -> encoderfile (#216)
## Description This PR merges `encoderfile-core` into `encoderfile`, as discussed in #215. ### Changes * Moved all functionality from `encoderfile-core` into the main `encoderfile` crate * Feature-gated the build CLI and related dependencies * Removed the standalone `encoderfile-core` crate * Updated and simplified GitHub workflows to reflect the new crate layout Additionally: - Switched from deprecated `instrumentation` mode to `simulation` mode as described in #191 - Commented out cargo caching for ci workflow to avoid out-of-storage errors in gh workflows ### Rationale The original separation existed to support on-the-fly Rust project generation and compilation during encoderfile builds. Since encoderfile builds are now pure packaging steps over prebuilt artifacts, this split no longer provides meaningful benefits and adds unnecessary complexity. Merging the crates improves symmetry between library and CLI use cases, reduces maintenance overhead, and simplifies the build and release pipeline. **This PR is _not_ a final refactor of `encoderfile` and more breaking changes will be coming soon.**
1 parent 89ae444 commit 63411a0

File tree

136 files changed

+400
-533
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+400
-533
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[env]
22

3-
RUST_LOG = "info,tower_http=debug,ort=warn,encoderfile_core=debug,encoderfile=debug"
3+
RUST_LOG = "info,tower_http=debug,ort=warn,encoderfile=debug"

.github/workflows/ci.yml

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,29 @@ jobs:
3333
steps:
3434
- uses: actions/checkout@v4
3535

36-
- name: Cache cargo
37-
uses: actions/cache@v4
38-
with:
39-
path: |
40-
~/.cargo/registry
41-
~/.cargo/git
42-
target
43-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
36+
# - name: Cache cargo
37+
# uses: actions/cache@v4
38+
# with:
39+
# path: |
40+
# ~/.cargo/registry
41+
# ~/.cargo/git
42+
# target
43+
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
4444

45-
- name: Cargo clean if target too large
46-
run: make clean
45+
# - name: Cargo clean if target too large
46+
# run: make clean
4747

4848
- name: Cache uv
4949
uses: actions/cache@v4
5050
with:
5151
path: ~/.cache/uv
5252
key: ${{ runner.os }}-uv-${{ hashFiles('pyproject.toml') }}
5353

54-
- name: Cache cargo binaries
55-
uses: actions/cache@v4
56-
with:
57-
path: ~/.cargo/bin
58-
key: ${{ runner.os }}-cargo-bins
54+
# - name: Cache cargo binaries
55+
# uses: actions/cache@v4
56+
# with:
57+
# path: ~/.cargo/bin
58+
# key: ${{ runner.os }}-cargo-bins
5959

6060
- name: Project setup
6161
uses: ./.github/actions/project-setup
@@ -72,7 +72,7 @@ jobs:
7272
- name: Run the benchmarks
7373
uses: CodSpeedHQ/action@v4
7474
with:
75-
mode: instrumentation
75+
mode: simulation
7676
run: cargo codspeed run
7777
token: ${{ secrets.CODSPEED_TOKEN }}
7878

@@ -82,29 +82,29 @@ jobs:
8282
steps:
8383
- uses: actions/checkout@v4
8484

85-
- name: Cache cargo
86-
uses: actions/cache@v4
87-
with:
88-
path: |
89-
~/.cargo/registry
90-
~/.cargo/git
91-
target
92-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
85+
# - name: Cache cargo
86+
# uses: actions/cache@v4
87+
# with:
88+
# path: |
89+
# ~/.cargo/registry
90+
# ~/.cargo/git
91+
# target
92+
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
9393

94-
- name: Cargo clean if target too large
95-
run: make clean
94+
# - name: Cargo clean if target too large
95+
# run: make clean
9696

9797
- name: Cache uv
9898
uses: actions/cache@v4
9999
with:
100100
path: ~/.cache/uv
101101
key: ${{ runner.os }}-uv-${{ hashFiles('pyproject.toml') }}
102102

103-
- name: Cache cargo binaries
104-
uses: actions/cache@v4
105-
with:
106-
path: ~/.cargo/bin
107-
key: ${{ runner.os }}-cargo-bins
103+
# - name: Cache cargo binaries
104+
# uses: actions/cache@v4
105+
# with:
106+
# path: ~/.cargo/bin
107+
# key: ${{ runner.os }}-cargo-bins
108108

109109
- name: Project setup
110110
uses: ./.github/actions/project-setup
@@ -134,29 +134,29 @@ jobs:
134134
steps:
135135
- uses: actions/checkout@v4
136136

137-
- name: Cache cargo
138-
uses: actions/cache@v4
139-
with:
140-
path: |
141-
~/.cargo/registry
142-
~/.cargo/git
143-
target
144-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
137+
# - name: Cache cargo
138+
# uses: actions/cache@v4
139+
# with:
140+
# path: |
141+
# ~/.cargo/registry
142+
# ~/.cargo/git
143+
# target
144+
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
145145

146-
- name: Cargo clean if target too large
147-
run: make clean
146+
# - name: Cargo clean if target too large
147+
# run: make clean
148148

149149
- name: Cache uv
150150
uses: actions/cache@v4
151151
with:
152152
path: ~/.cache/uv
153153
key: ${{ runner.os }}-uv-${{ hashFiles('pyproject.toml') }}
154154

155-
- name: Cache cargo binaries
156-
uses: actions/cache@v4
157-
with:
158-
path: ~/.cargo/bin
159-
key: ${{ runner.os }}-cargo-bins
155+
# - name: Cache cargo binaries
156+
# uses: actions/cache@v4
157+
# with:
158+
# path: ~/.cargo/bin
159+
# key: ${{ runner.os }}-cargo-bins
160160

161161
- name: Project setup
162162
uses: ./.github/actions/project-setup

.github/workflows/release.yml

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ jobs:
6565
VERSION=$(
6666
cargo metadata --no-deps --format-version=1 \
6767
| jq -r '.packages[]
68-
| select(.name == "encoderfile-core")
68+
| select(.name == "encoderfile")
6969
| .version'
7070
)
7171
72-
[ -n "$VERSION" ] || { echo "encoderfile-core not found"; exit 1; }
72+
[ -n "$VERSION" ] || { echo "encoderfile not found"; exit 1; }
7373
7474
# 3) Determine prerelease type from PR labels
7575
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'beta') }}" == "true" ]] || \
@@ -94,28 +94,8 @@ jobs:
9494
git push origin "v${VERSION}"
9595
fi
9696
97-
publish-encoderfile-core:
98-
needs: create-tag
99-
runs-on: ubuntu-24.04
100-
steps:
101-
- uses: actions/checkout@v4
102-
103-
- name: Project setup
104-
uses: ./.github/actions/project-setup
105-
106-
- name: Publish encoderfile-core (dry-run)
107-
run: cargo publish -p encoderfile-core --dry-run
108-
109-
- name: Publish encoderfile-core
110-
env:
111-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
112-
run: cargo publish -p encoderfile-core
113-
114-
- name: Wait for crates.io index
115-
run: sleep 30
116-
11797
publish-encoderfile:
118-
needs: publish-encoderfile-core
98+
needs: create-tag
11999
runs-on: ubuntu-24.04
120100
steps:
121101
- uses: actions/checkout@v4

.github/workflows/version.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ jobs:
7979
run: |
8080
VERSION=$(cargo metadata --no-deps --format-version=1 \
8181
| jq -r '.packages[]
82-
| select(.name == "encoderfile-core")
82+
| select(.name == "encoderfile")
8383
| .version')
8484
85-
[ -n "$VERSION" ] || { echo "encoderfile-core not found"; exit 1; }
85+
[ -n "$VERSION" ] || { echo "encoderfile not found"; exit 1; }
8686
8787
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
8888
@@ -115,10 +115,10 @@ jobs:
115115
run: |
116116
VERSION=$(cargo metadata --no-deps --format-version=1 \
117117
| jq -r '.packages[]
118-
| select(.name == "encoderfile-core")
118+
| select(.name == "encoderfile")
119119
| .version')
120120
121-
[ -n "$VERSION" ] || { echo "encoderfile-core not found"; exit 1; }
121+
[ -n "$VERSION" ] || { echo "encoderfile not found"; exit 1; }
122122
123123
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
124124

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"Cargo.toml"
77
],
88
"rust-analyzer.workspace.symbol.search.scope": "workspace",
9+
"rust-analyzer.check.features": "all",
910
"yaml.schemas": {
1011
"https://squidfunk.github.io/mkdocs-material/schema.json": "mkdocs.yml"
1112
},

Cargo.lock

Lines changed: 10 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[workspace]
22
resolver = "3"
33

4-
members = [ "encoderfile","encoderfile-core", "encoderfile-runtime", "encoderfile-utils"]
4+
members = ["encoderfile", "encoderfile-runtime"]
55

66
[workspace.dependencies]
77
anyhow = "1.0.100"
@@ -11,7 +11,7 @@ rand = "0.9.2"
1111
schemars = "1.1.0"
1212
serde_json = "1.0.145"
1313
ndarray = "0.16.1"
14-
serde = { version = "1.0.228", features = [ "serde_derive",] }
14+
serde = { version = "1.0.228", features = ["serde_derive"] }
1515
tracing = "0.1.41"
1616
thiserror = "2.0.17"
1717

@@ -23,11 +23,11 @@ version = "0.22.1"
2323

2424
[workspace.dependencies.ort]
2525
version = "=2.0.0-rc.10"
26-
features = [ "std", "tracing", "ndarray",]
26+
features = ["std", "tracing", "ndarray"]
2727

2828
[workspace.dependencies.tokio]
2929
version = "1.48.0"
30-
features = [ "full",]
30+
features = ["full"]
3131

3232
[workspace.dependencies.prost]
3333
version = "0.14.1"

Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ WORKDIR /app
3333
# NOTE: if new modules are added to the Cargo workspaces, they must be added here.
3434
COPY Cargo.toml Cargo.lock ./
3535
COPY encoderfile ./encoderfile
36-
COPY encoderfile-core ./encoderfile-core
37-
COPY encoderfile-utils ./encoderfile-utils
3836
COPY encoderfile-runtime ./encoderfile-runtime
3937

4038
# Build release binary.

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,5 @@ clean:
7474
generate-docs:
7575
# generate JSON schema for encoderfile config
7676
@cargo run \
77-
--bin generate-encoderfile-config-schema
77+
--bin generate-encoderfile-config-schema \
78+
--all-features

codecov.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
ignore:
2-
- "encoderfile-core/tests"
3-
- "encoderfile-core/benches"
42
- "encoderfile/tests"
3+
- "encoderfile/benches"

0 commit comments

Comments
 (0)