Skip to content

Commit

Permalink
Add ABY3 to pypi (tf-encrypted#854)
Browse files Browse the repository at this point in the history
* 1. fix deploying issues; 2. fix aby3 test

* fix: old xcode version no longer supported on CircleCI

* fix test error when graph not reset

Co-authored-by: zhicong.hzc <zhicong.hzc@alibaba-inc.com>
  • Loading branch information
zicofish and zhicong.hzc committed Mar 7, 2022
1 parent 8b7cfb3 commit ba70fd8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:

build:
docker:
- image: tensorflow/tensorflow:custom-op-ubuntu16
- image: circleci/python:3.6
working_directory: ~/repo
steps:
- setup_remote_docker
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:

build-macos:
macos:
xcode: "10.0.0"
xcode: "13.0.0"
working_directory: ~/repo
steps:
- checkout
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:

deploy-macos:
macos:
xcode: "10.0.0"
xcode: "13.0.0"
working_directory: ~/repo
steps:
- checkout
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
**Fixed**

- Fix a buggy CI workflow that fails to use cache in 'deploy' step (because of a different image from 'build step')
- Remove skipping conditions in aby3 test

## [0.5.9]

Expand Down
7 changes: 7 additions & 0 deletions tf_encrypted/operations/secure_random/secure_random_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ def test_rejection(self):

@unittest.skipUnless(dontskip, disabled_msg)
class TestRandomUniform(unittest.TestCase):
def setUp(self):
tf.reset_default_graph()

def tearDown(self):
tf.reset_default_graph()

def test_wrapper(self):
with tf.Session():
output = secure_random.random_uniform([3, 3], maxval=10000).eval()
Expand Down Expand Up @@ -130,6 +136,7 @@ def test_invalid_args(self):
@unittest.skipUnless(dontskip, disabled_msg)
class TestSeed(unittest.TestCase):
def test_seed_generation(self):
tf.reset_default_graph()
with tf.Session():
s = secure_random.secure_seed()

Expand Down
15 changes: 0 additions & 15 deletions tf_encrypted/protocol/aby3/aby3_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,12 @@
import tensorflow as tf

import tf_encrypted as tfe
from tf_encrypted.operations.secure_random import secure_random
from tf_encrypted.protocol.aby3 import ABY3
from tf_encrypted.protocol.aby3 import ARITHMETIC
from tf_encrypted.protocol.aby3 import BOOLEAN


@unittest.skipIf(
secure_random.secure_random_module is None,
"Tests will be run in TestABY3InsecureRandomness",
)
class TestABY3(unittest.TestCase):
@classmethod
def setUpClass(cls):
print_banner("ABY3 Unit Tests with Secure Randomness")

def test_add_private_private(self):
tf.reset_default_graph()
Expand Down Expand Up @@ -1107,13 +1099,6 @@ def provide_input():
os.remove(tmp_filename)


class TestABY3InsecureRandomness(TestABY3):
@classmethod
def setUpClass(cls):
secure_random.secure_random_module = None
print_banner("ABY3 Unit Tests With Insecure Randomness")


def print_banner(title):
title_length = len(title)
banner_length = title_length + 2 * 10
Expand Down

0 comments on commit ba70fd8

Please sign in to comment.