Skip to content

Commit

Permalink
Updates to allow aws codebuild 16/20 to work alongside GHA 16/20
Browse files Browse the repository at this point in the history
Signed-off-by: Devin Smith <[email protected]>
  • Loading branch information
devinleighsmith committed Apr 16, 2021
1 parent 1e0a2ab commit dea86f0
Show file tree
Hide file tree
Showing 11 changed files with 121 additions and 128 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed deps/indy-node_9.9.9_amd64.deb
Binary file not shown.
Binary file removed deps/indy-plenum_9.9.9_amd64.deb
Binary file not shown.
Binary file removed deps/libsovtoken_1.0.2_amd64.deb
Binary file not shown.
10 changes: 4 additions & 6 deletions devops/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ image_ci_base_version:
image_ci_version:
echo $(call docker_env_value,'CI_ENV_VERSION',$(CI_DOCKERFILE_PATH))

image_ci: image_ci_base_version image_python3
image_ci:
ifeq ($(DOCKER_TAG),)
$(eval DOCKER_TAG=$(call docker_env_value,'CI_ENV_VERSION',$(CI_DOCKERFILE_PATH))-$(OSNAME)-ci)
endif
Expand Down Expand Up @@ -95,11 +95,9 @@ test: $(SRC_DIR)
echo "Running tests"
# TODO improve usage of pipenv (remove pip completely)
# seems pipenv has some bugs regarding extras
export PYTHONPATH="${PYTHONPATH}:/usr/local/lib/python3.8/dist-packages/"
cd $< \
&& pip install -U -e ../sovtoken \
&& pip install -U -e ../sovtokenfees \
&& pip install .[test] \
&& pip install -e ../sovtoken \
&& pip install -e ../sovtokenfees \
&& python3 -m pytest $(PYTEST_ARGS)

pre_package: python_version | $(BUILD_DIR)
Expand All @@ -113,7 +111,7 @@ $(BUILD_DIR):
test_local_aws: image_ci
pushd .. \
&& docker pull amazon/aws-codebuild-local:latest --disable-content-trust=false \
&& ./codebuild_build.sh -i sovrin/plugin:$(DOCKER_TAG) -b ./devops/aws-codebuild/buildspec.yml -a ./tmp -e aws_local_codebuild.env \
&& ./codebuild_build.sh -i sovrin/plugin:$(DOCKER_TAG) -b ./devops/aws-codebuild/buildspec.yml -a ./tmp -e aws_local_codebuild_sovtoken.env \
&& ./codebuild_build.sh -i sovrin/plugin:0.21.0-$(OSNAME)-ci -b ./devops/aws-codebuild/buildspec.yml -a ./tmp -e aws_local_codebuild_sovtokenfees.env \
&& popd

Expand Down
185 changes: 107 additions & 78 deletions devops/docker/ci/focal/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
FROM sovrin/python3:0.2.0-focal
# TODO LABEL maintainer="Name <email-address>"
FROM ubuntu:20.04

ARG u_id=1000
ARG u_name=user
ARG uid=1000
ARG user=indy

# rocksdb
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88 \
&& add-apt-repository "deb https://repo.sovrin.org/deb xenial rc master" \
&& add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial master" \
&& add-apt-repository "deb http://archive.ubuntu.com/ubuntu xenial universe main" \
&& add-apt-repository "deb http://archive.ubuntu.com/ubuntu groovy universe main" \
&& add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial master" \
&& apt-get update && apt-get install -y --allow-downgrades \
libsnappy-dev \
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y

RUN apt-get update -y \
&& echo "deb http://security.ubuntu.com/ubuntu bionic main" >> /etc/apt/sources.list \
&& apt-get install -y --allow-downgrades \
# common stuff
git \
wget \
apt-transport-https \
ca-certificates \
apt-utils \
nano \
software-properties-common \
supervisor \
# Python
python3-pip \
python3-nacl \
# rocksdb python wrapper
Expand All @@ -21,90 +29,111 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88 \
librocksdb-dev \
libsnappy-dev \
liblz4-dev \
zlib1g-dev \
libbz2-dev \
libsodium18 \
libsodium23 \
python3-py=1.9.0-1 \
supervisor \
at \
iptables \
libc6=2.32-0ubuntu3 \
&& rm -rf /var/lib/apt/lists/*

# fails when executed in one command with other pip install packages
# RUN pip install python-rocksdb

RUN echo "deb http://security.ubuntu.com/ubuntu bionic-security main" >> /etc/apt/sources.list && \
apt-get update && apt-get install -y \
libssl1.0.0

libssl1.0.0 \
libssl1.1
# Indy Node and Plenum
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88 && \
echo "deb https://repo.sovrin.org/deb bionic master" >> /etc/apt/sources.list && \
apt-get update && apt-get install -y \
ursa=0.3.2-1

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88 \
&& echo "deb https://repo.sovrin.org/deb bionic master" >> /etc/apt/sources.list \
&& apt-get update && apt-get install -y \
ursa
# install fpm
ENV FPM_VERSION=1.9.3
RUN apt-get update \
&& apt-add-repository ppa:brightbox/ruby-ng \
&& apt-get install -y --no-install-recommends \
ruby2.6 \
ruby2.6-dev \
&& gem install --no-document rake fpm:$FPM_VERSION \
&& rm -rf /var/lib/apt/lists/*

# Need to move libursa.so to parent dir
RUN mv /usr/lib/ursa/* /usr/lib && rm -rf /usr/lib/ursa

# libsovtoken
# TODO: I DO REALLY THINK THAT THIS SHOULD BE CHANGED
RUN apt-get update && apt-get install -y \
libindy=1.13.0~1420 \
libsovtoken=1.0.2~92
# Indy SDK
# RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88 || \
# apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CE7709D068DB5E88 && \
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88 \
&& add-apt-repository "deb https://repo.sovrin.org/deb xenial master" \
&& add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial master" \
&& add-apt-repository "deb https://repo.sovrin.org/sdk/deb bionic master" \
&& add-apt-repository "deb http://archive.ubuntu.com/ubuntu xenial universe main" \
&& apt-get update -y && apt-get install -y \
libindy=1.15.0~1625-bionic \
libsodium23

# pypi based packages
RUN pip3 install -U \
'pip<10.0.0' \
python-ursa==0.1.1
Pygments==2.2.0 \
Pympler==0.8 \
PyNaCl==1.3.0 \
apipkg==1.5 \
attrs==20.3.0 \
base58==2.1.0 \
distro==1.5.0 \
execnet==1.8.0 \
flake8==3.8.4 \
iniconfig==1.1.1 \
intervaltree==2.1.0 \
ioflo==2.0.2 \
jsonpickle==2.0.0 \
leveldb==0.201 \
libnacl==1.7.2 \
mccabe==0.6.1 \
msgpack-python==0.5.6 \
orderedset==2.0.3 \
packaging==20.9 \
pip==9.0.3 \
pluggy==0.13.1 \
portalocker==2.2.1 \
prompt-toolkit==3.0.16 \
psutil==5.6.6 \
py==1.10.0 \
pycodestyle==2.6.0 \
pyflakes==2.2.0 \
pyparsing==2.4.7 \
pytest==6.2.2 \
pytest-asyncio==0.14.0 \
pytest-forked==1.3.0 \
pytest-runner==5.3.0 \
pytest-xdist==2.2.1 \
python-dateutil==2.6.1 \
python-rocksdb==0.7.0 \
python-ursa==0.1.1 \
python3-indy==1.15.0-dev-1625 \
pyzmq==18.1.0 \
rlp==0.6.0 \
semver==2.13.0 \
setuptools==53.0.0 \
sha3==0.2.1 \
six==1.15.0 \
sortedcontainers==1.5.7 \
timeout-decorator==0.5.0 \
toml==0.10.2 \
ujson==1.33 \
wcwidth==0.2.5 \
wheel==0.34.2 \
zipp==1.2.0 \
mock
# virtualenv \
# python-rocksdb==0.7

COPY ./deps .
RUN dpkg -i python3-base58_2.1.0_amd64.deb \
&& dpkg -i python3-dateutil_2.8.1_amd64.deb \
&& dpkg -i python3-sortedcontainers_1.5.7_amd64.deb \
&& dpkg -i python3-intervaltree_2.1.0_amd64.deb \
&& dpkg -i python3-ioflo_2.0.2_amd64.deb \
&& dpkg -i python3-jsonpickle_2.0.0_amd64.deb \
&& dpkg -i python3-libnacl_1.7.2_amd64.deb \
&& dpkg -i python3-orderedset_2.0.3_amd64.deb \
&& dpkg -i python3-pyparsing_2.0.2_amd64.deb \
&& dpkg -i python3-packaging_20.9_amd64.deb \
&& dpkg -i python3-portalocker_2.2.1_amd64.deb \
&& dpkg -i python3-wcwidth_0.2.5_amd64.deb \
&& dpkg -i python3-prompt-toolkit_3.0.16_amd64.deb \
&& dpkg -i python3-psutil_5.6.6_amd64.deb \
&& dpkg -i python3-pygments_2.2.0_amd64.deb \
&& dpkg -i python3-pympler_0.8_amd64.deb \
&& dpkg -i python3-pyzmq_18.1.0_amd64.deb \
&& dpkg -i python3-rlp_0.5.1_amd64.deb \
&& dpkg -i python3-semver_2.13.0_amd64.deb \
&& dpkg -i python3-sha3_0.2.1_amd64.deb \
&& dpkg -i python3-six_1.15.0_amd64.deb \
&& dpkg -i python3-rocksdb_0.7.0_amd64.deb \
&& dpkg -i python3-leveldb_0.201_amd64.deb \
&& dpkg -i python3-msgpack-python_0.5.6_amd64.deb \
&& dpkg -i python3-ujson_1.33_amd64.deb \
#plenum transitive deps
# && dpkg -i python3-setuptools_38.5.2_amd64.deb \
# && dpkg -i python3-distro_1.3.0_amd64.deb \
# && dpkg -i python3-iniconfig_1.1.1_amd64.deb \
# && dpkg -i python3-toml_0.10.2_amd64.deb \
# && dpkg -i python3-pluggy_0.13.1_amd64.deb \
# && dpkg -i python3-attrs_19.2.0_amd64.deb \
# && dpkg -i python3-pytest_6.2.2_amd64.deb \
# && dpkg -i python3-ursa_0.1.1_amd64.deb \
#indy-node deps
&& dpkg -i python3-distro_1.5.0_amd64.deb \
&& dpkg -i python3-timeout-decorator_0.5.0_amd64.deb \
#token deps
&& dpkg -i --force-overwrite indy-plenum_9.9.9_amd64.deb \
&& dpkg -i --force-overwrite indy-node_9.9.9_amd64.deb


RUN dpkg -i indy-plenum_9.9.9_amd64.deb \
&& dpkg -i indy-node_9.9.9_amd64.deb \
&& dpkg -i libsovtoken_1.0.2_amd64.deb

RUN mkdir -p /etc/indy && echo "ENABLED_PLUGINS = ['sovtoken', 'sovtokenfees']" > /etc/indy/indy_config.py

RUN apt-get -y autoremove
RUN rm -rf /var/lib/apt/lists/*

# TODO CMD ENTRYPOINT ...
ENV CI_ENV_VERSION=0.21.0
ENV CI_ENV_VERSION=0.21.0
49 changes: 8 additions & 41 deletions devops/docker/ci/xenial/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM sovrin/python3:0.1.0-xenial
FROM hyperledger/indy-core-baseci:0.0.3-master
# TODO LABEL maintainer="Name <email-address>"

ARG u_id=1000
Expand All @@ -7,6 +7,7 @@ ARG u_name=user
# TODO move to base image
RUN apt-get update && apt-get install -y \
software-properties-common \
python3-pip \
&& rm -rf /var/lib/apt/lists/*

# rocksdb
Expand All @@ -20,61 +21,27 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88 \
rocksdb=5.8.8 \
&& rm -rf /var/lib/apt/lists/*

COPY ../../deps .
RUN dpkg -i python3-base58_1.0.0_amd64.deb \
&& dpkg -i python3-dateutil_2.6.1_amd64.deb \
&& dpkg -i python3-distro_1.3.0_amd64.deb \
&& dpkg -i python3-intervaltree_2.1.0_amd64.deb \
&& dpkg -i python3-ioflo_1.5.4_amd64.deb \
&& dpkg -i python3-jsonpickle_0.9.6_amd64.deb \
&& dpkg -i python3-libnacl_1.6.1_amd64.deb \
&& dpkg -i python3-orderedset_2.0.3_amd64.deb \
&& dpkg -i python3-packaging_19.0_amd64.deb \
&& dpkg -i python3-portalocker_0.5.7_amd64.deb \
&& dpkg -i python3-prompt-toolkit_0.57_amd64.deb \
&& dpkg -i python3-psutil_5.6.6_amd64.deb \
&& dpkg -i python3-pygments_2.2.0_amd64.deb \
&& dpkg -i python3-pympler_0.8_amd64.deb \
&& dpkg -i python3-pyzmq_18.1.0_amd64.deb \
&& dpkg -i python3-rlp_0.5.1_amd64.deb \
&& dpkg -i python3-rocksdb_0.6.9_amd64.deb \
&& dpkg -i python3-semver_2.7.9_amd64.deb \
&& dpkg -i python3-setuptools_38.5.2_amd64.deb \
&& dpkg -i python3-sha3_0.2.1_amd64.deb \
&& dpkg -i python3-six_1.11.0_amd64.deb \
&& dpkg -i python3-sortedcontainers_1.5.7_amd64.deb \
&& dpkg -i python3-timeout-decorator_0.5.0_amd64.deb \
&& dpkg -i python3-ursa_0.1.1_amd64.deb \
&& dpkg -i rocksdb_5.8.8_amd64.deb

# libindy
# TODO: I DO REALLY THINK THAT THIS SHOULD BE CHANGED
RUN add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial master" \
&& apt-get update && apt-get install -y \
libindy=1.13.0~1420 \
libsovtoken=1.0.2~92 \
indy-node \
ursa=0.3.2-2 \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p /etc/indy && echo "ENABLED_PLUGINS = ['sovtoken', 'sovtokenfees']" > /etc/indy/indy_config.py \
&& pip3 install -U \
pipenv \
setuptools==50.3.2 \
zipp==1.2.0 \
pytest==4.6.2 \
pytest-xdist==2.2.1 \
importlib_metadata==2.1.1 \
importlib_resources==3.2.1

# TODO workaround (suggested by http://click.pocoo.org/5/python3/)
# to use pipenv's dependency 'click' (http://click.pocoo.org)
# check for alternatives
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
importlib_resources==3.2.1 \
python3-indy==1.13.0-dev-1420 \
indy-node==1.13.0.dev1225 \
mock==3.0.5

RUN if [ "$u_id" != "0" ]; then \
useradd -ms /bin/bash -u $u_id $u_name; \
fi
USER $u_id

# TODO CMD ENTRYPOINT ...
ENV CI_ENV_VERSION=0.22.0
2 changes: 1 addition & 1 deletion devops/ext/docker/base/xenial/Dockerfile.0.2.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:xenial
FROM hyperledger/indy-core-baseci:0.0.3-master
# TODO LABEL maintainer="Name <email-address>"

# generally useful packages
Expand Down
3 changes: 1 addition & 2 deletions sovtoken/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
with open(os.path.join(here, 'sovtoken', '__metadata__.py'), 'r') as f:
exec(f.read(), metadata)

tests_require = []
'python3-indy==1.13.0-dev-1420', 'pytest-asyncio>=0.14.0']
tests_require = ['pip==9.0.3', 'pytest-xdist', 'mock', 'python-rocksdb==0.6.9']

setup(
name=metadata['__title__'],
Expand Down

0 comments on commit dea86f0

Please sign in to comment.