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

Linking or copying consistent metadata #374

Closed
vladimir-v-diaz opened this issue Sep 29, 2016 · 3 comments
Closed

Linking or copying consistent metadata #374

vladimir-v-diaz opened this issue Sep 29, 2016 · 3 comments

Comments

@vladimir-v-diaz
Copy link
Contributor

A contributor reports:

When making changes, always hard linking old versions to the current will result in all previous versions (1.root, 2.root, etc) pointing to the current (root.json).

Writing the consistent version and then linking the current to that (e.g. linking root.json -> 3.root.json) should work, but requires more changes because now "write current" doesn't happen in every case. Holding two copies is a small constant increase in storage (#versions -> #versions + 1)

Either solution is fine, I left the commented code to remind myself about the issue and clearly forgot to come back to it!

We probably want to support the second solution (for clients / devices with limited space). Creating a true copy or a hard link should also probably be an option (i.e., tuf.conf.consistent_method = copy (or link)).

@JustinCappos
Copy link
Member

Did this get addressed? We discussed this a long ways back.

On Thu, Sep 29, 2016 at 10:02 AM, Vladimir Diaz [email protected]
wrote:

A contributor reports:

When making changes, always hard linking old versions to the current will
result in all previous versions (1.root, 2.root, etc) pointing to the
current (root.json).

Writing the consistent version and then linking the current to that (e.g.
linking root.json -> 3.root.json) should work, but requires more changes
because now "write current" doesn't happen in every case. Holding two
copies is a small constant increase in storage (#versions -> #versions + 1)

Either solution is fine, I left the commented code to remind myself about
the issue and clearly forgot to come back to it!

We probably want to support the second solution (for clients / devices
with limited space). Creating a true copy or a hard link should also
probably be an option (i.e., tuf.conf.consistent_method = copy (or link)).


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#374, or mute the thread
https://github.com/notifications/unsubscribe-auth/AA0XD_x61vfWtgML4aW4vUHM2P0nTkxaks5qu8TfgaJpZM4KKB0Y
.

vladimir-v-diaz added a commit to vladimir-v-diaz/tuf that referenced this issue Oct 18, 2016
If writting a consistent snapshot, the snapshot should be written first and and then a copy or link to it should be created.
@vladimir-v-diaz
Copy link
Contributor Author

I partially implemented this here: https://github.com/vladimir-v-diaz/tuf/blob/ecordell-root-versioning/tuf/repository_lib.py#L2015-L2047. The fix points root.json to specific consistent snapshots.

@kwang100 is working on the configurable option to either create a copy of the consistent snapshot, or a link to it.

Consistent snapshots are now written as follows:

[2016-10-18 17:33:53,016 UTC] [tuf.repository_lib] [INFO] [write_metadata_file:2031@repository_lib.py]
Creating a consistent snapshot for u'/home/vlad/projects/tuf/tests/tmp6TEQkg/tmpL3SxRM/repository/metadata.staged/root.json'

[2016-10-18 17:33:53,016 UTC] [tuf.repository_lib] [DEBUG] [write_metadata_file:2032@repository_lib.py]
Saving u'/home/vlad/projects/tuf/tests/tmp6TEQkg/tmpL3SxRM/repository/metadata.staged/2.root.json'

[2016-10-18 17:33:53,022 UTC] [tuf.repository_lib] [INFO] [write_metadata_file:2041@repository_lib.py]
Pointing u'/home/vlad/projects/tuf/tests/tmp6TEQkg/tmpL3SxRM/repository/metadata.staged/root.json' to the consistent snapshot.

[2016-10-18 17:33:53,023 UTC] [tuf.repository_lib] [INFO] [_write_compressed_metadata:2139@repository_lib.py]
Saving u'/home/vlad/projects/tuf/tests/tmp6TEQkg/tmpL3SxRM/repository/metadata.staged/2.root.json.gz'

[2016-10-18 17:33:53,029 UTC] [tuf.repository_lib] [INFO] [write_metadata_file:2045@repository_lib.py]
Not creating a consistent snapshot for u'/home/vlad/projects/tuf/tests/tmp6TEQkg/tmpL3SxRM/repository/metadata.staged/snapshot.json'
...

FelixWang1994 added a commit to FelixWang1994/tuf that referenced this issue Oct 21, 2016
… to realize consistent snapshot

2. Repository_lib.py line 478 minor bug correction
3. Solve issue theupdateframework#374 theupdateframework#374
4. Repoistory_tool.py line 791 TODO reminder for no-longer-used keys
5. Some other corrections on comments
FelixWang1994 added a commit to FelixWang1994/tuf that referenced this issue Oct 24, 2016
… to realize consistent snapshot

2. Repository_lib.py line 478 minor bug correction
3. Solve issue theupdateframework#374 theupdateframework#374
4. Repoistory_tool.py line 791 TODO reminder for no-longer-used keys
5. Some other corrections on comments
@vladimir-v-diaz
Copy link
Contributor Author

This issue has now been fully addressed. Remaining feature (option to use either a hard link or file copy) merged in PR #385

@vladimir-v-diaz vladimir-v-diaz changed the title Linking or copying consistent snapshots Linking or copying consistent metadata Nov 4, 2016
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

No branches or pull requests

2 participants