Skip to content

fix: update runc to 1.3.4 in Finch CI for symlink bind-mount support#8655

Merged
bnusunny merged 2 commits intoaws:developfrom
bnusunny:fix/finch-symlink-mount
Feb 18, 2026
Merged

fix: update runc to 1.3.4 in Finch CI for symlink bind-mount support#8655
bnusunny merged 2 commits intoaws:developfrom
bnusunny:fix/finch-symlink-mount

Conversation

@bnusunny
Copy link
Copy Markdown
Contributor

@bnusunny bnusunny commented Feb 14, 2026

Finch/containerd fails with 'not a directory' when bind-mounting over a symlink due to a bug in the bundled runc. The Finch team confirmed the fix is to update runc to 1.3.4.

Instead of skipping the affected integration tests, this PR updates runc to 1.3.4 in the GitHub Actions CI pipeline after Finch is installed, which resolves the underlying issue.

Changes

  • Install runc 1.3.4 in the Finch setup step of integration-tests.yml, replacing the binaries at /usr/sbin/runc and /usr/bin/runc
  • Revert the @skipIf test decorator on TestInvokeBuildInSourceSymlinkedModules so symlink tests run on all runtimes

@bnusunny bnusunny requested a review from a team as a code owner February 14, 2026 02:53
try:
symlink_path = file.path
symlink_target = os.readlink(symlink_path)
os.remove(symlink_path)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we remove the symlink_path (file.path) and recreate it againin the next line?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

When SAM CLI mounts symlinks into containers (e.g. during sam local invoke with --build-in-source), Finch/containerd's runc fails with a "not a directory" error. Unlike Docker, which transparently handles symlinks at mount target paths, Finch expects an actual directory at the mount point inside the container's rootfs.

The fix does two things:

In _create_mapped_symlink_files, before mounting a symlink, it temporarily replaces the symlink on the host with an empty directory. This lets the container runtime create a valid bind mount. The original symlink target is recorded in self._replaced_symlinks.

A new _restore_mapped_symlinks method restores the original symlinks after the container is deleted (in the delete method), so the host filesystem is left in its original state for subsequent invocations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't the symlink be restored after the container is created? why do we restore the symlink after the container is deleted?

Copy link
Copy Markdown
Contributor Author

@bnusunny bnusunny Feb 17, 2026

Choose a reason for hiding this comment

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

No, we can't restore the symlink right after the container is created. The directory has to be there when the container is running. So we can only restore the symlink after the container is deleted.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's reach out to Finch team to see if they can support the same as what Docker does so we don't have to change how we implement this for different containers

@bnusunny bnusunny requested a review from vicheey February 17, 2026 18:48
@roger-zhangg
Copy link
Copy Markdown
Member

If we are just fixing the test, let's add a skip for finch for now. And a TODO to add back when it's fixed

@bnusunny bnusunny force-pushed the fix/finch-symlink-mount branch from e13de23 to 13ac210 Compare February 18, 2026 16:42
@bnusunny
Copy link
Copy Markdown
Contributor Author

Since Finch team confirmed this is a bug, we are skipping this test and will add it back when it is fixed.

@bnusunny bnusunny changed the title fix: replace symlinks with dirs for Finch container mount compatibility fix: skip build-in-source symlink invoke tests on Finch runtime Feb 18, 2026
Finch/containerd does not support bind-mounting over symlinks (fails with
'not a directory'). The Finch team confirmed this is a known bug on their side.

Instead of working around it in SAM CLI, skip the affected integration tests
when CONTAINER_RUNTIME=finch and remove the verification workflow.

Tests will be re-enabled once Finch ships the fix.
@bnusunny bnusunny force-pushed the fix/finch-symlink-mount branch from 13ac210 to 5c3dbc9 Compare February 18, 2026 16:46
@bnusunny bnusunny requested a review from seshubaws February 18, 2026 16:47
seshubaws
seshubaws previously approved these changes Feb 18, 2026
Instead of skipping symlink integration tests on Finch, update runc
to 1.3.4 in the CI pipeline which fixes the underlying bind-mount
over symlink issue in containerd/runc.

- Install runc 1.3.4 after Finch package install, before service start
- Revert test skip decorator on TestInvokeBuildInSourceSymlinkedModules
@bnusunny bnusunny changed the title fix: skip build-in-source symlink invoke tests on Finch runtime fix: update runc to 1.3.4 in Finch CI for symlink bind-mount support Feb 18, 2026
@bnusunny
Copy link
Copy Markdown
Contributor Author

The fix is to upgrade runc to 1.3.4

@bnusunny bnusunny added this pull request to the merge queue Feb 18, 2026
Merged via the queue into aws:develop with commit ea8f6bc Feb 18, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants