Skip to content

Commit

Permalink
use minio for python sdk doctest (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
leric7 authored Mar 6, 2023
1 parent 86bd008 commit 26adee0
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 8 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/ci-test-python-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ jobs:
run: pip install pipenv
- name: Python test
working-directory: ./packages/sdk/python/human-protocol-sdk
env:
ESCROW_AWS_ACCESS_KEY_ID: ${{ secrets.ESCROW_AWS_ACCESS_KEY_ID }}
ESCROW_AWS_SECRET_ACCESS_KEY: ${{ secrets.ESCROW_AWS_SECRET_ACCESS_KEY }}
ESCROW_RESULTS_AWS_S3_ACCESS_KEY_ID: ${{ secrets.ESCROW_RESULTS_AWS_S3_ACCESS_KEY_ID }}
ESCROW_RESULTS_AWS_S3_SECRET_ACCESS_KEY: ${{ secrets.ESCROW_RESULTS_AWS_S3_SECRET_ACCESS_KEY }}
ESCROW_ENDPOINT_URL: https://storage.googleapis.com
run: |
pipenv install --dev
make run-test
3 changes: 3 additions & 0 deletions packages/sdk/python/human-protocol-sdk/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ dist

# ABIs
contracts

# Minio Data
minio/data
8 changes: 8 additions & 0 deletions packages/sdk/python/human-protocol-sdk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@ build-contracts:
format:
pipenv run black .

start-minio:
docker compose -f ./minio/docker-compose.yml up -d

stop-minio:
docker compose -f ./minio/docker-compose.yml down -v

run-test:
make build-contracts
make start-minio
./scripts/run-test.sh
make stop-minio

build-package:
make clean-package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

ESCROW_AWS_REGION = os.getenv("ESCROW_AWS_REGION", "us-west-2")

ESCROW_ENDPOINT_URL = os.getenv("ESCROW_ENDPOINT_URL", "http://minio:9000")
ESCROW_ENDPOINT_URL = os.getenv("ESCROW_ENDPOINT_URL", "http://localhost:9000")
ESCROW_PUBLIC_BUCKETNAME = os.getenv("ESCROW_PUBLIC_BUCKETNAME", ESCROW_ENDPOINT_URL)


Expand Down
34 changes: 34 additions & 0 deletions packages/sdk/python/human-protocol-sdk/minio/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: '3.7'

services:
minio:
container_name: minio
image: minio/minio
ports:
- 9000:9000
- 9001:9001
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
entrypoint: 'sh'
volumes:
- ./data:/data
command: -c "minio server /data --console-address ':9001'"
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 5s
timeout: 5s
retries: 3
minio-mc:
container_name: minio-mc
image: minio/mc
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add myminio http://minio:9000 minio minio123;
/usr/bin/mc mb myminio/escrow-results;
/usr/bin/mc mb myminio/escrow-public-results;
/usr/bin/mc anonymous set public myminio/escrow-public-results;
"
2 changes: 1 addition & 1 deletion packages/sdk/python/human-protocol-sdk/pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[pytest]
addopts = -p no:warnings --doctest-modules
addopts = -p no:warnings --doctest-modules

8 comments on commit 26adee0

@vercel
Copy link

@vercel vercel bot commented on 26adee0 Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

fortune-reputation-oracle-mumbai – ./packages/examples/fortune/reputation-oracle

fortune-reputation-oracle-mumbai-humanprotocol.vercel.app
fortune-reputation-oracle-mumbai.vercel.app
fortune-reputation-oracle-mumbai-git-main-humanprotocol.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 26adee0 Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 26adee0 Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 26adee0 Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

recording-oracle – ./packages/examples/fortune/recording-oracle

recording-oracle-jade.vercel.app
recording-oracle-humanprotocol.vercel.app
recording-oracle-git-main-humanprotocol.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 26adee0 Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 26adee0 Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

job-launcher-client – ./packages/examples/fortune/launcher/client

job-launcher-client-humanprotocol.vercel.app
job-launcher-client-git-main-humanprotocol.vercel.app
job-launcher-client.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 26adee0 Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

job-launcher-server – ./packages/examples/fortune/launcher/server

job-launcher-server-git-main-humanprotocol.vercel.app
job-launcher-server.vercel.app
job-launcher-server-humanprotocol.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 26adee0 Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

human-protocol-escrow-dashboard – ./packages/apps/escrow-dashboard

human-protocol-escrow-dashboard-humanprotocol.vercel.app
dashboard.humanprotocol.org
human-protocol-escrow-dashboard-git-main-humanprotocol.vercel.app

Please sign in to comment.