Skip to content

Optimize Dockerfile. #2078

Optimize Dockerfile.

Optimize Dockerfile. #2078

Workflow file for this run

##
## Copyright 2023 Ocean Protocol Foundation
## SPDX-License-Identifier: Apache-2.0
##
name: Provider tests
on:
- push
- pull_request
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup Provider
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'
- uses: actions/checkout@v2
name: Checkout Barge
with:
repository: "oceanprotocol/barge"
path: 'barge'
- name: Login to Docker Hub
if: ${{ env.DOCKERHUB_PASSWORD && env.DOCKERHUB_USERNAME }}
run: |
echo "Login to Docker Hub";echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Run Barge
working-directory: ${{ github.workspace }}/barge
run: |
bash -x start_ocean.sh --no-dashboard 2>&1 --with-rbac --with-provider2 --with-thegraph --with-c2d --skip-subgraph-deploy > start_ocean.log &
- name: Install dependencies
working-directory: ${{ github.workspace }}
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
- name: Delete default runner images
run: |
docker image rm node:14
docker image rm node:14-alpine
docker image rm node:16
docker image rm node:16-alpine
docker image rm node:18
docker image rm node:18-alpine
docker image rm node:20
docker image rm node:20-alpine
docker image rm buildpack-deps:buster
docker image rm buildpack-deps:bullseye
docker image rm debian:10
docker image rm debian:11
docker image rm moby/buildkit:latest
docker image rm alpine:3.16
docker image rm alpine:3.17
docker image rm alpine:3.18
- name: Wait for contracts deployment and C2D cluster to be ready
working-directory: ${{ github.workspace }}/barge
run: |
for i in $(seq 1 250); do
sleep 10
[ -f "$HOME/.ocean/ocean-contracts/artifacts/ready" -a -f "$HOME/.ocean/ocean-c2d/ready" ] && break
done
- name: Verify deployments
run: |
cat $HOME/.ocean/ocean-contracts/artifacts/address.json
- name: Test with pytest
run: |
coverage run --source ocean_provider -m pytest
coverage report
coverage xml
- name: docker logs
run: docker logs ocean_aquarius_1 && docker logs ocean_provider_1 && docker logs ocean_provider2_1 && docker logs ocean_ipfs_1
if: ${{ failure() }}
- name: Publish code coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: b0d75c25d5176c59e8ea665bf74396d9ee1bdf2c97f11ccc6869f9e91d80a6c7
dockerbuild:
runs-on: ubuntu-latest
needs: [build]
if: ${{ success() && github.event_name == 'pull_request'}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: docker build -t "testimage:latest" .