Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 07d6669

Browse files
Add install script (#228)
This PR adds an install script (`scripts/install.sh`) to automatically install all dependencies and generate necessary files (keys). It also contains changes to the documentation to show how to use this script instead of manually installing everything.
1 parent 47f1dbe commit 07d6669

File tree

7 files changed

+91
-18
lines changed

7 files changed

+91
-18
lines changed

‎.github/scripts/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ sudo mkdir /opt/spark/work
2626
sudo chmod -R a+wx /opt/spark/work
2727

2828
# Set Spark environment variables
29+
export SPARK_SCALA_VERSION=2.12
2930
export SPARK_HOME=/opt/spark
3031
export PATH=$PATH:/opt/spark/bin:/opt/spark/sbin
3132

‎.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ hs_err_pid*.log
9292
!/data/pagerank/PageRank256.in
9393
/data/disease/*.csv
9494
/data/tpch/tpch-dbgen
95-
/data/tpch/sf_small/*.tbl
95+
/data/tpch/sf_*/*.tbl
9696

9797
# For CMake
9898
Makefile

‎docs/src/contributing/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Opaque SQL enforces linting rules for all contributions. Before making changes a
4646

4747
.. code-block:: bash
4848
49-
./${OPAQUE_HOME}/format.sh
49+
./${OPAQUE_HOME}/scripts/format.sh
5050
5151
Debugging your changes
5252
######################

‎docs/src/install/install.rst

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,36 @@
22
Installation
33
************
44

5-
Dependencies
6-
############
5+
Using the install script
6+
########################
77

8-
After downloading the Opaque codebase, build and test it as follows.
8+
Opaque SQL has an install script (``opaque-sql/scripts/install.sh``) to take care of installing/downloading everything for Opaque SQL to work immediately. To use this, first clone/fork the repository, then run
9+
10+
.. code-block:: bash
11+
12+
cd opaque-sql
13+
source ./scripts/install.sh
14+
15+
Note that the ``source`` is necessary to properly set environment variables Opaque SQL needs. If alternatively you don't want to use the install script, see the section on :ref:`installing dependencies manually <deps_manual>` below. For testing, skip to :ref:`running tests<running_tests>`.
16+
17+
.. _deps_manual:
18+
19+
Installing dependencies manually
20+
################################
21+
22+
After downloading the Opaque codebase, install necessary dependencies as follows.
923

1024
1. Install dependencies and the `OpenEnclave SDK <https://github.com/openenclave/openenclave/blob/v0.12.0/docs/GettingStartedDocs/install_oe_sdk-Ubuntu_18.04.md>`_. We currently support OE version 0.12.0 (so please install with ``open-enclave=0.12.0``) and Ubuntu 18.04.
1125

1226
.. code-block:: bash
1327
1428
# For Ubuntu 18.04:
15-
sudo apt install wget build-essential openjdk-8-jdk python libssl-dev
29+
sudo apt -y install wget build-essential openjdk-8-jdk python libssl-dev
1630
17-
# Install a newer version of CMake (>= 3.13)
31+
# Install a newer version of CMake (3.15)
1832
wget https://github.com/Kitware/CMake/releases/download/v3.15.6/cmake-3.15.6-Linux-x86_64.sh
1933
sudo bash cmake-3.15.6-Linux-x86_64.sh --skip-license --prefix=/usr/local
34+
rm cmake-3.15.6-Linux-x86_64.sh
2035
2136
# Install Spark 3.1.1 (if not already done)
2237
wget https://downloads.apache.org/spark/spark-3.1.1/spark-3.1.1-bin-hadoop2.7.tgz
@@ -27,14 +42,7 @@ After downloading the Opaque codebase, build and test it as follows.
2742
sudo mkdir /opt/spark/work
2843
sudo chmod -R a+wx /opt/spark/work
2944
30-
# Set Spark environment variables in ~/.bashrc
31-
echo "" >> ~/.bashrc
32-
echo "# Spark settings" >> ~/.bashrc
33-
echo "export SPARK_HOME=/opt/spark" >> ~/.bashrc
34-
echo "export PATH=$PATH:/opt/spark/bin:/opt/spark/sbin" >> ~/.bashrc
35-
source ~/.bashrc
36-
37-
2. Change into the Opaque root directory and edit Opaque's environment variables in ``opaqueenv`` if desired. Export Opaque and OpenEnclave environment variables via
45+
2. Change into the Opaque root directory and edit Opaque's environment variables in ``opaqueenv`` (including Spark configurations) if desired. Export Opaque SQL and Open Enclave environment variables via
3846

3947
.. code-block:: bash
4048
@@ -68,13 +76,18 @@ After downloading the Opaque codebase, build and test it as follows.
6876
openssl rand -out /path/to/symmetric/key/shared_key.key 32
6977
export SYMMETRIC_KEY_PATH=/path/to/symmetric/key/symmetric_key.key
7078
71-
4. Run the Opaque tests:
79+
.. _running_tests:
80+
81+
Running tests
82+
#############
83+
84+
1. To run the Opaque tests:
7285

7386
.. code-block:: bash
7487
7588
build/sbt test
7689
77-
5. Alternatively, to generate coverage reports:
90+
2. Alternatively, to run tests *and* generate coverage reports:
7891

7992
.. code-block:: bash
8093

‎opaqueenv

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
export OPAQUE_HOME=$(pwd)
22
export OPAQUE_DATA_DIR=${OPAQUE_HOME}/data/
3-
export SPARK_SCALA_VERSION=2.12
3+
export SYMMETRIC_KEY_PATH=${OPAQUE_HOME}/symmetric_key.key
44
export PRIVATE_KEY_PATH=${OPAQUE_HOME}/src/test/keys/mc2_test_key.pem
55
export MODE=HARDWARE
66
export OE_SDK_PATH=/opt/openenclave/
7+
8+
# Spark settings
9+
export SPARK_SCALA_VERSION=2.12
10+
export SPARK_HOME=/opt/spark
11+
export PATH=$PATH:/opt/spark/bin:/opt/spark/sbin
File renamed without changes.

‎scripts/install.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
3+
# This is an installation script that will automatically install all Opaque SQL dependencies (including Spark).
4+
# Compatible with Ubuntu 18.04.
5+
6+
# Install the Open Enclave SDK
7+
# Instructions from https://github.com/openenclave/openenclave/blob/v0.12.0/docs/GettingStartedDocs/install_oe_sdk-Ubuntu_18.04.md
8+
echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu bionic main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
9+
wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
10+
11+
echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-7 main" | sudo tee /etc/apt/sources.list.d/llvm-toolchain-bionic-7.list
12+
wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
13+
14+
echo "deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main" | sudo tee /etc/apt/sources.list.d/msprod.list
15+
wget -qO - https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
16+
17+
sudo apt update
18+
19+
sudo apt -y install dkms
20+
wget https://download.01.org/intel-sgx/sgx-dcap/1.9/linux/distro/ubuntu18.04-server/sgx_linux_x64_driver_1.36.2.bin
21+
chmod +x sgx_linux_x64_driver_1.36.2.bin
22+
sudo ./sgx_linux_x64_driver_1.36.2.bin
23+
rm -rf sgx_linux_x64_driver_1.36.2.bin
24+
25+
sudo apt -y install clang-7 libssl-dev gdb libsgx-enclave-common libprotobuf10 libsgx-dcap-ql libsgx-dcap-ql-dev az-dcap-client open-enclave=0.12.0
26+
27+
# Install SBT dependencies
28+
sudo apt -y install wget build-essential openjdk-8-jdk python libssl-dev
29+
30+
# Install a newer version of CMake (3.15)
31+
wget https://github.com/Kitware/CMake/releases/download/v3.15.6/cmake-3.15.6-Linux-x86_64.sh
32+
sudo bash cmake-3.15.6-Linux-x86_64.sh --skip-license --prefix=/usr/local
33+
rm cmake-3.15.6-Linux-x86_64.sh
34+
35+
36+
# Install Spark 3.1.1
37+
# Note that this install in the /opt/ directory.
38+
# Some systems may already have Spark installed: note that
39+
# the environment variables in the following block will
40+
# need to be set accordingly if so.
41+
wget https://downloads.apache.org/spark/spark-3.1.1/spark-3.1.1-bin-hadoop2.7.tgz
42+
tar xvf spark-3.1.1*
43+
sudo mkdir /opt/spark
44+
sudo mv spark-3.1.1*/* /opt/spark
45+
rm -rf spark-3.1.1*
46+
sudo mkdir /opt/spark/work
47+
sudo chmod -R a+wx /opt/spark/work
48+
49+
# Source necessary environment variables
50+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )";
51+
OPAQUE_DIR="${SCRIPT_DIR%/*}"
52+
cd ${OPAQUE_DIR}
53+
source opaqueenv
54+
source /opt/openenclave/share/openenclave/openenclaverc

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /