forked from CASP-Systems-BU/Secrecy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* comments added and mvp created * nlohmann added * nlohmann added * index shown * importInput created * Moving the share making to frontend * We dont need to move the share making to frontend * Experimenting Dual com * RES TAG deleted * Removed unnecessary comments * Dual communication worked * dual specific file removed due to duplicacy * Join table created (with hacky index) * Join table created (with hacky index) * Any # of match works (# of cols is limited to 2 for now) * Split the input * Split the input * Produce output * modified var name for send/receive indexes * More than 1 vals dynamically accomodated * Cmke modified so it works * Docker File Created * Cmakelist slim down * docker file modified * docker file modified * docker file modified * docker file modified * gitignore restored * github action added
- Loading branch information
1 parent
394ff72
commit 93f3846
Showing
61 changed files
with
25,341 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
BasedOnStyle: Google | ||
IndentWidth: 4 | ||
ColumnLimit: 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
REGISTRY: docker.io | ||
# github.repository as <account>/<repo> | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log into DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=ref,event=branch,pattern=main | ||
type=semver,pattern={{version}} | ||
- name: Build and push Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,4 @@ build | |
src/external-lib/* | ||
!src/external-lib/CMakeLists.txt | ||
|
||
|
||
deployment/results | ||
deployment/results |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Use an official Ubuntu as a base image | ||
FROM ubuntu:22.04 | ||
|
||
# Install necessary packages | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
cmake \ | ||
libsodium-dev \ | ||
libopenmpi-dev \ | ||
openmpi-bin \ | ||
pkg-config \ | ||
git \ | ||
openssh-server \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Create the SSH directory and set up the server | ||
RUN mkdir /var/run/sshd | ||
RUN echo 'root:password' | chpasswd | ||
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config | ||
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config | ||
|
||
# Generate SSH keys and configure known hosts | ||
RUN mkdir -p /root/.ssh && ssh-keygen -t rsa -b 2048 -f /root/.ssh/id_rsa -q -N "" && \ | ||
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys && \ | ||
echo "Host *" >> /root/.ssh/config && \ | ||
echo " StrictHostKeyChecking no" >> /root/.ssh/config | ||
|
||
# Set the working directory | ||
WORKDIR /usr/src/app | ||
|
||
# Clone the main Secrecy repository | ||
RUN git clone https://github.com/Snafkin547/Secrecy.git && \ | ||
cd Secrecy && \ | ||
git checkout bdbaf17e72f05bebaeab6a27506d82a03c4e59ec | ||
|
||
# Create include/external-lib directory and clone the sql-parser repository inside it | ||
RUN mkdir -p Secrecy/include/external-lib \ | ||
&& git clone https://github.com/mfaisal97/sql-parser.git Secrecy/include/external-lib/sql-parser | ||
|
||
# Set the working directory to Secrecy | ||
WORKDIR /usr/src/app/Secrecy | ||
|
||
# Create build directory and run CMake | ||
RUN mkdir build && cd build && cmake .. && make | ||
|
||
# Allowing to run as a root | ||
ENV OMPI_ALLOW_RUN_AS_ROOT=1 | ||
ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 | ||
ENV OMPI_MCA_routed=direct | ||
|
||
# Allow SSH service to run in the background | ||
EXPOSE 22 | ||
CMD ["/usr/sbin/sshd", "-D"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: '3.8' | ||
|
||
services: | ||
secrecy-node1: | ||
image: hicsail/secrecy-app:latest | ||
hostname: secrecy-node1 | ||
networks: | ||
- mpi-network | ||
|
||
secrecy-node2: | ||
image: hicsail/secrecy-app:latest | ||
hostname: secrecy-node2 | ||
networks: | ||
- mpi-network | ||
|
||
secrecy-node3: | ||
image: hicsail/secrecy-app:latest | ||
hostname: secrecy-node3 | ||
networks: | ||
- mpi-network | ||
|
||
networks: | ||
mpi-network: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# CMakeLists.txt in include/external-lib/nlohmann | ||
cmake_minimum_required(VERSION 3.15) | ||
|
||
project(nlohmann_json LANGUAGES CXX) | ||
|
||
add_library(nlohmann_json INTERFACE) | ||
target_include_directories(nlohmann_json INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// __ _____ _____ _____ | ||
// __| | __| | | | JSON for Modern C++ | ||
// | | |__ | | | | | | version 3.11.3 | ||
// |_____|_____|_____|_|___| https://github.com/nlohmann/json | ||
// | ||
// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me> | ||
// SPDX-License-Identifier: MIT | ||
|
||
#pragma once | ||
|
||
#include <utility> | ||
|
||
#include <nlohmann/detail/abi_macros.hpp> | ||
#include <nlohmann/detail/conversions/from_json.hpp> | ||
#include <nlohmann/detail/conversions/to_json.hpp> | ||
#include <nlohmann/detail/meta/identity_tag.hpp> | ||
|
||
NLOHMANN_JSON_NAMESPACE_BEGIN | ||
|
||
/// @sa https://json.nlohmann.me/api/adl_serializer/ | ||
template<typename ValueType, typename> | ||
struct adl_serializer | ||
{ | ||
/// @brief convert a JSON value to any value type | ||
/// @sa https://json.nlohmann.me/api/adl_serializer/from_json/ | ||
template<typename BasicJsonType, typename TargetType = ValueType> | ||
static auto from_json(BasicJsonType && j, TargetType& val) noexcept( | ||
noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), val))) | ||
-> decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), val), void()) | ||
{ | ||
::nlohmann::from_json(std::forward<BasicJsonType>(j), val); | ||
} | ||
|
||
/// @brief convert a JSON value to any value type | ||
/// @sa https://json.nlohmann.me/api/adl_serializer/from_json/ | ||
template<typename BasicJsonType, typename TargetType = ValueType> | ||
static auto from_json(BasicJsonType && j) noexcept( | ||
noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {}))) | ||
-> decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {})) | ||
{ | ||
return ::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {}); | ||
} | ||
|
||
/// @brief convert any value type to a JSON value | ||
/// @sa https://json.nlohmann.me/api/adl_serializer/to_json/ | ||
template<typename BasicJsonType, typename TargetType = ValueType> | ||
static auto to_json(BasicJsonType& j, TargetType && val) noexcept( | ||
noexcept(::nlohmann::to_json(j, std::forward<TargetType>(val)))) | ||
-> decltype(::nlohmann::to_json(j, std::forward<TargetType>(val)), void()) | ||
{ | ||
::nlohmann::to_json(j, std::forward<TargetType>(val)); | ||
} | ||
}; | ||
|
||
NLOHMANN_JSON_NAMESPACE_END |
103 changes: 103 additions & 0 deletions
103
include/external-lib/nlohmann/byte_container_with_subtype.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
// __ _____ _____ _____ | ||
// __| | __| | | | JSON for Modern C++ | ||
// | | |__ | | | | | | version 3.11.3 | ||
// |_____|_____|_____|_|___| https://github.com/nlohmann/json | ||
// | ||
// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me> | ||
// SPDX-License-Identifier: MIT | ||
|
||
#pragma once | ||
|
||
#include <cstdint> // uint8_t, uint64_t | ||
#include <tuple> // tie | ||
#include <utility> // move | ||
|
||
#include <nlohmann/detail/abi_macros.hpp> | ||
|
||
NLOHMANN_JSON_NAMESPACE_BEGIN | ||
|
||
/// @brief an internal type for a backed binary type | ||
/// @sa https://json.nlohmann.me/api/byte_container_with_subtype/ | ||
template<typename BinaryType> | ||
class byte_container_with_subtype : public BinaryType | ||
{ | ||
public: | ||
using container_type = BinaryType; | ||
using subtype_type = std::uint64_t; | ||
|
||
/// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/ | ||
byte_container_with_subtype() noexcept(noexcept(container_type())) | ||
: container_type() | ||
{} | ||
|
||
/// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/ | ||
byte_container_with_subtype(const container_type& b) noexcept(noexcept(container_type(b))) | ||
: container_type(b) | ||
{} | ||
|
||
/// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/ | ||
byte_container_with_subtype(container_type&& b) noexcept(noexcept(container_type(std::move(b)))) | ||
: container_type(std::move(b)) | ||
{} | ||
|
||
/// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/ | ||
byte_container_with_subtype(const container_type& b, subtype_type subtype_) noexcept(noexcept(container_type(b))) | ||
: container_type(b) | ||
, m_subtype(subtype_) | ||
, m_has_subtype(true) | ||
{} | ||
|
||
/// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/ | ||
byte_container_with_subtype(container_type&& b, subtype_type subtype_) noexcept(noexcept(container_type(std::move(b)))) | ||
: container_type(std::move(b)) | ||
, m_subtype(subtype_) | ||
, m_has_subtype(true) | ||
{} | ||
|
||
bool operator==(const byte_container_with_subtype& rhs) const | ||
{ | ||
return std::tie(static_cast<const BinaryType&>(*this), m_subtype, m_has_subtype) == | ||
std::tie(static_cast<const BinaryType&>(rhs), rhs.m_subtype, rhs.m_has_subtype); | ||
} | ||
|
||
bool operator!=(const byte_container_with_subtype& rhs) const | ||
{ | ||
return !(rhs == *this); | ||
} | ||
|
||
/// @brief sets the binary subtype | ||
/// @sa https://json.nlohmann.me/api/byte_container_with_subtype/set_subtype/ | ||
void set_subtype(subtype_type subtype_) noexcept | ||
{ | ||
m_subtype = subtype_; | ||
m_has_subtype = true; | ||
} | ||
|
||
/// @brief return the binary subtype | ||
/// @sa https://json.nlohmann.me/api/byte_container_with_subtype/subtype/ | ||
constexpr subtype_type subtype() const noexcept | ||
{ | ||
return m_has_subtype ? m_subtype : static_cast<subtype_type>(-1); | ||
} | ||
|
||
/// @brief return whether the value has a subtype | ||
/// @sa https://json.nlohmann.me/api/byte_container_with_subtype/has_subtype/ | ||
constexpr bool has_subtype() const noexcept | ||
{ | ||
return m_has_subtype; | ||
} | ||
|
||
/// @brief clears the binary subtype | ||
/// @sa https://json.nlohmann.me/api/byte_container_with_subtype/clear_subtype/ | ||
void clear_subtype() noexcept | ||
{ | ||
m_subtype = 0; | ||
m_has_subtype = false; | ||
} | ||
|
||
private: | ||
subtype_type m_subtype = 0; | ||
bool m_has_subtype = false; | ||
}; | ||
|
||
NLOHMANN_JSON_NAMESPACE_END |
Oops, something went wrong.