dstackai / dstack

dstack is an open-source alternative to Kubernetes, designed to simplify development, training, and deployment of AI across any cloud or on-prem. It supports NVIDIA, AMD, and TPU.
https://dstack.ai/docs
Mozilla Public License 2.0
1.42k stars 149 forks source link

Treat a Git repo without a tracking remote branch as a local repo but show a warning #822

Closed kengz closed 6 days ago

kengz commented 10 months ago

dstack version

0.13.0

Python version

3.11.0

Host OS

MacOS 13.1

Host Arch

ARM

What happened?

Full repro instruction to obtain error "The repo is not initialized..."

mkdir test
cd test/

pip install 'dstack[all]' -U
dstack --version
# 0.13.0

echo 'type: dev-environment                                                                         
python: "3.11"
ide: vscode
' > .dstack.yml

# cleanup ~/.dstack
rm -rf ~/.dstack
# in a separate shell, run:
dstack server
# in another shell, run:
dstack run . -f .dstack.yml
# The repo is not initialized. Run `dstack init` to initialize the repo.

CLI logs

No response

Server logs

No response

Runner logs

No response

Additional Information

No response

peterschmidt85 commented 10 months ago

Works after dstack init. But for a git repo - a new branch still needs to be pushed to remote for it to work.

➜ dstack run . -f .dstack/train.dstack.yml
Traceback (most recent call last):
  File "/Users/keng/projects/lean-dl-example/.venv/bin/dstack", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/keng/projects/lean-dl-example/.venv/lib/python3.11/site-packages/dstack/_internal/cli/main.py", line 64, in main
    args.func(args)
  File "/Users/keng/projects/lean-dl-example/.venv/lib/python3.11/site-packages/dstack/_internal/cli/commands/run.py", line 94, in _command
    repo = self.api.repos.load(Path.cwd())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/keng/projects/lean-dl-example/.venv/lib/python3.11/site-packages/dstack/api/_public/repos.py", line 114, in load
    repo = load_repo(repo_config)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/keng/projects/lean-dl-example/.venv/lib/python3.11/site-packages/dstack/_internal/core/services/repos.py", line 134, in load_repo
    return RemoteRepo(repo_id=config.repo_id, local_repo_dir=config.path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/keng/projects/lean-dl-example/.venv/lib/python3.11/site-packages/dstack/_internal/core/models/repos/remote.py", line 99, in __init__
    raise RepoError("No remote branch is configured")
dstack._internal.core.models.repos.remote.RepoError: No remote branch is configured
peterschmidt85 commented 10 months ago

Suggestion: If it's a Git repo but there is no tracking remote branch, show a warning but treat it as a local repo.

peterschmidt85 commented 9 months ago

This issue is stale because it has been open for 30 days with no activity.

peterschmidt85 commented 8 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 6 days ago

This issue was closed because it has been inactive for 14 days since being marked as stale. Please reopen the issue if it is still relevant.