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

Add push_example script #1229

Merged
merged 3 commits into from
Jul 10, 2020
Merged

Add push_example script #1229

merged 3 commits into from
Jul 10, 2020

Conversation

ipetr0v
Copy link
Contributor

@ipetr0v ipetr0v commented Jul 3, 2020

This change adds a script for saving example modules in Google Storage.

Ref #1183

Checklist

  • Pull request includes prototype/experimental work that is under
    construction.

@ipetr0v ipetr0v requested a review from tiziano88 July 3, 2020 12:50
@ipetr0v ipetr0v marked this pull request as draft July 3, 2020 12:50
@codecov-commenter
Copy link

codecov-commenter commented Jul 3, 2020

Codecov Report

Merging #1229 into main will increase coverage by 0.17%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1229      +/-   ##
==========================================
+ Coverage   31.56%   31.73%   +0.17%     
==========================================
  Files          53       53              
  Lines        6787     6793       +6     
  Branches     3195     3198       +3     
==========================================
+ Hits         2142     2156      +14     
+ Misses       2703     2680      -23     
- Partials     1942     1957      +15     
Impacted Files Coverage Δ
oak/server/rust/oak_loader/src/main.rs 23.58% <0.00%> (+0.58%) ⬆️
sdk/rust/oak/src/io/mod.rs 25.43% <0.00%> (+5.26%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3eaa83d...fc1201b. Read the comment docs.

Comment on lines +7 to +24
while getopts "e:h" opt; do
case "${opt}" in
h)
echo -e "Usage: ${0} [-h] -e EXAMPLE

Save example modules in Google Cloud Storage.

Options:
-e Example application name (required)
-h Print Help (this message) and exit"
exit 0;;
e)
readonly EXAMPLE="${OPTARG}";;
*)
echo "Invalid argument: ${OPTARG}"
exit 1;;
esac
done
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems excessive :) The error message below should be enough I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just making it similar to other scripts that use -e for referring to an example.

Copy link
Contributor

Choose a reason for hiding this comment

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

I still suggest we use -e for the example.. but seeing that this has only one way to use it, I don't think we need all the getops code for it. If you remove this and it's not used correctly, it will still print the correct message

Copy link
Collaborator

Choose a reason for hiding this comment

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

I have only one word to add, and I am not even going to actually mention it :) (it starts with R)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can just make it so that ${1} will be -e and ${2} will be a parameter.
But I think it will be less readable.

Copy link
Collaborator

Choose a reason for hiding this comment

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

let's keep as it is for now, and think what to do about it in runner perhaps in the future.

scripts/push_example Outdated Show resolved Hide resolved
@ipetr0v
Copy link
Contributor Author

ipetr0v commented Jul 3, 2020

The only problem with this script, is that in order to build reproducibly, we need to build examples in Docker.
But our Docker image doesn't have GCP api installed (and probably shouldn't), so pushing examples should be done outside of Docker.

@ipetr0v ipetr0v marked this pull request as ready for review July 3, 2020 16:20
@ipetr0v ipetr0v requested review from tiziano88 and removed request for tiziano88 July 7, 2020 13:45
Comment on lines +7 to +24
while getopts "e:h" opt; do
case "${opt}" in
h)
echo -e "Usage: ${0} [-h] -e EXAMPLE

Save example modules in Google Cloud Storage.

Options:
-e Example application name (required)
-h Print Help (this message) and exit"
exit 0;;
e)
readonly EXAMPLE="${OPTARG}";;
*)
echo "Invalid argument: ${OPTARG}"
exit 1;;
esac
done
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's keep as it is for now, and think what to do about it in runner perhaps in the future.

@ipetr0v ipetr0v merged commit d1e6497 into project-oak:main Jul 10, 2020
@ipetr0v ipetr0v deleted the gcp_push_examples branch July 10, 2020 14:38
@github-actions
Copy link

Reproducibility Index:

815d0815e5ca74b2f26d2d619ce6a85e88e2c7941c7e894390b4ad0a39afe9a9  ./examples/target/wasm32-unknown-unknown/release/abitest_0_frontend.wasm
457ba75931f7e22ec7ebcaa6ae05d3e0dd6f11570a08f07c2a6fd0b1b42a8d38  ./examples/target/wasm32-unknown-unknown/release/abitest_1_backend.wasm
5b9dc0b57f1bddb468ded79043984ad42cfa75794b9663c5ce7bf0322c9648ec  ./examples/target/wasm32-unknown-unknown/release/aggregator.wasm
0dc9e4ee50ce2224e39e354a0cbe0dc337d728b9754fd8ef7ab480c48cc4efbe  ./examples/target/wasm32-unknown-unknown/release/chat.wasm
f48fc1118d367ebb47d2765587622670d1b9a52e9858043173340e228a3a8664  ./examples/target/wasm32-unknown-unknown/release/database_proxy.wasm
a0c0e2f762165c0928523fdf3a5b60a83604ac3d09f80b5ed84211428f6e5332  ./examples/target/wasm32-unknown-unknown/release/hello_world.wasm
df1a5f037bce9ca20b556f50c7cd1bf1780cbf0d378609462f18f5d5b8589ffb  ./examples/target/wasm32-unknown-unknown/release/injection.wasm
411ffccff5538a6541991e6665fb660c90c53348aa2e185b85131c02383ecd99  ./examples/target/wasm32-unknown-unknown/release/machine_learning.wasm
57ea2f959de4f1bbb70cf5acc26969726f78bb90866cc087fa77ec01c29ceb28  ./examples/target/wasm32-unknown-unknown/release/private_set_intersection.wasm
6b450333f5d36c454a186af9add9f29f9326162cb4b5516b41ff9f29cd9b87e0  ./examples/target/wasm32-unknown-unknown/release/running_average.wasm
849708ee562d66ec7c0a8b0f65d509bae4c1e4c7381e72b4b1ae9091be7e3454  ./examples/target/wasm32-unknown-unknown/release/translator.wasm
cd393c0c7a97265fdb8ca514cdfcee7d8379d84c1019262a71267c2c7df12491  ./examples/target/wasm32-unknown-unknown/release/trusted_information_retrieval.wasm
7f1e1ecff2ab9845dbbe8cf93ede831ec7b5d4e0efebe6718e0c9017ec254a3e  ./oak/server/target/x86_64-unknown-linux-musl/release/oak_loader

Reproducibility Index diff:

diff --git a/reproducibility_index b/reproducibility_index
index 297a0b3..e81a0b4 100644
--- a/reproducibility_index
+++ b/reproducibility_index
@@ -10,4 +10,4 @@ df1a5f037bce9ca20b556f50c7cd1bf1780cbf0d378609462f18f5d5b8589ffb  ./examples/tar
 6b450333f5d36c454a186af9add9f29f9326162cb4b5516b41ff9f29cd9b87e0  ./examples/target/wasm32-unknown-unknown/release/running_average.wasm
 849708ee562d66ec7c0a8b0f65d509bae4c1e4c7381e72b4b1ae9091be7e3454  ./examples/target/wasm32-unknown-unknown/release/translator.wasm
 cd393c0c7a97265fdb8ca514cdfcee7d8379d84c1019262a71267c2c7df12491  ./examples/target/wasm32-unknown-unknown/release/trusted_information_retrieval.wasm
-f7e04fec862016c4c4dfdb816062cd5227cf8325b3340e5cdbf7d29ff7d5a714  ./oak/server/target/x86_64-unknown-linux-musl/release/oak_loader
+7f1e1ecff2ab9845dbbe8cf93ede831ec7b5d4e0efebe6718e0c9017ec254a3e  ./oak/server/target/x86_64-unknown-linux-musl/release/oak_loader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants