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

sapphire-localnet: Use Mock SGX for spinning up Oasis stack #601

Merged
merged 3 commits into from
Sep 5, 2024

Conversation

matevz
Copy link
Member

@matevz matevz commented Aug 23, 2024

This PR:

  • Implements sapphire-paratime: Add mock SGX support sapphire-paratime#356 for sapphire-localnet docker images.
  • Revamps the Dockerfiles so that you can pick whether you want to build components from git sources or just download the releases. Both is done in oasis-core-dev image now, so this reduced the final sapphire-localnet image size from ~598MB to ~434MB.

Merge after oasisprotocol/sapphire-paratime#357

@matevz matevz self-assigned this Aug 23, 2024
@matevz matevz force-pushed the matevz/feature/sapphire-mock-sgx branch 3 times, most recently from 57011ea to 65ea76a Compare August 30, 2024 15:39
@matevz matevz marked this pull request as ready for review August 30, 2024 15:39
@abukosek
Copy link
Contributor

abukosek commented Sep 2, 2024

How does this change affect the size of the Docker images?

@matevz
Copy link
Member Author

matevz commented Sep 2, 2024

How does this change affect the size of the Docker images?

Some benchmarks.

After:

REPOSITORY                                TAG             IMAGE ID       CREATED              SIZE
ghcr.io/oasisprotocol/sapphire-localnet   local           7f42933d6152   23 seconds ago       792MB

Before (using sapphire 0.8.2-testnet and oasis-core 24.2):

REPOSITORY                                TAG             IMAGE ID       CREATED        SIZE
ghcr.io/oasisprotocol/sapphire-localnet   local           c2d1a68a8318   17 hours ago   598MB

@abukosek
Copy link
Contributor

abukosek commented Sep 2, 2024

The previous size of the sapphire-localnet image was 590MB, so adding another 200MB on top of that is not cool :)

REPOSITORY                                TAG       IMAGE ID       CREATED       SIZE
ghcr.io/oasisprotocol/sapphire-localnet   latest    c32cb733de0d   7 weeks ago   590MB

@matevz
Copy link
Member Author

matevz commented Sep 2, 2024

The previous size of the sapphire-localnet image was 590MB, so adding another 200MB on top of that is not cool :)

REPOSITORY                                TAG       IMAGE ID       CREATED       SIZE
ghcr.io/oasisprotocol/sapphire-localnet   latest    c32cb733de0d   7 weeks ago   590MB

Interesting. The size should not have increased. Let me check on this.

Edit: I managed to reduce it down to 666MB. I can't seem to spot any notable differences though apart from version bumps.

REPOSITORY                                TAG             IMAGE ID       CREATED             SIZE
ghcr.io/oasisprotocol/sapphire-localnet   local           cf888b77831a   16 minutes ago      666MB

@matevz matevz force-pushed the matevz/feature/sapphire-mock-sgx branch from 65ea76a to 8673fff Compare September 2, 2024 14:52
@matevz matevz force-pushed the matevz/feature/sapphire-mock-sgx branch 4 times, most recently from 026273a to cf53135 Compare September 3, 2024 09:34
@matevz
Copy link
Member Author

matevz commented Sep 3, 2024

Found the image size issue. Running strip -S -x in the production image makes dangling files for old binary instances. I strip the binaries in the oasis-core-dev image now and space savings in the production image are significant.

REPOSITORY                                TAG             IMAGE ID       CREATED         SIZE
ghcr.io/oasisprotocol/sapphire-localnet   local           89c97ef2f7d9   4 minutes ago   434MB

@matevz matevz force-pushed the matevz/feature/sapphire-mock-sgx branch 4 times, most recently from 3b2c791 to f777099 Compare September 3, 2024 10:16
Adds snippets to support both locally built compoments (for debugging) or
releases (default and faster).
@matevz matevz force-pushed the matevz/feature/sapphire-mock-sgx branch 2 times, most recently from 6ae9f39 to e60972c Compare September 4, 2024 07:58
@ptrus ptrus force-pushed the matevz/feature/sapphire-mock-sgx branch 2 times, most recently from daabf36 to 53a3a49 Compare September 5, 2024 09:10
@ptrus ptrus force-pushed the matevz/feature/sapphire-mock-sgx branch from 53a3a49 to fa6c4d7 Compare September 5, 2024 09:17
@ptrus ptrus merged commit 4970ceb into main Sep 5, 2024
6 checks passed
@ptrus ptrus deleted the matevz/feature/sapphire-mock-sgx branch September 5, 2024 09:23
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

Successfully merging this pull request may close these issues.

3 participants