Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Standalone CLI: sub #232

Merged
merged 34 commits into from
Oct 1, 2023
Merged

Standalone CLI: sub #232

merged 34 commits into from
Oct 1, 2023

Conversation

nstogner
Copy link
Contributor

@nstogner nstogner commented Sep 6, 2023

Add a standalone CLI: sub

Replaces the current kubectl plugins.

Makefile Show resolved Hide resolved
docs/cli.md Outdated
## List

```bash
strat ls (list)
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to strat, -1 to ai

Copy link
Contributor

Choose a reason for hiding this comment

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

I think sub has my preference right now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sub it is!

docs/cli.md Show resolved Hide resolved
docs/container-contract.md Outdated Show resolved Hide resolved
--max-cpu 960 --max-memory 9600 --ephemeral-storage-local-ssd=count=2 \
--autoprovisioning-scopes=logging.write,monitoring,devstorage.read_only,compute \
--addons GcsFuseCsiDriver
gcloud container clusters create ${CLUSTER_NAME} --location ${REGION} \
Copy link
Contributor

@samos123 samos123 Sep 6, 2023

Choose a reason for hiding this comment

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

this messes up the docs rendering so would prefer original formatting instead of spaces at beginning of lines

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Editor side-effect, reverted

@samos123
Copy link
Contributor

samos123 commented Sep 6, 2023

Overall the CLI looks promising! Can't wait to try it out for my dev flow.

I would prefer to keep this PR only to what's needed to make the Standalone CLI work. Any refactors should be done as separate PRs and discussed separately. Things like reformatting the gcp install scripts or renaming baseModel to model are big changes that don't seem to be required for the standalone CLI.

data/ # Location where Datasets will be mounted (reading and loading).
data/ # Location where a previously stored Datasets is mounted.
model/ # Location where a previously stored Model is mounted.
output/ # Location to store output of a run.
Copy link
Contributor

Choose a reason for hiding this comment

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

change to `artifacts

@@ -127,7 +125,6 @@ The example Model's backing storage would end up being:

```sh
gs://abc123-substratus-artifacts/f94a0d128bcbd9c1b824e9e5572baf86/model/
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is no longer a good reason to store model in a subdirectory

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed, I think this doc is wrong now, will fix

Copy link
Contributor

Choose a reason for hiding this comment

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

please revert all changes in this file unless these changes were needed to fix something

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do before merge

install/gcp/up.sh Outdated Show resolved Hide resolved
@samos123
Copy link
Contributor

samos123 commented Sep 10, 2023

Edit: Ignore this is already fixed in commit 47c4a76

I noticed the following log:

2023/09/09 21:34:03 Pod logs for: %v: %v test-gguf-model-notebook-bld-n85wk time="2023-09-10T04:34:03Z" level=info msg="Retrieving image nvidia/cuda:12.2.0-devel-ubuntu22.04 from registry index.docker.io"

@samos123
Copy link
Contributor

samos123 commented Sep 10, 2023

Not for this PR, but something to discuss as a follow up. One thing that was rather annoying was being unable to edit params.json from within the notebook. It's mounted as read-only. I noticed I had a typo in my param.json and my only way to solve it was to delete the notebook and modify the substratus resource.

@samos123
Copy link
Contributor

I can't seem to get out once I hit an error, Ctrl + C and Q are both not working:
image

@samos123
Copy link
Contributor

file syncing currently only happens for files in src directory. I placed my notebook in the main directory. I think the file sync should happen for any .ipynb file that's also in the local directory.

## Substratus.yaml

### Option 1: Workspace file

Copy link
Contributor

Choose a reason for hiding this comment

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

workspace file seems complex, having multiple files feels cleaner

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed


**Cons:**

* Could get messy
Copy link
Contributor

Choose a reason for hiding this comment

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

and complex if you never used kustomize

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed

# Generated if not specified
```

### Option 2: Multi-doc
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this or simply creating multiple files within same dir is better

w.Add("/content/src")
const contentDir = "/content"

// NOTE: Watch is non-recursive.
Copy link
Contributor

Choose a reason for hiding this comment

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

so it would watch /content/src but not /content/src/my-dir/sam.ipynb?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep

Mounts: []cloud.BucketMount{
{BucketSubdir: "data", ContentSubdir: "data"},
{BucketSubdir: "logs", ContentSubdir: "logs"},
{BucketSubdir: "artifacts", ContentSubdir: "artifacts"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need a BucketSubdir now that it is all artifacts together? I think probably cleaner to remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I dont think we need it anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will leave for later refactor

internal/tui/manifests.go Outdated Show resolved Hide resolved
}

cmd := &cobra.Command{
Use: "push [dir]",
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with push as well but feel run is more descriptive of what the end-result is here. The pushing is just an intermediary step to run it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to run

@nstogner nstogner changed the title WIP: Standalone CLI Standalone CLI: sub Sep 30, 2023
@nstogner
Copy link
Contributor Author

Tracking the param.json issue here: #237

@samos123 samos123 merged commit 9463df2 into main Oct 1, 2023
4 checks passed
@samos123 samos123 deleted the ai-cli branch October 1, 2023 04:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants