-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix/separate migration bins #7857
Conversation
bc5ef0c
to
51d4d82
Compare
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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