Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devenv: upgrade colima to 0.7.5 #78881

Merged
merged 5 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
38 changes: 19 additions & 19 deletions devenv/config.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[devenv]
minimum_version = 1.10.2
minimum_version = 1.11.0
Copy link
Member Author

Choose a reason for hiding this comment

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

this is a noop until minimum_version is implemented in 1.12.0 (getsentry/devenv#163)

but... 1.11.0 is a hard minimum requirement otherwise the newer colima won't be installed as a shim, and the newer limactl from homebrew can't be installed either

think we do need something in sync.py in the interim to lay the chicken egg


[venv.sentry]
python = 3.12.6
Expand Down Expand Up @@ -43,28 +43,28 @@ version = v20.13.1
yarn_version = 1.22.22

[colima]
darwin_x86_64 = https://github.com/abiosoft/colima/releases/download/v0.6.6/colima-Darwin-x86_64
darwin_x86_64_sha256 = 84e72678945aacba5805fe363f6c7c87dc73e05cbbfdfc09f9b57cedf110865d
darwin_arm64 = https://github.com/abiosoft/colima/releases/download/v0.6.6/colima-Darwin-arm64
darwin_arm64_sha256 = b2729edcf99470071240ab6986349346211e25944a5dc317bba8fa27ed0f25e5
linux_x86_64 = https://github.com/abiosoft/colima/releases/download/v0.6.6/colima-Linux-x86_64
linux_x86_64_sha256 = bf9e370c4bacbbebdfaa46de04d0e01fe2649a8e366f282cf35ae7dd84559a25
linux_arm64 = https://github.com/abiosoft/colima/releases/download/v0.6.6/colima-Linux-aarch64
linux_arm64_sha256 = 6ecba675e90d154f22e20200fa5684f20ad1495b73c0462f1bd7da4e9d0beaf8
darwin_x86_64 = https://github.com/abiosoft/colima/releases/download/v0.7.5/colima-Darwin-x86_64
darwin_x86_64_sha256 = 53f78b4aaef5fb5dab65cae19fba4504047de1fdafa152fba90435d8a7569c2b
darwin_arm64 = https://github.com/abiosoft/colima/releases/download/v0.7.5/colima-Darwin-arm64
darwin_arm64_sha256 = 267696d6cb28eaf6daa3ea9622c626697b4baeb847b882d15b26c732e841913c
linux_x86_64 = https://github.com/abiosoft/colima/releases/download/v0.7.5/colima-Linux-x86_64
linux_x86_64_sha256 = a3d440033776b2fb0cdd6139a2dbebf6764aabf78a671d4aa13b45c26df21a8a
linux_arm64 = https://github.com/abiosoft/colima/releases/download/v0.7.5/colima-Linux-aarch64
linux_arm64_sha256 = 330e11a4b2e5ce69ee6253635308c9f0f49195f236da01718ede35cdb2729901
# used for autoupdate
version = v0.6.6
version = v0.7.5

[lima]
darwin_x86_64 = https://github.com/lima-vm/lima/releases/download/v0.19.1/lima-0.19.1-Darwin-x86_64.tar.gz
darwin_x86_64_sha256 = ac8827479f66ef1b288b31f164b22f6433faa14c44ce5bbebe09e6e913582479
darwin_arm64 = https://github.com/lima-vm/lima/releases/download/v0.19.1/lima-0.19.1-Darwin-arm64.tar.gz
darwin_arm64_sha256 = 0dfcf3a39782baf1c2ea43cf026f8df0321c671d914c105fbb78de507aa8bda4
linux_x86_64 = https://github.com/lima-vm/lima/releases/download/v0.19.1/lima-0.19.1-Linux-x86_64.tar.gz
linux_x86_64_sha256 = 7d18b1716aae14bf98d6ea93a703e8877b0c3142f7ba2e87401d47d5d0fe3ff1
linux_arm64 = https://github.com/lima-vm/lima/releases/download/v0.19.1/lima-0.19.1-Linux-aarch64.tar.gz
linux_arm64_sha256 = c55e57ddbefd9988d0f3676bb873bcc6e0f7b3c3d47a1f07599ee151c5198d96
# upstream github releases aren't built for macOS 14, so we use homebrew binaries
# from https://formulae.brew.sh/api/formula/lima.json
darwin_x86_64 = https://ghcr.io/v2/homebrew/core/lima/blobs/sha256:c2e69a572afa3a3cf895643ede988c87dc0622dae4aebc539d5564d820845841
darwin_x86_64_sha256 = c2e69a572afa3a3cf895643ede988c87dc0622dae4aebc539d5564d820845841
darwin_arm64 = https://ghcr.io/v2/homebrew/core/lima/blobs/sha256:be8e2b92961eca2f862f1a994dbef367e86d36705a705ebfa16d21c7f1366c35
darwin_arm64_sha256 = be8e2b92961eca2f862f1a994dbef367e86d36705a705ebfa16d21c7f1366c35
linux_x86_64 = https://ghcr.io/v2/homebrew/core/lima/blobs/sha256:741e9c7345e15f04b8feaf5034868f00fc3ff792226c485ab2e7679803411e0c
linux_x86_64_sha256 = 741e9c7345e15f04b8feaf5034868f00fc3ff792226c485ab2e7679803411e0c
# used for autoupdate
version = 0.19.1
version = 0.23.2

# kept here only for compatibility with older `devenv`
[python]
Expand Down
64 changes: 39 additions & 25 deletions devenv/sync.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import importlib
import os
import shlex
import subprocess
Expand Down Expand Up @@ -70,7 +71,31 @@ def run_procs(
return all_good


# Temporary, see https://github.com/getsentry/sentry/pull/78881
def check_minimum_version(minimum_version: str):
version = importlib.metadata.version("sentry-devenv")

parsed_version = tuple(map(int, version.split(".")))
parsed_minimum_version = tuple(map(int, minimum_version.split(".")))

if parsed_version < parsed_minimum_version:
raise SystemExit(
f"""
Your devenv version ({version}) doesn't meet the
minimum version ({minimum_version}) defined in the repo config.

Run the following to update your global devenv to the minimum,
and use it to run this repo's sync.

{constants.root}/bin/devenv update {minimum_version}
{constants.root}/bin/devenv sync
"""
)


def main(context: dict[str, str]) -> int:
check_minimum_version("1.11.0")

repo = context["repo"]
reporoot = context["reporoot"]
repo_config = config.get_config(f"{reporoot}/devenv/config.ini")
Expand All @@ -80,22 +105,15 @@ def main(context: dict[str, str]) -> int:

FRONTEND_ONLY = os.environ.get("SENTRY_DEVENV_FRONTEND_ONLY") is not None

# repo-local devenv needs to update itself first with a successful sync
# so it'll take 2 syncs to get onto devenv-managed node, it is what it is
try:
from devenv.lib import node
from devenv.lib import node

node.install(
repo_config["node"]["version"],
repo_config["node"][constants.SYSTEM_MACHINE],
repo_config["node"][f"{constants.SYSTEM_MACHINE}_sha256"],
reporoot,
)
node.install_yarn(repo_config["node"]["yarn_version"], reporoot)
except ImportError:
from devenv.lib import volta # type: ignore[attr-defined]

volta.install(reporoot)
node.install(
repo_config["node"]["version"],
repo_config["node"][constants.SYSTEM_MACHINE],
repo_config["node"][f"{constants.SYSTEM_MACHINE}_sha256"],
reporoot,
)
node.install_yarn(repo_config["node"]["yarn_version"], reporoot)

# no more imports from devenv past this point! if the venv is recreated
# then we won't have access to devenv libs until it gets reinstalled
Expand All @@ -114,16 +132,12 @@ def main(context: dict[str, str]) -> int:
repo_config["colima"][f"{constants.SYSTEM_MACHINE}_sha256"],
reporoot,
)
try:
limactl.install(reporoot) # type: ignore[call-arg]
except TypeError:
# again, it'll take 2 syncs to get here
limactl.install(
repo_config["lima"]["version"],
repo_config["lima"][constants.SYSTEM_MACHINE],
repo_config["lima"][f"{constants.SYSTEM_MACHINE}_sha256"],
reporoot,
)
limactl.install(
repo_config["lima"]["version"],
repo_config["lima"][constants.SYSTEM_MACHINE],
repo_config["lima"][f"{constants.SYSTEM_MACHINE}_sha256"],
reporoot,
)

if not run_procs(
repo,
Expand Down
Loading