Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

feat(*): fetch from wasmcloud cache on inspect commands #204

Merged

Conversation

matthewtgilbride
Copy link
Contributor

@matthewtgilbride matthewtgilbride commented Nov 21, 2021

Closes #138

Copy link
Member

@brooksmtownsend brooksmtownsend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff @matthewtgilbride, really only had one nit comment here.

src/claims.rs Outdated Show resolved Hide resolved
src/par.rs Outdated Show resolved Hide resolved
@matthewtgilbride
Copy link
Contributor Author

matthewtgilbride commented Nov 21, 2021

Great stuff @matthewtgilbride, really only had one nit comment here.

Thanks @brooksmtownsend - renamed things to "local_artifact" and "cached_artifact - along moving the local/cache/remote helper to reg.rs.

I'm wondering what the best way to test this is? I was thinking of jamming the echo.wasm file into the cache directory similarly to how it's added to the local directory here. Then I was going to add a call to get the remote actor before the push command to see if it would get pulled from the cache. Feels a bit awkward...thoughts?

@brooksmtownsend
Copy link
Member

Thanks @brooksmtownsend - renamed things to "local_artifact" and "cached_artifact - along moving the local/cache/remote helper to reg.rs.

I'm wondering what the best way to test this is? I was thinking of jamming the echo.wasm file into the cache directory similarly to how it's added to the local directory here. Then I was going to add a call to get the remote actor before the push command to see if it would get pulled from the cache. Feels a bit awkward...thoughts?

I think that's a good idea, a good baseline would be a unit test just to verify:

should produce a file like wasmcloud_azurecr_io_kvcounter_v1.bin

One great way you could test this is exactly what you suggested, throw the echo.wasm in the temp directory under a name like fakeoci_io_echo_v1.bin and then try to inspect faceoci.io/echo:v1 and even though that doesn't exist, the cached file should be retrieved instead

Copy link
Member

@brooksmtownsend brooksmtownsend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM @matthewtgilbride, just need the DCO fix 😄 If you check the workflow details it'll tell you the command you can run

@matthewtgilbride matthewtgilbride force-pushed the feature/cached-inspect branch 3 times, most recently from a22af42 to 404d9db Compare November 22, 2021 23:02
- includes new --no-cache option for inspect commands

Signed-off-by: matthewtgilbride <matthewtgilbride@gmail.com>
@matthewtgilbride
Copy link
Contributor Author

matthewtgilbride commented Nov 22, 2021

👍 think I'm ready. Added the --no-cache option so take a look before approving.

@matthewtgilbride matthewtgilbride marked this pull request as ready for review November 22, 2021 23:05
Copy link
Member

@brooksmtownsend brooksmtownsend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought of one more request... could you also add a test for the provider so that we test that works as well? I figure having a wash claims inspect + wash par inspect would be great

@matthewtgilbride
Copy link
Contributor Author

I thought of one more request... could you also add a test for the provider so that we test that works as well? I figure having a wash claims inspect + wash par inspect would be great

🦃 done

Interestingly the wash par inspect integration tests are really slow. Way slower than it should take to download/push the httpclient provider a couple of times. 🤔

@brooksmtownsend
Copy link
Member

Interestingly the wash par inspect integration tests are really slow. Way slower than it should take to download/push the httpclient provider a couple of times. 🤔

That's a fun one actually that we worried about as we started, turns out the whole compress/decompress part of the gzip library we use is SUPER slow in debug mode, so hopefully if we try with release mode that doesn't reproduce

Signed-off-by: matthewtgilbride <matthewtgilbride@gmail.com>
Copy link
Member

@brooksmtownsend brooksmtownsend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, and should be ready to merge as soon as the tests run and pass 🚀

@brooksmtownsend brooksmtownsend merged commit 95b3252 into wasmCloud:main Nov 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Use wasmcloud cache for inspect commands
2 participants