-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT] Add ability to run arbitrary command on a set working directory (
#3404) # Overview - this PR will add the ability to run some arbitrary command on the ray cluster that the workflow has booted up - the working directory can be specified (defaults to `.github/assets`) - the command can be specified (must be provided; furthermore, empty strings will result in a failure of the workflow)
- Loading branch information
Raunak Bhagat
authored
Nov 23, 2024
1 parent
5dce4fb
commit b6706d9
Showing
3 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Working dir for submission | ||
|
||
This an example of a working directory which can be included inside of runs of the ray-cluster in a GitHub Actions workflow. | ||
|
||
## Usage | ||
|
||
In order to submit your own script, create a file in this directory, add+commit+push it to GitHub, and submit a GitHub Actions workflow request by specifying the path to this directory and a python command to execute the file. | ||
|
||
## Example | ||
|
||
First create the file: | ||
|
||
```bash | ||
touch .github/working-dir/my_script.py | ||
echo "print('Hello, world!')" >> .github/working-dir/my_script.py | ||
``` | ||
|
||
Then submit the request to execute the workflow to run this file on a ray-cluster. | ||
You can either do this via the GitHub Actions UI or by running the GitHub CLI: | ||
|
||
```bash | ||
gh workflow run run-cluster.yaml --ref $MY_BRANCH -f command="python my_script.py" | ||
``` |
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import daft | ||
|
||
df = daft.from_pydict({"nums": [1, 2, 3]}) | ||
df = df.with_column("result", daft.col("nums").cbrt()).collect() | ||
df.show() |