From 746556dd76853e049ac6dbe832fa02ccdfb0bd4a Mon Sep 17 00:00:00 2001 From: Nicholas Ngai Date: Thu, 27 Apr 2023 23:03:08 -0700 Subject: [PATCH 1/7] Add recursive submodule command --- README.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a385155..4736c74 100644 --- a/README.md +++ b/README.md @@ -244,13 +244,20 @@ All figures produced by this artifact are located in `~/snoopy/experiments/artif # Playing with Snoopy ## Building Snoopy Locally + +Make sure submodules are cloned recurisvely: + +```sh +git submodule update --init --recursive +``` + +You could also have cloned this repo with `git clone --recursive REPO_URL` to do this automatically. + Protobuf: ```sh # On ubuntu 18.04 sudo apt-get install build-essential autoconf libtool pkg-config automake zlib1g-dev -cd third_party -git submodule update --init -cd protobuf/cmake +cd third_party/protobuf mkdir build cd build cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/../install .. @@ -260,8 +267,7 @@ make install gRPC (requires protobuf first): ```sh -cd grpc -git submodule update --init +cd third_party/grpc mkdir build cd build cmake -DCMAKE_PREFIX_PATH=`pwd`/../../protobuf/cmake/install -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF \ From 888c6d0bd21449cae095c7ba7864f115f452465e Mon Sep 17 00:00:00 2001 From: Nicholas Ngai Date: Thu, 27 Apr 2023 23:03:32 -0700 Subject: [PATCH 2/7] Add make -j to README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4736c74..73c364c 100644 --- a/README.md +++ b/README.md @@ -261,7 +261,7 @@ cd third_party/protobuf mkdir build cd build cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/../install .. -make -j `nproc` +make -j make install ``` @@ -275,7 +275,7 @@ cmake -DCMAKE_PREFIX_PATH=`pwd`/../../protobuf/cmake/install -DgRPC_INSTALL=ON - -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=`pwd`/install \ ../ -make +make -j make install ``` From f525d5a7073955e00999e67cc00c2d9d9469e398 Mon Sep 17 00:00:00 2001 From: Nicholas Ngai Date: Thu, 27 Apr 2023 23:03:51 -0700 Subject: [PATCH 3/7] Fix protobuf and grpc cmake build paths in README --- CMakeLists.txt | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63d01c4..cd046f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ find_package(OpenEnclave CONFIG REQUIRED) find_package(OpenSSL REQUIRED) # GRPC and Protocol Buffers libraries location -list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/third_party/protobuf/install" "${CMAKE_SOURCE_DIR}/third_party/grpc/build/install") +list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/third_party/protobuf/install" "${CMAKE_SOURCE_DIR}/third_party/grpc/install") # Cmake find modules list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") diff --git a/README.md b/README.md index 73c364c..6711c5a 100644 --- a/README.md +++ b/README.md @@ -260,7 +260,7 @@ sudo apt-get install build-essential autoconf libtool pkg-config automake zlib1g cd third_party/protobuf mkdir build cd build -cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/../install .. +cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/../install ../cmake make -j make install ``` @@ -270,10 +270,10 @@ gRPC (requires protobuf first): cd third_party/grpc mkdir build cd build -cmake -DCMAKE_PREFIX_PATH=`pwd`/../../protobuf/cmake/install -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF \ +cmake -DCMAKE_PREFIX_PATH=`pwd`/../../protobuf/install -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF \ -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_ZLIB_PROVIDER=package -DgRPC_CARES_PROVIDER=module -DgRPC_SSL_PROVIDER=package \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=`pwd`/install \ + -DCMAKE_INSTALL_PREFIX=`pwd`/../install \ ../ make -j make install From e6162f7a59d764ba3a3a0610e5b8e7493ea06e86 Mon Sep 17 00:00:00 2001 From: Nicholas Ngai Date: Thu, 27 Apr 2023 23:04:08 -0700 Subject: [PATCH 4/7] Add Snoopy final compile command to README --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 6711c5a..64dc501 100644 --- a/README.md +++ b/README.md @@ -281,6 +281,13 @@ make install Need to put boost library in `/usr/local/` (doesn't need to be built or installed). +Compile Snoopy: +```sh +mkdir build +cmake .. +make -j suboram && make -j +``` + Running anything in the `scripts` directory: Follow instructions here: https://docs.microsoft.com/en-us/azure/developer/python/configure-local-development-environment?tabs=cmd From c0b401bf376ae680a5be92b2643b8d178c03e059 Mon Sep 17 00:00:00 2001 From: Nicholas Ngai Date: Thu, 27 Apr 2023 23:05:58 -0700 Subject: [PATCH 5/7] Add Ubuntu 20.04 g++-7 README line --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 64dc501..9d82be3 100644 --- a/README.md +++ b/README.md @@ -253,6 +253,8 @@ git submodule update --init --recursive You could also have cloned this repo with `git clone --recursive REPO_URL` to do this automatically. +**On Ubuntu 20.04 or later, you will need to install g++-7 and replace all instances of `cmake` with `CXX=g++-7 cmake` in the below commands.** This code relies on intrinsic builtins present in g++ 7 but not later versions of g++. + Protobuf: ```sh # On ubuntu 18.04 From bdb32ebde55192f4f03ec27f5c8ab70d47d80102 Mon Sep 17 00:00:00 2001 From: Nicholas Ngai Date: Fri, 28 Apr 2023 11:44:47 -0700 Subject: [PATCH 6/7] Use make -j`nproc` instead to avoid OOM --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9d82be3..576be9e 100644 --- a/README.md +++ b/README.md @@ -263,7 +263,7 @@ cd third_party/protobuf mkdir build cd build cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/../install ../cmake -make -j +make -j`nproc` make install ``` @@ -277,7 +277,7 @@ cmake -DCMAKE_PREFIX_PATH=`pwd`/../../protobuf/install -DgRPC_INSTALL=ON -DgRPC_ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=`pwd`/../install \ ../ -make -j +make -j`nproc` make install ``` From 1345b1a73d1c2f9d0a063d29f54c15b024fdd4d7 Mon Sep 17 00:00:00 2001 From: Nicholas Ngai Date: Mon, 15 May 2023 15:44:31 -0700 Subject: [PATCH 7/7] Freeze dependency versions in requirements.txt --- requirements.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/requirements.txt b/requirements.txt index 7dfcef0..1eb76de 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ -azure-mgmt-resource -azure-mgmt-compute -azure-mgmt-network -azure-identity -numpy -matplotlib -seaborn -tqdm -brewer2mpl +azure-mgmt-resource==19.0.0 +azure-mgmt-compute==19.0.0 +azure-mgmt-network==19.0.0 +azure-identity==1.13.0 +numpy==1.24.3 +matplotlib==3.7.1 +seaborn==0.12.2 +tqdm==4.65.0 +brewer2mpl==1.4.1