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

Add support for parallel universes #905

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add support for parallel universes #905

wants to merge 3 commits into from

Conversation

Keno
Copy link
Contributor

@Keno Keno commented Sep 3, 2020

This adds the concept of a "universe" for autobuilds. A universe
is essentially a depot that has its own copy of the General registry.
When building packages using --deploy=universe the built jll gets
registered into this copy of the registry and subsequent builds can
pick it up from there as if it had been registered with the real
general registry. This allows successive builds of dependent packages
without first having to go register the dependency. The universe
to use is specified using --universe=<name>. If a universe by
that name does not exist, it is created. Otherwise the previously
created universe is re-used.

cc @KristofferC @fredrikekre

Copy link
Member

@staticfloat staticfloat left a comment

Choose a reason for hiding this comment

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

This is really nice, and I'm a big fan of melodramatic names. :)

deploy_bin_repo = deploy_jll_repo = "JuliaBinaryWrappers/$(src_name)_jll.jl"
end

# Find the universe directory by ascending from pwd() until we find a "universes" directory
Copy link
Member

Choose a reason for hiding this comment

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

Hmmm, I'm not certain about this. Perhaps we should store these in a Scratch space?

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 thought about it, but I do kinda want it explicitly available in Yggdrasil in case you need to go in and edit something. Putting it in Scratch makes it really hard to find.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's also the same thing that git does to find its .git folders.

Copy link
Member

Choose a reason for hiding this comment

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

I'd like to have a way for these universes to get GC'ed. I think Fredrik and I are going to add optional user-defined time limits to scratch spaces so that you can e.g. @get_scratch("Universe-$(universe)"; lifetime=Days(3)) and if you don't use it again in three days, it gets auto-cleaned up.

That's the main reason I want to use scratch spaces. Perhaps we can add a symlink in build, so that if you do julia build_tarballs.jl --universe=SS_rebuild --deploy=universe, it then creates not only build/SuiteSparse*.tar.gz, but also build/universes/SS_rebuild which points to the universe where that was built?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why should universes get explicitly gc'ed? Seems like something that should be very much up to the user.

Copy link
Member

Choose a reason for hiding this comment

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

I think these should be auto-GC'ed because the usecase for universes is for experimentation, not for users to use this as their main source of JLLs. I want to use these within Yggdrasil to allow us to open a PR that builds multiple, interdependent packages, and use the builds from the bottom of the stack as dependencies for the top of the stack, without having to register in-between. If we're creating a universe per-PR, I want to be sure that they will be removed after a while.

src/AutoBuild.jl Show resolved Hide resolved
src/AutoBuild.jl Outdated Show resolved Hide resolved
src/AutoBuild.jl Outdated Show resolved Hide resolved
src/AutoBuild.jl Outdated Show resolved Hide resolved
src/AutoBuild.jl Outdated Show resolved Hide resolved
@Keno Keno force-pushed the kf/universes branch 3 times, most recently from f2f0ef2 to f30914b Compare September 3, 2020 22:25
This adds the concept of a "universe" for autobuilds. A universe
is essentially a depot that has its own copy of the General registry.
When building packages using `--deploy=universe` the built jll gets
registered into this copy of the registry and subsequent builds can
pick it up from there as if it had been registered with the real
general registry. This allows successive builds of dependent packages
without first having to go register the dependency. The universe
to use is specified using `--universe=<name>`. If a universe by
that name does not exist, it is created. Otherwise the previously
created universe is re-used.
src/AutoBuild.jl Outdated Show resolved Hide resolved
src/AutoBuild.jl Outdated Show resolved Hide resolved
src/AutoBuild.jl Outdated Show resolved Hide resolved
src/AutoBuild.jl Outdated Show resolved Hide resolved
if deploy_bin || deploy_jll
code_dir = joinpath(Pkg.devdir(), "$(src_name)_jll")
if universe
code_dir = joinpath(universe_path, "clones", string(jll_uuid("$(src_name)_jll")))
Copy link
Member

Choose a reason for hiding this comment

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

What's the reason for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes the commit available to the regular logic to just check it out from clones

Copy link
Member

Choose a reason for hiding this comment

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

Okay. Could alternatively put in the devdir path as the url in the registry, right? I guess this avoids one layer of indirection since Pkg would cache it here anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this seemed easier.

Copy link
Member

Choose a reason for hiding this comment

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

I'm confused; the clones directory in my normal depot is a bunch of bare repositories, and the names are all numeric, not UUIDs.

Copy link
Member

Choose a reason for hiding this comment

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

Yea, cold be stored wherever. I don't think Pkg will pick this up.

Keno and others added 2 commits September 3, 2020 20:10
Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com>
Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants