dfinity / snsdemo

Developer focused SNS deployment demo
15 stars 6 forks source link

Include only network/local in Linux snapshot #396

Closed dskloetd closed 4 weeks ago

dskloetd commented 4 weeks ago

Motivation

I noticed that snapshots created on Linux were getting huge (> 600 MB), compared to snapshots created on Mac (~ 130 MB). Inspecting the contents, it turned out that the snapshot includes full installations of all versions of dfx present on the system.

Changes

  1. Include .local/share/dfx/network/local in the archive instead of all of .local/share/dfx. This matches having Library/Application Support/org.dfinity.dfx/network/local on Mac, rather than all of Library/Application Support/org.dfinity.dfx.
  2. Fix bin/dfx-snapshot-restore to not delete all of .local/share/dfx.

Tested

  1. CI still passes and runs on Linux.
  2. Manually created a snapshot on DevEnv and was able to use it. Checked its size and it was 124 MB.