Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/dstack/_internal/core/backends/base/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def get_latest_runner_build() -> Optional[str]:
workflow_id = "build.yml"
version_offset = 150

repo = git.Repo(search_parent_directories=True)
repo = git.Repo(os.path.abspath(os.path.dirname(__file__)), search_parent_directories=True)
for remote in repo.remotes:
if re.search(rf"[@/]github\.com[:/]{owner_repo}\.", remote.url):
break
Expand Down Expand Up @@ -241,6 +241,8 @@ def get_dstack_gateway_wheel(build: str) -> str:

def get_dstack_gateway_commands() -> List[str]:
build = get_dstack_runner_version()
if build == "latest":
raise ValueError("`latest` is not appropriate version for a gateway")
return [
"mkdir -p /home/ubuntu/dstack",
"python3 -m venv /home/ubuntu/dstack/blue",
Expand Down
7 changes: 5 additions & 2 deletions src/dstack/_internal/server/services/gateways/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def _gateway_preflight(

async def update_gateways(session: AsyncSession):
if settings.SKIP_GATEWAY_UPDATE:
logger.debug("Skipping gateway update")
logger.debug("Skipping gateway update due to DSTACK_SKIP_GATEWAY_UPDATE env variable")
return

res = await session.execute(
Expand All @@ -306,8 +306,11 @@ async def update_gateways(session: AsyncSession):
gateway_computes = res.scalars().all()

build = get_dstack_runner_version()
aws = [run_async(_update_gateway, gateway, build) for gateway in gateway_computes]
if build == "latest":
logger.debug("Skipping gateway update due to `latest` version being used")
return

aws = [run_async(_update_gateway, gateway, build) for gateway in gateway_computes]
for error, gateway in zip(
await asyncio.gather(*aws, return_exceptions=True), gateway_computes
):
Expand Down