Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Conversation

@Nanashi-lab
Copy link
Contributor

@Nanashi-lab Nanashi-lab commented Jul 29, 2025

/closes golemcloud/golem#1922
/claim golemcloud/golem#1922

Video Link for usage Link

Add two new cli commands to worker, files and file-contents. These changes are independant of the PR in golem.

files

Arguments <WORKER_NAME> and [PATH] - Path to the directory to list files from [default: /]
Example (Success)

golem-dev worker files test:sc/test /in/inner
Selected profile: local
Fuzzy matched pattern test:sc as test:sc
Listing files for worker test:sc/test at path /in/inner
+---------+-----------+-------------+------+---------------+
| Name    | Kind      | Permissions | Size | Last Modified |
+---------+-----------+-------------+------+---------------+
| foo.txt | file      | read-only   |   21 |    1752731658 |
+---------+-----------+-------------+------+---------------+
| inner2  | directory | -           |    0 |    1752733563 |
+---------+-----------+-------------+------+---------------+
| inner1  | directory | -           |    0 |    1752733563 |
+---------+-----------+-------------+------+---------------+

Listed files for worker test:sc/test at path /in/inner

Example[Failure]

 golem-dev worker files test:sc/test /in/fail
Selected profile: local
Fuzzy matched pattern test:sc as test:sc
Listing files for worker test:sc/test at path /in/fail
Failed to list files for worker test:sc/test at path /in/fail: Worker Service - Error: 404 Not Found, File not found: /in/fail

error: Worker Service - Error: 404 Not Found, File not found: /in/fail

file-contents

Arguments <WORKER_NAME> and <PATH>, optional --output, to specific output location and name

Example [Success]

 golem-dev worker file-contents test:sc/test /in/baz.txt --output test.txt
Selected profile: local
Fuzzy matched pattern test:sc as test:sc
Downloading file from worker test:sc/test at path /in/
File Saved to path test.txt

Example [Failure]

 golem-dev worker file-contents test:sc/test /in/
Selected profile: local
Fuzzy matched pattern test:sc as test:sc
Downloading file from worker test:sc/test at path /in/
Failed to download file from worker test:sc/test at path /in/: Worker Service - Error: 400 Bad Request, Bad file type: /in

error: Worker Service - Error: 400 Bad Request, Bad file type: /in

use cargo_toml::{
Dependency, DependencyDetail, DepsSet, Edition, Inheritable, LtoSetting, Manifest, Profile,
Profiles, StripSetting, Workspace,
Profiles, StripSetting, Value, Workspace,
Copy link
Contributor Author

@Nanashi-lab Nanashi-lab Jul 29, 2025

Choose a reason for hiding this comment

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

removed use toml::Value, in favour of cargo_toml:: Value, to fix this error.

cargo_toml = "0.22.1" (which depends on toml = "0.9.x")
toml = "0.8.19" (direct dependency)

@Nanashi-lab
Copy link
Contributor Author

@vigoo I am ready for a review, I updated this to latest, 1.3.0-dev-21, tested this with the new changes to Golem FileSystemNode. Thank you.

@vigoo
Copy link
Contributor

vigoo commented Aug 15, 2025

Will need to be rebased after merging my golem-cli PR; I'll try that before merging the repos to get this in if possible, if not will write there about reopening it in the other one.

@vigoo
Copy link
Contributor

vigoo commented Aug 15, 2025

Let's rather reopen it in the other repo

@vigoo vigoo closed this Aug 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Cli support for listing and getting contents of worker files.

2 participants