-
Notifications
You must be signed in to change notification settings - Fork 35
file i/o endpoints #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
e41f909
api changes for file i/o
rgarcia a9062e4
implementation
rgarcia 33de44e
file directory ops
rgarcia 3e191ac
Fix fs watch goroutine leaks and improve error handling
cursoragent 8c3bed1
Improve fs watch goroutine lifecycle and resource management
cursoragent 0953976
Support custom file permissions when writing files via API
cursoragent e895649
Fix file listing to handle stat errors and correctly set file metadata
cursoragent f7313f6
Fix race condition and prevent blocking in filesystem watch events
cursoragent f02ae76
vet
rgarcia 5550c86
fix sse
rgarcia 808f925
Fix user and group lookup error handling in SetFilePermissions
cursoragent 5821cdd
Merge branch 'main' into raf/kernel-19-support-file-io
rgarcia 70ad2e8
Merge branch 'main' into raf/kernel-19-support-file-io
rgarcia 53b054a
add server to headless image (so we have file i/o there too)
rgarcia 494147f
test script
rgarcia 549e537
post -> put
rgarcia cd08bba
Improve file permission handling with direct UID/GID and fallback lookup
cursoragent 63ccaa3
Handle write errors in SSE event streaming to prevent potential hanging
cursoragent 59e236d
Improve file system watcher with safe close and recursive monitoring
cursoragent e6af0d9
good bot
rgarcia 9da2bb1
pr comments
rgarcia bc28626
more 400s -> 500s
rgarcia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| image/.rootfs | ||
| image/bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,15 @@ | ||
| #!/usr/bin/env bash | ||
| set -e -o pipefail | ||
|
|
||
| source common.sh | ||
| (cd image && docker build -t $IMAGE .) | ||
| # Move to the script's directory so relative paths work regardless of the caller CWD | ||
| SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) | ||
| cd "$SCRIPT_DIR" | ||
| source ../../shared/ensure-common-build-run-vars.sh chromium-headless | ||
|
|
||
| source ../../shared/start-buildkit.sh | ||
|
|
||
| # Build the kernel-images API binary and place it into the Docker build context | ||
| source ../../shared/build-server.sh "$SCRIPT_DIR/image/bin" | ||
|
|
||
| # Build (and optionally push) the Docker image | ||
| (cd image && docker build -t "$IMAGE" .) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,28 @@ | ||
| #!/usr/bin/env bash | ||
| set -ex -o pipefail | ||
|
|
||
| source common.sh | ||
| # Move to the script's directory so relative paths work regardless of the caller CWD | ||
| SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) | ||
| cd "$SCRIPT_DIR" | ||
| source ../../shared/ensure-common-build-run-vars.sh chromium-headless | ||
|
|
||
| docker run -it --rm \ | ||
| -p 9222:9222 \ | ||
| -e WITH_DOCKER=true \ | ||
| $IMAGE /usr/bin/wrapper.sh | ||
| # Directory on host where recordings will be saved when the API is enabled | ||
| HOST_RECORDINGS_DIR="$SCRIPT_DIR/recordings" | ||
| mkdir -p "$HOST_RECORDINGS_DIR" | ||
|
|
||
| RUN_ARGS=( | ||
| --name "$NAME" | ||
| --privileged | ||
| --tmpfs /dev/shm:size=2g | ||
| -p 9222:9222 | ||
| -e WITH_DOCKER=true | ||
| ) | ||
|
|
||
| if [[ "${WITH_KERNEL_IMAGES_API:-}" == "true" ]]; then | ||
| RUN_ARGS+=( -p 444:10001 ) | ||
| RUN_ARGS+=( -e WITH_KERNEL_IMAGES_API=true ) | ||
| RUN_ARGS+=( -v "$HOST_RECORDINGS_DIR:/recordings" ) | ||
| fi | ||
|
|
||
| docker rm -f "$NAME" 2>/dev/null || true | ||
| docker run -it --rm "${RUN_ARGS[@]}" "$IMAGE" /usr/bin/wrapper.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,24 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| source common.sh | ||
| name="chromium-headless-test" | ||
| # Move to the script's directory so relative paths work regardless of the caller CWD | ||
| SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) | ||
| cd "$SCRIPT_DIR" | ||
| source ../../shared/ensure-common-build-run-vars.sh chromium-headless | ||
|
|
||
| kraft cloud inst rm "$name" || true | ||
| kraft cloud inst rm "$NAME" || true | ||
|
|
||
| kraft cloud inst create \ | ||
| --start \ | ||
| -M 1G \ | ||
| -p 9222:9222/tls \ | ||
| --vcpus 1 \ | ||
| -n "$name" \ | ||
| $IMAGE | ||
| deploy_args=( | ||
| --start | ||
| -M 1G | ||
| -p 9222:9222/tls | ||
| --vcpus 1 | ||
| -n "$NAME" | ||
| ) | ||
|
|
||
| if [[ "${WITH_KERNEL_IMAGES_API:-}" == "true" ]]; then | ||
| deploy_args+=( -p 444:10001/tls ) | ||
| deploy_args+=( -e WITH_KERNEL_IMAGES_API=true ) | ||
| fi | ||
|
|
||
| kraft cloud inst create "${deploy_args[@]}" "$IMAGE" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.