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

Move RLBase, RLCore, RLEnvs, RLZoo into RL #35965

Conversation

findmyway
Copy link
Contributor

Hi @GunnarFarneback ,

Based on @StefanKarpinski 's suggestion, I used the git-filter-repo tool according to the answer here: https://stackoverflow.com/a/10548919/3401312 to update the git tree hash in the meanwhile. Please let me know if did anything wrong here.

Thanks!

@GunnarFarneback
Copy link
Contributor

I don't know what you did more exactly but changing the stored content hashes in the repository is totally out of the question. That would imply that there is now something else in those versions than when they were released.

@StefanKarpinski
Copy link
Contributor

Julia package versions are associated with specific git trees and this association is immutable — once you've published a version, that's what it is. You're never allowed to change it. In order not to break the ability to git clone a package and checkout older versions, you need to make sure that however you've rewritten the repo, those exact trees are still there in the repo history somewhere. You can move the history of a package to a subdirectory of a new repo and things will be fine since the original trees are still there, they've just been moved to a subdirectory — but nothing in that subdirectory can change, just the location of it in the repo. You can also rewrite all the commit history between released versions: the version is associated with a tree, not a commit (which includes the entire development history of how it was created). It is unclear to me what you've done here and what you're trying to do. Can you explain a little what you're attempting to accomplish?

@DilumAluthge
Copy link
Member

Maybe it would be good if we had a tutorial on how to use git-filter-repo to move the history of a package into a subdirectory in a way that preserves the tree hashes. Then we can point package authors to that tutorial.

@StefanKarpinski
Copy link
Contributor

Ok, I checked out both ReinforcementLearning.jl and ReinforcementLearningBase.jl and the tree rewriting seems to have been done correctly. The latest tree for ReinforcementLearningBase.jl matches ReinforcementLearning.jl/src/ReinforcementLearningBase. So that's good. And ReinforcementLearning.jl has the right tree objects in it. For example:

$ git show f548233ca31a278818454e549406ac8f34135ba2
tree f548233ca31a278818454e549406ac8f34135ba2

.gitignore
.travis.yml
Project.toml
README.md
REQUIRE
src/
test/

Now for some reason this change to General tries to replace the trees for versions with commits. I'm not entirely sure what those commits are, but since versions are associated with trees rather than commits, that's clearly wrong. I think this change might be correct if you just drop all the hash changes.

@findmyway
Copy link
Contributor Author

Now for some reason this change to General tries to replace the trees for versions with commits. I'm not entirely sure what those commits are, but since versions are associated with trees rather than commits, that's clearly wrong. I think this change might be correct if you just drop all the hash changes.

Those changes were commit ids associated with version tags. I had confused the commit id with tree id. Now I understand why it's wrong. They are restored now. Thanks!

@findmyway findmyway marked this pull request as ready for review May 4, 2021 03:40
@findmyway
Copy link
Contributor Author

Hi @GunnarFarneback , @fredrikekre , @DilumAluthge ,

I've tested my fork locally and it seems all the previous versions of ReinforcementLearning.jl can be installed correctly. So I think it is good to merge this now? 😃

@GunnarFarneback
Copy link
Contributor

I've confirmed that all trees can be found by running

git clone https://github.com/JuliaReinforcementLearning/ReinforcementLearning.jl.git
cd ReinforcementLearning.jl
julia

and then this code:

using TOML
for pkg in ["ReinforcementLearningBase",
	    "ReinforcementLearningCore",
	    "ReinforcementLearningEnvironments",
	    "ReinforcementLearningZoo"]
    println(pkg)
    versions = TOML.parsefile(joinpath(first(DEPOT_PATH), "registries",
                              "General", pkg[1:1], pkg, "Versions.toml"))
    for version in sort(collect(keys(versions)))
        tree_sha = versions[version]["git-tree-sha1"]
        print(version)
        try
            readchomp(`git rev-parse -q --verify "$(tree_sha)^{tree}"`)
            println(" found")
        catch
            println(" missing")
        end
    end
end

@fredrikekre fredrikekre merged commit 9c5bdc8 into JuliaRegistries:master May 5, 2021
findmyway added a commit to findmyway/General that referenced this pull request Jun 6, 2021
This is a following up of JuliaRegistries#35965

I've tested it locally based on JuliaRegistries#35965 (comment) and the only tagged version of DistributedReinforcementLearning@v0.1.0 is found.
giordano pushed a commit that referenced this pull request Jul 7, 2021
This is a following up of #35965

I've tested it locally based on #35965 (comment) and the only tagged version of DistributedReinforcementLearning@v0.1.0 is found.
@giordano giordano mentioned this pull request May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants