Skip to content
Open
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
9 changes: 9 additions & 0 deletions did-indy/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.134.0/containers/python-3/.devcontainer/base.Dockerfile
ARG VARIANT="3.12"
FROM mcr.microsoft.com/devcontainers/python:${VARIANT}

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

COPY pyproject.toml uv.lock README.md ./
RUN mkdir -p src/acapy_did_indy && touch src/acapy_did_indy/__init__.py
RUN pip install -e .
61 changes: 61 additions & 0 deletions did-indy/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "acapy-did-indy",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
"VARIANT": "3.12-bookworm",
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"charliermarsh.ruff"
],
"settings": {
"python.testing.pytestArgs": [
"acapy_agent",
"--no-cov"
],
"python.testing.autoTestDiscoverOnSaveEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.pytestPath": "pytest",
"editor.formatOnSave": false, // enable per language
"[python]": {
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll": false,
"source.organizeImports": false
},
"editor.defaultFormatter": "charliermarsh.ruff",
"ruff.organizeImports": false
},
"ruff.codeAction.fixViolation": {
"enable": false
},
"ruff.fixAll": false,
"ruff.configuration": "~/.config/pyproject.toml"
}
}
},

"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",

"remoteEnv": {
"RUST_LOG":"aries-askar::log::target=error"
//"PATH": "${containerEnv:PATH}:${workspaceRoot}/.venv/bin"
},

"mounts": [],
"postCreateCommand": "bash ./.devcontainer/post-install.sh"

}
36 changes: 36 additions & 0 deletions did-indy/.devcontainer/post-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
set -ex

# Convenience workspace directory for later use
WORKSPACE_DIR=$(pwd)

# install all ACA-Py requirements
python -m pip install --upgrade pip
# pip3 install -r demo/requirements.txt -r demo/requirements.behave.txt

# install current version of acapy-agent so the pytests can pick up a version
pip3 install --group demo -e .[did_web_server,acapy,demo]
pip3 install acapy-agent[askar]

# hack/workaround to allow `pytest .` and `poetry run pytest` work.
# need to not run ruff...

# cat > .pytest.ini <<EOF
# # this is created for the devcontainer so pytests are properly discoverable.
# # remove this file for normal operations outside of the devcontainer.
# # basically we cannot have ruff (--ruff) in the pytest configuration as it breaks the Testing View.
# [pytest]
# testpaths = "acapy_agent"
# addopts = --quiet
# markers = [
# "anoncreds: Tests specifically relating to AnonCreds support",
# "askar: Tests specifically relating to Aries-Askar support",
# "indy: Tests specifically relating to Hyperledger Indy SDK support",
# "indy_credx: Tests specifically relating to Indy-Credx support",
# "indy_vdr: Tests specifically relating to Indy-VDR support",
# "ursa_bbs_signatures: Tests specificaly relating to BBS Signatures support",
# "postgres: Tests relating to the postgres storage plugin for Indy"]
# junit_family = "xunit1"
# asyncio_mode = auto
# asyncio_default_fixture_loop_scope = module
# EOF
7 changes: 7 additions & 0 deletions did-indy/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**
!pyproject.toml
!uv.lock
!README.md

!src
!demo
162 changes: 162 additions & 0 deletions did-indy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm-project.org/#use-with-ide
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
11 changes: 11 additions & 0 deletions did-indy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# FROM ghcr.io/openwallet-foundation/acapy-agent:py3.12-1.2.2
FROM ghcr.io/openwallet-foundation/acapy-agent:py3.12-1.4.0
#FROM acapy-vcdm
# FROM acapy:dev

RUN mkdir -p src/acapy_plugin_did_indy && touch src/acapy_plugin_did_indy/__init__.py

ADD pyproject.toml README.md uv.lock ./
RUN pip install -e .

ADD src/acapy_plugin_did_indy/ src/acapy_plugin_did_indy/
17 changes: 17 additions & 0 deletions did-indy/Dockerfile.server
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM python:3.12-slim-bookworm as base
WORKDIR /usr/src/app

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

RUN apt-get update && apt-get install -y git && apt-get clean

# Setup project
COPY pyproject.toml uv.lock README.md ./
RUN uv sync --locked --no-install-project --all-extras

COPY src ./src
RUN uv sync --locked --all-extras
RUN uv sync --group did_web_server --group acapy --group demo

ENTRYPOINT ["uv", "run", "fastapi", "dev", "src/did_web_server/__init__.py"]
CMD ["--host", "0.0.0.0", "--port", "8000"]
Loading
Loading