-
Notifications
You must be signed in to change notification settings - Fork 6
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
Avoid cloning cached registries #25
Avoid cloning cached registries #25
Conversation
Uncovered a performance issue while testing this against a real workflow. The |
Note that Julia seems to be keeping track of registry URLs it has updated and there isn't any symlink specific logic: ❯ mkdir -p /tmp/julia-depot2/registries
❯ cd /tmp/julia-depot2/registries
❯ export JULIA_DEPOT_PATH=/tmp/julia-depot2
❯ git clone https://github.com/JuliaRegistries/General General1
Cloning into 'General1'...
remote: Enumerating objects: 792469, done.
remote: Counting objects: 100% (12926/12926), done.
remote: Compressing objects: 100% (492/492), done.
remote: Total 792469 (delta 12567), reused 12681 (delta 12433), pack-reused 779543
Receiving objects: 100% (792469/792469), 229.36 MiB | 29.74 MiB/s, done.
Resolving deltas: 100% (432253/432253), done.
Updating files: 100% (42240/42240), done.
❯ git clone https://github.com/JuliaRegistries/General General2
Cloning into 'General2'...
remote: Enumerating objects: 792469, done.
remote: Counting objects: 100% (13033/13033), done.
remote: Compressing objects: 100% (846/846), done.
remote: Total 792469 (delta 12363), reused 12761 (delta 12183), pack-reused 779436
Receiving objects: 100% (792469/792469), 230.05 MiB | 34.76 MiB/s, done.
Resolving deltas: 100% (432061/432061), done.
Updating files: 100% (42240/42240), done.
❯ julia -e 'using Pkg; Pkg.Registry.update()'
Updating registry at `/tmp/julia-depot2/registries/General1`
Updating git-repo `https://github.com/JuliaRegistries/General` |
Validated that these changes work in a private workflow. |
I've validated the merge commit works in a private workflow |
Depends on:
Fixes:
registry
when loaded from cache #19 (when usingjulia-actions/cache
before this action withcache-registries: true
. Enabled by default injulia-actions/cache@v1.5.0
)Moves away from cloning to a temporary directory in order to interact better with
julia-actions/cache
when registry cloning is enabled. The key component here is to use a consistent name of the registry such that we know the repo has already been downloaded and we can skip an additional clone. In order to do this I've opted to clone the registry using the repo name into the depot registry directory. As some registries can have different registry names from repo names I've added a symlink into the depot registry as well such that both names co-exist.Luckily, Julia is smart enough to avoid updating both registries. For example: