Skip to content

Commit

Permalink
Merge branch 'main' of github.com:metalbear-co/mirrord into issue/649…
Browse files Browse the repository at this point in the history
…/first-http-request-missing-fix
  • Loading branch information
meowjesty committed Oct 15, 2024
2 parents 489b1ff + d9fb0f9 commit a3cdcc6
Show file tree
Hide file tree
Showing 81 changed files with 487 additions and 278 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ on:
workflow_dispatch:
push:
pull_request:
branches: [main]
types: [opened, synchronize, reopened, ready_for_review]
branches: [ main ]
types: [ opened, synchronize, reopened, ready_for_review ]

# Cancel previous runs on the same PR.
concurrency:
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
- run: rm rust-toolchain.toml
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2024-04-15
toolchain: nightly-2024-10-11
components: rustfmt, clippy
target: aarch64-unknown-linux-gnu,x86_64-unknown-linux-gnu
- uses: actions/setup-python@v5 # For http mirroring tests with Flask and FastAPI.
Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2024-04-15
toolchain: nightly-2024-10-11
# TODO(alex): `no-deps` here due to an issue in `futures-util`.
- run: cargo doc --document-private-items --no-deps

Expand All @@ -202,7 +202,7 @@ jobs:
needs: changed_files
if: ${{needs.changed_files.outputs.rs_changed == 'true' || needs.changed_files.outputs.ci_changed == 'true'}}
container:
image: ghcr.io/metalbear-co/ci-agent-build:f8330d35a2a4b9132138f6fa9a3f3f80768c7c32
image: ghcr.io/metalbear-co/ci-agent-build:193d12d5d8015c1ed60b9eda30c708cb9c4653e9
steps:
- uses: actions/checkout@v4
- uses: arduino/setup-protoc@v3
Expand Down Expand Up @@ -252,7 +252,7 @@ jobs:

integration_tests:
runs-on: ubuntu-24.04
needs: [changed_files]
needs: [ changed_files ]
if: ${{needs.changed_files.outputs.rs_changed == 'true' || needs.changed_files.outputs.ci_changed == 'true'}}
steps:
- uses: actions/checkout@v4 # Checkout the mirrord repo.
Expand Down Expand Up @@ -345,6 +345,9 @@ jobs:
- run: |
cd mirrord/layer/tests/apps/issue2438
cargo build
- run: |
cd mirrord/layer/tests/apps/rebind0
cargo build
- run: ./scripts/build_c_apps.sh
- run: cargo test --target x86_64-unknown-linux-gnu -p mirrord-layer
- name: mirrord protocol UT
Expand Down Expand Up @@ -384,7 +387,7 @@ jobs:
with:
components: rustfmt, clippy
target: aarch64-apple-darwin
toolchain: nightly-2024-04-15
toolchain: nightly-2024-10-11
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
Expand Down Expand Up @@ -463,6 +466,9 @@ jobs:
- run: |
cd mirrord/layer/tests/apps/issue2438
cargo build
- run: |
cd mirrord/layer/tests/apps/rebind0
cargo build
- run: ./scripts/build_c_apps.sh
# For the `java_temurin_sip` test.
- uses: sdkman/sdkman-action@b1f9b696c79148b66d3d3a06f7ea801820318d0f
Expand Down Expand Up @@ -493,9 +499,9 @@ jobs:
runs-on: ubuntu-24.04
strategy:
matrix:
container-runtime: ["docker", "containerd"]
container-runtime: [ "docker", "containerd" ]
name: e2e
needs: [test_agent_image, changed_files]
needs: [ test_agent_image, changed_files ]
if: ${{needs.changed_files.outputs.rs_changed == 'true' || needs.changed_files.outputs.ci_changed == 'true'}}
env:
MIRRORD_AGENT_RUST_LOG: "warn,mirrord=debug"
Expand Down Expand Up @@ -575,14 +581,14 @@ jobs:
# which checks if the branch is a release branch
intellij_e2e_on_release_branch:
# requires test_agent to have image to download
needs: [build_mirrord_on_release_branch, test_agent_image]
needs: [ build_mirrord_on_release_branch, test_agent_image ]
uses: metalbear-co/mirrord-intellij/.github/workflows/reusable_e2e.yaml@main
with:
mirrord_release_branch: true

vscode_e2e_on_release_branch:
# requires test_agent to have image to download
needs: [build_mirrord_on_release_branch, test_agent_image]
needs: [ build_mirrord_on_release_branch, test_agent_image ]
uses: metalbear-co/mirrord-vscode/.github/workflows/reusable_e2e.yaml@main
with:
mirrord_release_branch: true
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: x86_64-apple-darwin,aarch64-apple-darwin
toolchain: nightly-2024-04-15
toolchain: nightly-2024-10-11
rustflags: ""
- name: Import Code-Signing Certificates
uses: Apple-Actions/import-codesign-certs@v3
Expand All @@ -73,7 +73,7 @@ jobs:
brew tap mitchellh/gon
brew install mitchellh/gon/gon
- name: build mirrord-layer x86-64
run: cargo +nightly-2024-04-15 build --release -p mirrord-layer --target=x86_64-apple-darwin
run: cargo +nightly-2024-10-11 build --release -p mirrord-layer --target=x86_64-apple-darwin
- name: build mirrord-layer macOS arm/arm64e
# Editing the arm64 binary, since arm64e can be loaded into both arm64 & arm64e
# >> target/debug/libmirrord_layer.dylib: Mach-O 64-bit dynamically linked shared library arm64
Expand All @@ -82,7 +82,7 @@ jobs:
# >> magic bits: 0000000 facf feed 000c 0100 0002 0000 0006 0000
# >> target/debug/libmirrord_layer.dylib: Mach-O 64-bit dynamically linked shared library arm64e
run: |
cargo +nightly-2024-04-15 build --release -p mirrord-layer --target=aarch64-apple-darwin
cargo +nightly-2024-10-11 build --release -p mirrord-layer --target=aarch64-apple-darwin
cp target/aarch64-apple-darwin/release/libmirrord_layer.dylib target/aarch64-apple-darwin/release/libmirrord_layer_arm64e.dylib
printf '\x02' | dd of=target/aarch64-apple-darwin/release/libmirrord_layer_arm64e.dylib bs=1 seek=8 count=1 conv=notrunc
- name: Sign layer binaries
Expand All @@ -102,11 +102,11 @@ jobs:
- name: build macOS arm cli with universal dylib
env:
MIRRORD_LAYER_FILE: /tmp/target/universal-apple-darwin/release/libmirrord_layer.dylib
run: cargo +nightly-2024-04-15 build --release -p mirrord --target=aarch64-apple-darwin
run: cargo +nightly-2024-10-11 build --release -p mirrord --target=aarch64-apple-darwin
- name: build macOS x86-64 cli with universal dylib
env:
MIRRORD_LAYER_FILE: /tmp/target/universal-apple-darwin/release/libmirrord_layer.dylib
run: cargo +nightly-2024-04-15 build --release -p mirrord --target=x86_64-apple-darwin
run: cargo +nightly-2024-10-11 build --release -p mirrord --target=x86_64-apple-darwin
- name: Sign cli binaries
env:
AC_USERNAME: ${{ secrets.APPLE_DEVELOPER }}
Expand Down
19 changes: 12 additions & 7 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ members = [
"mirrord/layer/tests/apps/issue1899",
"mirrord/layer/tests/apps/issue2001",
"mirrord/layer/tests/apps/issue2438",
"mirrord/layer/tests/apps/rebind0",
"sample/rust",
"medschool",
"tests",
Expand Down
1 change: 1 addition & 0 deletions changelog.d/+update-rust.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
update rust to 10-10-2024
1 change: 1 addition & 0 deletions changelog.d/2812.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Wrong warning displayed when binding UDP port 0 and filtering HTTP.
1 change: 1 addition & 0 deletions changelog.d/2812.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add integration (regression) test for binding port 0 twice.
2 changes: 1 addition & 1 deletion medschool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ mod types;
#[tracing::instrument(level = "trace", ret)]
pub(crate) fn parse_files(path: PathBuf) -> Result<Vec<syn::File>, DocsError> {
let mut paths = glob::glob(&format!("{}/**/*.rs", path.to_string_lossy()))?.peekable();
paths.peek().ok_or_else(|| DocsError::NoFiles)?;
paths.peek().ok_or(DocsError::NoFiles)?;

let mut contents = String::new();
paths
Expand Down
2 changes: 1 addition & 1 deletion medschool/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct PartialField<'a> {

/// Converts a [`syn::Field`] into [`PartialField`], using
/// [`get_ident_from_field_skipping_generics`] to get the field type.
impl<'a> TryFrom<syn::Field> for PartialField<'a> {
impl TryFrom<syn::Field> for PartialField<'_> {
type Error = ();

#[tracing::instrument(level = "trace", ret)]
Expand Down
3 changes: 1 addition & 2 deletions mirrord/agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ tokio = { workspace = true, features = [
"process",
"signal",
] }
procfs = "0.17.0"
serde.workspace = true
serde_json.workspace = true
pnet = "0.35"
Expand Down Expand Up @@ -75,7 +74,7 @@ socket2.workspace = true
[target.'cfg(target_os = "linux")'.dependencies]
iptables = { git = "https://github.com/metalbear-co/rust-iptables.git", rev = "e66c7332e361df3c61a194f08eefe3f40763d624" }
rawsocket = { git = "https://github.com/metalbear-co/rawsocket.git" }

procfs = "0.17.0"

[dev-dependencies]
rstest = "0.23"
Expand Down
8 changes: 4 additions & 4 deletions mirrord/agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM ghcr.io/metalbear-co/ci-agent-build:5411527b77fe5a87712a4fd98d0bfdab52eca117 AS chef
FROM --platform=$BUILDPLATFORM ghcr.io/metalbear-co/ci-agent-build:193d12d5d8015c1ed60b9eda30c708cb9c4653e9 AS chef
ARG TARGETARCH
WORKDIR /app

Expand All @@ -24,12 +24,12 @@ COPY Cargo.toml Cargo.lock CHANGELOG.md README.md LICENSE rust-toolchain.toml /a
# so we remove from the workspace
RUN sed -i '/members = \[/,/\]/c\members = [\n "mirrord/*",\n]' /app/Cargo.toml

RUN cargo +nightly-2024-04-15 chef prepare --recipe-path recipe.json
RUN cargo +nightly-2024-10-11 chef prepare --recipe-path recipe.json

FROM chef AS builder

COPY --from=planner /app/recipe.json recipe.json
RUN cargo +nightly-2024-04-15 chef cook --release --zigbuild --target $(cat /.platform) --recipe-path recipe.json
RUN cargo +nightly-2024-10-11 chef cook --release --zigbuild --target $(cat /.platform) --recipe-path recipe.json

# Copy order is important here, since we want the cache to be invalidated as less as possible
# so we start with the most static files, then the most dynamic ones
Expand All @@ -43,7 +43,7 @@ COPY Cargo.toml Cargo.lock CHANGELOG.md README.md LICENSE rust-toolchain.toml /a
# so we remove from the workspace
RUN sed -i '/members = \[/,/\]/c\members = [\n "mirrord/*",\n]' /app/Cargo.toml

RUN cargo +nightly-2024-04-15 zigbuild -Z bindeps --manifest-path /app/mirrord/agent/Cargo.toml --target $(cat /.platform) --release
RUN cargo +nightly-2024-10-11 zigbuild -Z bindeps --manifest-path /app/mirrord/agent/Cargo.toml --target $(cat /.platform) --release
RUN cp /app/target/$(cat /.platform)/release/mirrord-agent /mirrord-agent

FROM ghcr.io/metalbear-co/ci-agent-runtime:latest
Expand Down
Loading

0 comments on commit a3cdcc6

Please sign in to comment.