Fix/separate migration bins#7857
Merged
Merged
Conversation
bc5ef0c to
51d4d82
Compare
This was referenced Jan 12, 2021
3ac27bc to
13c8d0f
Compare
The code in this PR finds the necessary mirgations, downloads the latest version of them from the distribution site, unpacks the executables, and runs the migrations in order. This code is also used to build the ipfs-update tool and the fs-repo-migrations tool. Note: the fs-repo-migrations tool is only used to run stand-alone migrations now and is not used by either go-ipfs or ipfs-update. Additional utility is provided by this PR, that is not specific to migrations: - Find local ipfs directory - Get current repo version - Check for ipfs daemon availability - Get version information about any distribution on distribution site - Fetch and unpack any binary executable over ipfs or http
Since the migrations are not displayed on the dirtributions, there is not need to organize them under their own root to reduce visual clutter. Having each migration follow the same path as all other distributions makes each easier to find in the absence of a link displayed on the distributions web page. It also avoids complicating the distribution deployment scripts and allows each migration distribution to be treated the same as any other distribution.
- IpfsDir gets the location of the ipfs directory, whether it exists or not - CheckIpfsDir get the location and checks whether it exists.
…since that breaks tests that get the version to see if ipfs is initialized
- Udate path to IPFS dist - Improve test coverage
13c8d0f to
0942e3b
Compare
gammazero
commented
Feb 12, 2021
aschmahmann
requested changes
Feb 23, 2021
aschmahmann
left a comment
Contributor
There was a problem hiding this comment.
Left a number of comments, questions and suggestions.
One of the recurrent things is that the tests seem to assume we're online which doesn't seem like a great idea for Go tests which are supposed to be more like unit tests than integration tests. We can go into it more on the threaded comments though.
d5f736e to
e3b77c8
Compare
e3b77c8 to
fcbe47b
Compare
917702a to
852dfab
Compare
aschmahmann
requested changes
Mar 15, 2021
aschmahmann
reviewed
Mar 16, 2021
aschmahmann
left a comment
Contributor
There was a problem hiding this comment.
Left a few small comments, but LGTM.
* rename migrations from ipfs-x-to-y to fs-repo-x-to-y * update current ipfs dist to one with migrations v1.0.0
… does not support read-only directories
71f5028 to
2fc1594
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fetch Individual Migrations as Needed for Update
This PR provides new logic to fetch individual migrations from the IPFS distribution site, instead of fetching a monolithic binary that contains all migrations. This is in support of future migrations as described in fs-repo-migrations/issues/98. Each migration is available as an individual distribution so that only the migrations needed for an upgrade are fetched from the distribution site and unpacked. Logic is included to execute migrations in forwards or reverse order, for upgrade and revert respectively.
Consolidate Distribution Fetch Logic
This PR consolidates logic for fetching files from the IPFS distribution site that was partially duplicated in ipfs/fs-repo-migrations and in ipfs/ipfs-update. Those projects now import their distribution fetch logic from this library.
This PR relies on the distributions PR 327