From b9455318bdec9c8025f600190238446b12649829 Mon Sep 17 00:00:00 2001
From: Philipp Schlarb
Date: Tue, 30 Nov 2021 10:32:58 +0000
Subject: [PATCH 1/3] VSCode Devcontainer
Signed-off-by: Philipp Schlarb
---
.devcontainer/Dockerfile | 76 +++++++++++++++++++++++++++++++++
.devcontainer/devcontainer.json | 31 ++++++++++++++
2 files changed, 107 insertions(+)
create mode 100644 .devcontainer/Dockerfile
create mode 100644 .devcontainer/devcontainer.json
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
new file mode 100644
index 000000000..3f458c121
--- /dev/null
+++ b/.devcontainer/Dockerfile
@@ -0,0 +1,76 @@
+# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.205.2/containers/ubuntu/.devcontainer/base.Dockerfile
+
+# [Choice] Ubuntu version (use hirsuite or bionic on local arm64/Apple Silicon): hirsute, focal, bionic
+ARG VARIANT="focal"
+FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
+
+RUN apt-get update -y && apt-get install -y \
+ # common stuff
+ git \
+ wget \
+ gnupg \
+ apt-transport-https \
+ ca-certificates \
+ apt-utils \
+ curl \
+ jq
+
+# ========================================================================================================
+# Update repository signing keys
+# --------------------------------------------------------------------------------------------------------
+# Hyperledger
+RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9692C00E657DDE61 && \
+ # Sovrin
+ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88
+# ========================================================================================================
+
+# Plenum
+# - https://github.com/hyperledger/indy-plenum/issues/1546
+# - Needed to pick up rocksdb=5.8.8
+RUN echo "deb https://hyperledger.jfrog.io/artifactory/indy focal dev" >> /etc/apt/sources.list && \
+ echo "deb http://security.ubuntu.com/ubuntu bionic-security main" >> /etc/apt/sources.list && \
+ echo "deb https://repo.sovrin.org/deb bionic master" >> /etc/apt/sources.list && \
+ echo "deb https://repo.sovrin.org/sdk/deb bionic master" >> /etc/apt/sources.list
+
+RUN apt-get update -y && apt-get install -y \
+ # Python
+ python3-pip \
+ python3-nacl \
+ # rocksdb python wrapper
+ rocksdb=5.8.8 \
+ libgflags-dev \
+ libsnappy-dev \
+ zlib1g-dev \
+ libbz2-dev \
+ liblz4-dev \
+ libgflags-dev \
+ # zstd is needed for caching in github actions pipeline
+ zstd \
+ # fpm
+ ruby \
+ ruby-dev \
+ rubygems \
+ gcc \
+ make \
+ # Indy Node and Plenum
+ libssl1.0.0 \
+ ursa=0.3.2-1 \
+ # Indy SDK
+ libindy=1.15.0~1625-bionic \
+ # Need to move libursa.so to parent dir
+ && mv /usr/lib/ursa/* /usr/lib && rm -rf /usr/lib/ursa
+
+RUN pip3 install -U \
+ # Required by setup.py
+ setuptools==50.3.2 \
+ # Still pinned. Needs to be updated like in plenum
+ 'pip<10.0.0' \
+ 'pyzmq==18.1.0'
+
+
+# install fpm
+RUN gem install --no-document rake
+RUN gem install --no-document fpm -v 1.13.1
+
+RUN apt-get -y autoremove \
+ && rm -rf /var/lib/apt/lists/*
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 000000000..e405e52d8
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,31 @@
+// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
+// https://github.com/microsoft/vscode-dev-containers/tree/v0.205.2/containers/ubuntu
+{
+ "name": "Ubuntu",
+ "build": {
+ "dockerfile": "Dockerfile",
+ // Update 'VARIANT' to pick an Ubuntu version: hirsute, focal, bionic
+ // Use hirsute or bionic on local arm64/Apple Silicon.
+ "args": { "VARIANT": "focal" }
+ },
+
+ // Set *default* container specific settings.json values on container create.
+ "settings": {},
+
+
+ // Add the IDs of extensions you want installed when the container is created.
+ "extensions": [
+ "mhutchie.git-graph",
+ "eamodio.gitlens",
+ "ms-python.python"
+ ],
+
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
+ // "forwardPorts": [],
+
+ // Use 'postCreateCommand' to run commands after the container is created.
+ "postCreateCommand": "pip install .[tests]",
+
+ // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
+ //"remoteUser": "vscode"
+}
\ No newline at end of file
From 50d50becdd538b23a5e526853f02025e409baef4 Mon Sep 17 00:00:00 2001
From: pSchlarb <87540518+pSchlarb@users.noreply.github.com>
Date: Fri, 3 Dec 2021 11:11:46 +0100
Subject: [PATCH 2/3] Update .devcontainer/Dockerfile
Co-authored-by: Wade Barnes
Signed-off-by: Philipp Schlarb
---
.devcontainer/Dockerfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index 3f458c121..2ed1f5d46 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -54,7 +54,7 @@ RUN apt-get update -y && apt-get install -y \
make \
# Indy Node and Plenum
libssl1.0.0 \
- ursa=0.3.2-1 \
+ ursa=0.3.2-2 \
# Indy SDK
libindy=1.15.0~1625-bionic \
# Need to move libursa.so to parent dir
From ffe93ea63a5e6993c162333914bd56c8464ca727 Mon Sep 17 00:00:00 2001
From: Philipp Schlarb
Date: Tue, 21 Dec 2021 18:04:44 +0000
Subject: [PATCH 3/3] Pytest.ini for test discovery and Dockerfile fixup
Signed-off-by: Philipp Schlarb
---
.devcontainer/Dockerfile | 4 ++--
.vscode/settings.json | 12 ++++++++++++
pytest.ini | 4 ++++
3 files changed, 18 insertions(+), 2 deletions(-)
create mode 100644 .vscode/settings.json
create mode 100644 pytest.ini
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index 2ed1f5d46..e1dc121d5 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -2,7 +2,7 @@
# [Choice] Ubuntu version (use hirsuite or bionic on local arm64/Apple Silicon): hirsute, focal, bionic
ARG VARIANT="focal"
-FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
+FROM mcr.microsoft.com/vscode/devcontainers/base:${VARIANT}
RUN apt-get update -y && apt-get install -y \
# common stuff
@@ -54,7 +54,7 @@ RUN apt-get update -y && apt-get install -y \
make \
# Indy Node and Plenum
libssl1.0.0 \
- ursa=0.3.2-2 \
+ ursa=0.3.2-1 \
# Indy SDK
libindy=1.15.0~1625-bionic \
# Need to move libursa.so to parent dir
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 000000000..b1ac01a9d
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,12 @@
+{
+ "python.linting.pylintEnabled": false,
+ "python.linting.flake8Enabled": true,
+ "python.linting.enabled": true,
+ "python.testing.unittestEnabled": false,
+ "python.testing.pytestEnabled": true,
+ "python.linting.mypyEnabled": false,
+ "python.testing.pytestArgs": [
+ "-c",
+ "pytest.ini"
+ ]
+}
\ No newline at end of file
diff --git a/pytest.ini b/pytest.ini
new file mode 100644
index 000000000..8e2b4c5a5
--- /dev/null
+++ b/pytest.ini
@@ -0,0 +1,4 @@
+[pytest]
+testpaths =
+ indy_common
+ indy_node
\ No newline at end of file