From ff8dc08e1e970efc3eb378e10631459789884c86 Mon Sep 17 00:00:00 2001 From: Wade Barnes Date: Tue, 13 Feb 2024 07:49:39 -0800 Subject: [PATCH 1/2] Upgrade to latest action versions - Missed some Signed-off-by: Wade Barnes --- .github/workflows/repoDispatchable_updateNode.yaml | 2 +- .github/workflows/reuseable_publish.yaml | 4 ++-- .github/workflows/tag.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/repoDispatchable_updateNode.yaml b/.github/workflows/repoDispatchable_updateNode.yaml index 4332d358..db057a34 100644 --- a/.github/workflows/repoDispatchable_updateNode.yaml +++ b/.github/workflows/repoDispatchable_updateNode.yaml @@ -8,7 +8,7 @@ jobs: update-setup: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Update indy-node to ${{ github.event.client_payload.pyVersion }} run: | sed -i "s/\(indy-node==\)[^ ]*/\1${{ github.event.client_payload.pyVersion }}'],/g" ./sovtoken/setup.py diff --git a/.github/workflows/reuseable_publish.yaml b/.github/workflows/reuseable_publish.yaml index 68e3ed8e..f1f1c6eb 100644 --- a/.github/workflows/reuseable_publish.yaml +++ b/.github/workflows/reuseable_publish.yaml @@ -37,7 +37,7 @@ jobs: jfrog rt ping - name: Download sovtoken-deb package from GHA - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: sovtoken-deb path: /tmp/sovtoken-deb/ @@ -51,7 +51,7 @@ jobs: repo: "deb" - name: Download sovtokenfees-deb package from GHA - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: sovtokenfees-deb path: /tmp/sovtokenfees-deb/ diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml index d1b347e4..f96deefc 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -38,7 +38,7 @@ jobs: - name: Check out code uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.8' - name: Set up python From 17988d5ba4d8fb476b56f546c8677e14c3a3057d Mon Sep 17 00:00:00 2001 From: Wade Barnes Date: Tue, 13 Feb 2024 10:05:42 -0800 Subject: [PATCH 2/2] Update dev containers and upgrade semver - Upgrade to semver 3.x - Fix VS Code and Gitpod dev containers Signed-off-by: Wade Barnes --- .devcontainer/Dockerfile | 59 ++++++++----------- .../workflows/build/Dockerfile.ubuntu-2004 | 2 +- .gitpod.Dockerfile | 57 ++++++++---------- devops/docker/ci/focal/Dockerfile | 2 +- updateVersion.py | 6 +- 5 files changed, 55 insertions(+), 71 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index e0425695..535a5326 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,9 +1,8 @@ ARG VARIANT="focal" FROM mcr.microsoft.com/vscode/devcontainers/base:${VARIANT} -RUN apt-get update -y \ - && echo "deb http://security.ubuntu.com/ubuntu bionic main" >> /etc/apt/sources.list \ - && apt-get install -y --allow-downgrades \ +RUN echo "deb http://security.ubuntu.com/ubuntu bionic main" >> /etc/apt/sources.list && \ + apt-get update -y && apt-get install -y --allow-downgrades \ # common stuff git \ wget \ @@ -12,7 +11,7 @@ RUN apt-get update -y \ apt-utils \ nano \ software-properties-common \ - supervisor \ + supervisor \ # Python python3-pip \ python3-nacl \ @@ -23,50 +22,44 @@ RUN apt-get update -y \ libsnappy-dev \ liblz4-dev \ libbz2-dev \ - docker-compose \ - && rm -rf /var/lib/apt/lists/* - -# fails when executed in one command with other pip install packages -# RUN pip install python-rocksdb + docker-compose RUN echo "deb http://security.ubuntu.com/ubuntu bionic-security main" >> /etc/apt/sources.list && \ - apt-get update && apt-get install -y \ + apt-get update -y && apt-get install -y \ 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 \ + && 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/* +ENV FPM_VERSION=1.14.2 +ENV DOTENV_VERSION=2.8.1 +RUN apt-get update -y && apt-get install -y \ + ruby \ + ruby-dev \ + rubygems \ + && gem install --no-document rake dotenv:$DOTENV_VERSION fpm:$FPM_VERSION # Need to move libursa.so to parent dir RUN mv /usr/lib/ursa/* /usr/lib && rm -rf /usr/lib/ursa # 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 \ - && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9692C00E657DDE61 \ - && echo "deb https://hyperledger.jfrog.io/artifactory/indy focal dev rc" >> /etc/apt/sources.list \ - && echo "deb https://repo.sovrin.org/sdk/deb xenial master" >> /etc/apt/sources.list \ - && echo "deb https://repo.sovrin.org/sdk/deb bionic master" >> /etc/apt/sources.list \ - && echo "deb http://archive.ubuntu.com/ubuntu xenial universe main" >> /etc/apt/sources.list \ - && echo "deb https://repo.sovrin.org/deb xenial master" >> /etc/apt/sources.list \ - && apt-get update -y && apt-get install -y \ +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88 \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9692C00E657DDE61 \ + && add-apt-repository "deb https://hyperledger.jfrog.io/artifactory/indy focal dev" \ + && 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 \ +RUN pip3 install -U \ + Cython==0.29.36 \ Pygments==2.2.0 \ Pympler==0.8 \ PyNaCl==1.3.0 \ @@ -106,7 +99,7 @@ RUN pip3 install -U \ python3-indy==1.15.0-dev-1625 \ pyzmq==18.1.0 \ rlp==0.6.0 \ - semver==2.13.0 \ + semver \ setuptools==53.0.0 \ sha3==0.2.1 \ six==1.15.0 \ @@ -118,10 +111,8 @@ RUN pip3 install -U \ wheel==0.34.2 \ zipp==1.2.0 \ mock -# virtualenv \ -# python-rocksdb==0.7 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/* \ No newline at end of file diff --git a/.github/workflows/build/Dockerfile.ubuntu-2004 b/.github/workflows/build/Dockerfile.ubuntu-2004 index c4e2fd13..6b511b2c 100644 --- a/.github/workflows/build/Dockerfile.ubuntu-2004 +++ b/.github/workflows/build/Dockerfile.ubuntu-2004 @@ -105,7 +105,7 @@ RUN pip3 install -U \ python3-indy==1.15.0-dev-1625 \ pyzmq==18.1.0 \ rlp==0.6.0 \ - semver==2.13.0 \ + semver \ setuptools==53.0.0 \ sha3==0.2.1 \ six==1.15.0 \ diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index e67597f6..a1bf84c8 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -2,22 +2,21 @@ FROM gitpod/workspace-base as base USER gitpod -# common stuff -# Python -# rocksdb python wrapper -RUN sudo apt-get update \ - && sudo apt-get install software-properties-common \ - && sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu bionic main" \ - && sudo apt-get install -y \ +RUN echo "deb http://security.ubuntu.com/ubuntu bionic main" >> /etc/apt/sources.list && \ + apt-get update -y && apt-get install -y --allow-downgrades \ + # common stuff git \ wget \ apt-transport-https \ ca-certificates \ apt-utils \ nano \ - supervisor \ + software-properties-common \ + supervisor \ + # Python python3-pip \ python3-nacl \ + # rocksdb python wrapper rocksdb-tools \ librocksdb5.17 \ librocksdb-dev \ @@ -25,10 +24,8 @@ RUN sudo apt-get update \ liblz4-dev \ libbz2-dev -# fails when executed in one command with other pip install packages -# RUN pip install python-rocksdb RUN sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu bionic-security main" && \ - sudo apt-get update && sudo apt-get install -y \ + sudo apt-get update -y && sudo apt-get install -y \ libssl1.0.0 \ libssl1.1 @@ -37,36 +34,34 @@ RUN sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E sudo add-apt-repository "deb https://repo.sovrin.org/deb bionic master" &&\ sudo apt-get update && sudo apt-get install -y \ ursa - # install fpm -ENV FPM_VERSION=1.9.3 -RUN sudo apt-add-repository ppa:brightbox/ruby-ng &&\ - sudo apt-get install -y --no-install-recommends \ - ruby2.6 \ - ruby2.6-dev &&\ - sudo gem install --no-document rake fpm:$FPM_VERSION +ENV FPM_VERSION=1.14.2 +ENV DOTENV_VERSION=2.8.1 +RUN sudo apt-get update -y && sudo apt-get install -y \ + ruby \ + ruby-dev \ + rubygems \ + && gem install --no-document rake dotenv:$DOTENV_VERSION fpm:$FPM_VERSION # Need to move libursa.so to parent dir RUN sudo mv /usr/lib/ursa/* /usr/lib && sudo rm -rf /usr/lib/ursa # 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 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88 &&\ - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9692C00E657DDE61 &&\ - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9692C00E657DDE61 &&\ - sudo add-apt-repository "deb https://hyperledger.jfrog.io/artifactory/indy focal dev rc" &&\ - sudo add-apt-repository "deb https://repo.sovrin.org/deb xenial master" &&\ - sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial master" &&\ - sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb bionic master" &&\ - sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu xenial universe main" &&\ - sudo apt-get update -y && sudo apt-get install -y \ +RUN sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88 && \ + sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9692C00E657DDE61 && \ + sudo add-apt-repository "deb https://hyperledger.jfrog.io/artifactory/indy focal dev rc" && \ + sudo add-apt-repository "deb https://repo.sovrin.org/deb xenial master" && \ + sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial master" && \ + sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb bionic master" && \ + sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu xenial universe main" && \ + sudo apt-get update -y && sudo apt-get install -y && \ libindy=1.15.0~1625-bionic \ libsodium23 ENV PATH "$PATH:/home/gitpod/.local/bin" # pypi based packages RUN pip3 install -U --user\ + Cython==0.29.36 \ Pygments==2.2.0 \ Pympler==0.8 \ PyNaCl==1.3.0 \ @@ -106,7 +101,7 @@ RUN pip3 install -U --user\ python3-indy==1.16.0.post286 \ pyzmq==18.1.0 \ rlp==0.6.0 \ - semver==2.13.0 \ + semver \ setuptools==53.0.0 \ sha3==0.2.1 \ six==1.15.0 \ @@ -118,8 +113,6 @@ RUN pip3 install -U --user\ wheel==0.34.2 \ zipp==1.2.0 \ mock -# virtualenv \ -# python-rocksdb==0.7 COPY ./deps . RUN sudo dpkg -i libsovtoken_1.0.2_amd64.deb diff --git a/devops/docker/ci/focal/Dockerfile b/devops/docker/ci/focal/Dockerfile index 1eba5b9c..bda51144 100644 --- a/devops/docker/ci/focal/Dockerfile +++ b/devops/docker/ci/focal/Dockerfile @@ -107,7 +107,7 @@ RUN pip3 install -U \ python3-indy==1.15.0-dev-1625 \ pyzmq==18.1.0 \ rlp==0.6.0 \ - semver==2.13.0 \ + semver \ setuptools==53.0.0 \ sha3==0.2.1 \ six==1.15.0 \ diff --git a/updateVersion.py b/updateVersion.py index ef0b9c6e..75d79ee4 100755 --- a/updateVersion.py +++ b/updateVersion.py @@ -12,7 +12,7 @@ def updateWithTag(ver): - if not semver.VersionInfo.isvalid(ver): + if not semver.Version.is_valid(ver): raise ValueError('No Valid Semver in Tag') return ver @@ -21,7 +21,7 @@ def updateWithTimestamp(timestamp): version = "str" with open('sovtoken/sovtoken/metadata.json', 'r') as f: data = json.load(f) - v = semver.VersionInfo.parse(data["version"]) + v = semver.Version.parse(data["version"]) v = v.replace(prerelease="dev" + timestamp) version = str(v) return version @@ -32,7 +32,7 @@ def updateWithTimestamp(timestamp): if args['getVersion']: with open('sovtoken/sovtoken/metadata.json', 'r') as f: data = json.load(f) - v = semver.VersionInfo.parse(data["version"]) + v = semver.Version.parse(data["version"]) print(v) quit()