Skip to content

Add metaflow-fastdata OSS package #16

Add metaflow-fastdata OSS package

Add metaflow-fastdata OSS package #16

name: test-functions
on:
pull_request:
push:
branches:
- main
jobs:
unit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
env:
AWS_ENDPOINT_URL: http://localhost:9000
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
AWS_DEFAULT_REGION: us-east-1
METAFLOW_DEFAULT_DATASTORE: s3
METAFLOW_DATASTORE_SYSROOT_S3: s3://metaflow-test
METAFLOW_CONDA_DEPENDENCY_RESOLVER: micromamba
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Start MinIO
run: |
docker run -d \
-p 9000:9000 \
-e MINIO_ROOT_USER=minioadmin \
-e MINIO_ROOT_PASSWORD=minioadmin \
minio/minio server /data
until curl -sf http://localhost:9000/minio/health/live; do sleep 1; done
- uses: mamba-org/setup-micromamba@b09ef9b599704322748535812ca03efb2625677b # v2.0.5
with:
environment-name: nflxext-dev
condarc: |
channels:
- conda-forge
channel_alias: https://prefix.dev
create-args: python=${{ matrix.python-version }}
- name: Install metaflow-functions + test deps
shell: bash -eo pipefail -l {0}
run: |
pip install metaflow
pip install -e metaflow-netflixext/
pip install -e metaflow-functions/
pip install pytest pytest-xdist fastavro psutil pandas pyarrow pytest-mock
- name: Create minio bucket
shell: bash -eo pipefail -l {0}
run: |
python -c "
import boto3, botocore
s3 = boto3.client(
's3',
endpoint_url='http://localhost:9000',
aws_access_key_id='minioadmin',
aws_secret_access_key='minioadmin',
region_name='us-east-1',
config=botocore.config.Config(signature_version='s3v4'),
)
s3.create_bucket(Bucket='metaflow-test')
print('Bucket metaflow-test created')
"
- name: Run unit tests
shell: bash -eo pipefail -l {0}
run: pytest tests/functions/ -v --junit-xml=junit.xml
- name: Publish test results
uses: dorny/test-reporter@v1
if: always()
with:
name: Functions Unit Tests (py${{ matrix.python-version }})
path: junit.xml
reporter: java-junit
- name: Upload test report
uses: actions/upload-artifact@v4
if: always()
with:
name: functions-unit-test-report-py${{ matrix.python-version }}
path: junit.xml