-
Notifications
You must be signed in to change notification settings - Fork 515
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2189 from ianco/master
Doc update and some test scripts
- Loading branch information
Showing
6 changed files
with
157 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Aca-Py Docker Test Scripts | ||
|
||
These docker compose files allow you to run an aca-py instance against a postgres database. | ||
|
||
There are separate scripts for starting the database and agent to allow you to restart the agent against the same postgres database. | ||
|
||
This is useful for - for example - initializing a database with on older aca-py version, and then running an upgrade to a newer version. | ||
|
||
To start the database: | ||
|
||
```bash | ||
docker-compose -f docker-compose-wallet.yml up | ||
``` | ||
|
||
To start the agent: | ||
|
||
```bash | ||
docker-compose -f docker-compose-agent.yml up | ||
``` | ||
|
||
Note you can edit the docker-compose file to change the aca-py version. | ||
|
||
To stop the agent: | ||
|
||
```bash | ||
docker-compose -f docker-compose-agent.yml rm | ||
``` | ||
|
||
To stop the database | ||
|
||
```bash | ||
docker-compose -f docker-compose-wallet.yml rm | ||
``` | ||
|
||
To remove the database volume: | ||
|
||
```bash | ||
docker volume rm docker-test_wallet-db-data | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM postgres:14 | ||
COPY ./init-postgres-role.sh /docker-entrypoint-initdb.d/init-postgres-role.sh | ||
CMD ["docker-entrypoint.sh", "postgres"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" --set username=$POSTGRES_ADMIN_USER --set password="'$POSTGRES_ADMIN_PASSWORD'"<<-EOSQL | ||
CREATE ROLE :username WITH LOGIN SUPERUSER INHERIT CREATEDB CREATEROLE REPLICATION ENCRYPTED PASSWORD :password; | ||
EOSQL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
version: "3" | ||
services: | ||
vcr-agent: | ||
#image: bcgovimages/aries-cloudagent:py36-1.16-1_0.7.5 | ||
build: | ||
context: ../../ | ||
dockerfile: docker/Dockerfile.run | ||
ports: | ||
- 8010:8010 | ||
- 8001:8001 | ||
networks: | ||
- wallet-net | ||
entrypoint: /bin/bash | ||
command: [ | ||
"-c", | ||
"sleep 5; \ | ||
aca-py start \ | ||
--auto-provision \ | ||
--seed '00000000o_faber_secondary_school' \ | ||
--inbound-transport http '0.0.0.0' 8001 \ | ||
--endpoint 'http://host.docker.internal:8001' \ | ||
--outbound-transport http \ | ||
--genesis-url 'http://test.bcovrin.vonx.io/genesis' \ | ||
--auto-accept-invites \ | ||
--auto-accept-requests \ | ||
--auto-ping-connection \ | ||
--auto-respond-messages \ | ||
--auto-respond-credential-proposal \ | ||
--auto-respond-credential-offer \ | ||
--auto-respond-credential-request \ | ||
--auto-verify-presentation \ | ||
--wallet-type 'askar' \ | ||
--wallet-name 'acapy_agent_wallet' \ | ||
--wallet-key 'key' \ | ||
--wallet-storage-type 'postgres_storage' \ | ||
--wallet-storage-config '{\"url\":\"wallet-db:5432\",\"max_connections\":5}' \ | ||
--wallet-storage-creds '{\"account\":\"DB_USER\",\"password\":\"DB_PASSWORD\",\"admin_account\":\"postgres\",\"admin_password\":\"mysecretpassword\"}' \ | ||
--admin '0.0.0.0' 8010 \ | ||
--admin-insecure-mode \ | ||
--label 'tester_agent' \ | ||
--log-level 'info' ", | ||
] | ||
|
||
networks: | ||
wallet-net: | ||
external: | ||
name: docker-test_wallet-net |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: "3" | ||
services: | ||
wallet-db: | ||
build: ./db | ||
environment: | ||
- POSTGRES_USER=DB_USER | ||
- POSTGRES_PASSWORD=DB_PASSWORD | ||
- POSTGRES_ADMIN_USER=postgres | ||
- POSTGRES_ADMIN_PASSWORD=mysecretpassword | ||
networks: | ||
- wallet-net | ||
ports: | ||
- 5432:5432 | ||
volumes: | ||
- wallet-db-data:/var/lib/pgsql/data | ||
|
||
volumes: | ||
wallet-db-data: | ||
|
||
networks: | ||
wallet-net: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters