Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
pip install pytest
pip install requests
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Check installed dependencies
run: python -m pip check
- name: Run tests
run: |
pytest
Expand All @@ -38,9 +40,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov codecov
pip install pytest pytest-cov requests
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run core vLEI tests
run: |
pytest --cov=./ --cov-report=xml
codecov
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PYTHON ?= python3.12
VENV_PYTHON := $(VENV)/bin/python
VLEI_SERVER := $(VENV)/bin/vLEI-server

VERSION=1.0.3
VERSION=1.0.4
IMAGE_NAME=gleif/vlei
LATEST_TAG=$(IMAGE_NAME):latest
VERSION_TAG=$(IMAGE_NAME):$(VERSION)
Expand Down
58 changes: 10 additions & 48 deletions container/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,53 +1,15 @@
FROM python:3.12.6-slim AS builder
FROM python:3.12-slim@sha256:a6e34c598f2467ed0e9a8d349809fcd8b5c603269512df273a0bb1784edc11b1

# Install compilation dependencies for Ubuntu including ca-certificates, libffi, and libsodium
RUN apt-get update && apt-get install -y \
build-essential \
libffi-dev \
libsodium-dev \
libssl-dev \
python3-dev \
python3-venv \
python3-pip \
curl

SHELL ["/bin/bash", "-c"]

# Setup Rust for blake3 dependency build
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y

WORKDIR /vLEI

RUN python -m venv venv
ENV PATH=/vLEI/venv/bin:${PATH}
RUN pip install --upgrade pip

COPY requirements.txt setup.py /vLEI/
RUN mkdir /vLEI/src

# Build vLEI-server
RUN . "$HOME/.cargo/env" && \
pip install -r requirements.txt

# Create smaller runner image by copying over built binary
FROM python:3.12.6-slim AS runner

RUN apt-get update
RUN apt-get install -y libsodium23 curl

# Prevents Python from buffering stdout and stderr, logs to stdout immediately
ENV PYTHONUNBUFFERED=1
# Set default encoding to UTF-8
ENV PYTHONIOENCODING=UTF-8
RUN apt-get update && apt-get install -y --no-install-recommends libsodium23 curl \
&& rm -rf /var/lib/apt/lists/*

ENV PYTHONUNBUFFERED=1 PYTHONIOENCODING=UTF-8
WORKDIR /vLEI

COPY --from=builder /vLEI /vLEI
COPY src/ src/
COPY ./schema/acdc /vLEI/schema
COPY ./samples/acdc /vLEI/credentials
COPY ./samples/oobis /vLEI/oobis

ENV PATH=/vLEI/venv/bin:${PATH}
COPY setup.py README.md LICENSE /vLEI/
COPY src/ /vLEI/src/
RUN python -m pip install --no-cache-dir . && python -m pip check
COPY schema/acdc/ /vLEI/schema/
COPY samples/acdc/ /vLEI/credentials/
COPY samples/oobis/ /vLEI/oobis/

CMD ["vLEI-server", "-s", "/vLEI/schema", "-c", "/vLEI/credentials", "-o", "/vLEI/oobis"]
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

setup(
name='vlei',
version='1.0.3', # also change in src/vlei/__init__.py
version='1.0.4', # also change in src/vlei/__init__.py
license='Apache Software License 2.0',
description='Verifiable Legal Entity Identifier',
long_description=long_description,
Expand Down Expand Up @@ -74,8 +74,8 @@
],
python_requires='>=3.12.6',
install_requires=[
'hio>=0.6.14,<0.7.0',
'keri>=1.2.13,<1.3.0',
'gleif_hio==0.6.21',
'gleif_keri==1.2.16',
'falcon>=4.0.2',
'multicommand>=1.0.0'
],
Expand Down
2 changes: 1 addition & 1 deletion src/vlei/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-

__version__ = '1.0.3' # also change in setup.py
__version__ = '1.0.4' # also change in setup.py

13 changes: 13 additions & 0 deletions tests/test_dependency_ownership.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""The schema server must run on one consistent GLEIF dependency chain."""
from importlib import metadata
import hio
import keri
import vlei


def test_release_dependencies_have_exclusive_import_ownership():
names = {d.metadata["Name"].lower().replace("_", "-") for d in metadata.distributions()}
assert not {"keri", "hio"} & names
assert metadata.version("gleif-hio") == hio.__version__ == "0.6.21"
assert metadata.version("gleif-keri") == keri.__version__ == "1.2.16"
assert metadata.version("vlei") == vlei.__version__ == "1.0.4"
Loading