diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 74e63bbde..a14b94a26 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -14,7 +14,7 @@ jobs: lint: uses: ./.github/workflows/lint.yml with: - runner: "['windows-latest', 'macos-latest']" + runner: "macos-latest" secrets: inherit # test: # uses: ./.github/workflows/test.yml diff --git a/.github/workflows/doctest.yml b/.github/workflows/doctest.yml deleted file mode 100644 index 43873868a..000000000 --- a/.github/workflows/doctest.yml +++ /dev/null @@ -1,48 +0,0 @@ -on: - workflow_call: - inputs: - runner: - type: string - default: "ubuntu-latest" - secrets: - AA_TOKEN: - required: true - HUGGING_FACE_TOKEN: - required: true -jobs: - doctest: - runs-on: ${{inputs.runner}} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: Install and configure Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - installer-parallel: true - - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v4 - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - - - name: Install dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: | - poetry config installer.max-workers 10 - poetry install --no-interaction - - name: install Sphinx - run: sudo apt-get update -y && sudo apt-get install python3-sphinx - - name: run doctest - env: - AA_TOKEN: ${{ secrets.AA_TOKEN }} - HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} - CLIENT_URL: "https://api.aleph-alpha.com" - run: ./scripts/doctest.sh diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 9fb0f451d..cdee16758 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -10,20 +10,16 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: - # doctest: - # uses: ./.github/workflows/doctest.yml - # secrets: inherit - lint: - uses: ./.github/workflows/lint.yml + python-tests: + uses: ./.github/workflows/sdk-tests.yml + with: + runner: 'ubuntu-latest' secrets: inherit - # test: - # uses: ./.github/workflows/test.yml - # secrets: inherit - # run-notebooks: - # uses: ./.github/workflows/run_notebooks.yml - # secrets: inherit macOs: - uses: ./.github/workflows/lint.yml - with: - runner: 'windows-latest' #"['windows-latest', 'macos-latest']" - secrets: inherit + uses: ./.github/workflows/sdk-tests.yml + strategy: + matrix: + os: [macos-latest, windows-latest] + with: + runner: ${{ matrix.os }} #"['windows-latest', 'macos-latest']" + secrets: inherit diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index e12ca1eee..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,48 +0,0 @@ -on: - workflow_call: - inputs: - runner: - type: string - default: "ubuntu-latest" -jobs: - lint: - runs-on: ${{inputs.runner}} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: Install and configure Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - installer-parallel: true - - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v4 - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - - - name: Install dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: | - poetry config installer.max-workers 10 - poetry install --no-interaction - - - name: set PY for pre-commit - run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - - - uses: actions/cache@v4 - with: - path: ~/.cache/pre-commit - key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} - - - name: Run linters - run: | - ./scripts/lint.sh diff --git a/.github/workflows/run_notebooks.yml b/.github/workflows/run_notebooks.yml deleted file mode 100644 index 6e98dea51..000000000 --- a/.github/workflows/run_notebooks.yml +++ /dev/null @@ -1,60 +0,0 @@ -on: - workflow_call: - inputs: - runner: - type: string - default: "ubuntu-latest" - secrets: - AA_TOKEN: - required: true - HUGGING_FACE_TOKEN: - required: true -jobs: - run-notebooks: - runs-on: ${{inputs.runner}} - services: - argilla-elastic-search: - image: docker.elastic.co/elasticsearch/elasticsearch:8.5.3 - env: - ES_JAVA_OPTS: "-Xms512m -Xmx512m" - discovery.type: "single-node" - xpack.security.enabled: "false" - argilla: - image: argilla/argilla-server - ports: - - "6900:6900" - env: - ARGILLA_ELASTICSEARCH: "http://argilla-elastic-search:9200" - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - name: Install and configure Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - installer-parallel: true - - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v4 - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - - name: Install dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: | - poetry config installer.max-workers 10 - poetry install --no-interaction - - name: Configure Poetry for notebooks and run - env: - AA_TOKEN: ${{ secrets.AA_TOKEN }} - HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} - ARGILLA_API_URL: "http://localhost:6900/" - ARGILLA_API_KEY: "argilla.apikey" - CLIENT_URL: "https://api.aleph-alpha.com" - run: | - ./scripts/notebook_runner.sh diff --git a/.github/workflows/sdk-tests.yml b/.github/workflows/sdk-tests.yml new file mode 100644 index 000000000..08d01521a --- /dev/null +++ b/.github/workflows/sdk-tests.yml @@ -0,0 +1,199 @@ +on: + workflow_call: + inputs: + runner: + type: string + default: "ubuntu-latest" + secrets: + AA_TOKEN: + required: true + HUGGING_FACE_TOKEN: + required: true +jobs: + lint: + runs-on: ${{inputs.runner}} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install and configure Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v4 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: | + poetry config installer.max-workers 10 + poetry install --no-interaction + + - name: set PY for pre-commit + run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + + - name: Run linters + run: | + ./scripts/lint.sh + doctest: + runs-on: ${{inputs.runner}} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install and configure Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v4 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: | + poetry config installer.max-workers 10 + poetry install --no-interaction + - name: install Sphinx + run: sudo apt-get update -y && sudo apt-get install python3-sphinx + - name: run doctest + env: + AA_TOKEN: ${{ secrets.AA_TOKEN }} + HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} + CLIENT_URL: "https://api.aleph-alpha.com" + run: ./scripts/doctest.sh + + # test: + # runs-on: ${{inputs.runner}} + # services: + # argilla-elastic-search: + # image: docker.elastic.co/elasticsearch/elasticsearch:8.5.3 + # env: + # ES_JAVA_OPTS: "-Xms512m -Xmx512m" + # discovery.type: "single-node" + # xpack.security.enabled: "false" + # argilla: + # image: argilla/argilla-server + # ports: + # - "6900:6900" + # env: + # ARGILLA_ELASTICSEARCH: "http://argilla-elastic-search:9200" + # open-telemetry-trace-service: + # env: + # COLLECTOR_OTLP_ENABLED: "true" + # ports: + # - "4317:4317" + # - "4318:4318" + # - "16686:16686" + # image: jaegertracing/all-in-one:1.35 + + # steps: + # - name: Checkout repository + # uses: actions/checkout@v4 + + # - uses: actions/setup-python@v5 + # with: + # python-version: "3.10" + + # - name: Install and configure Poetry + # uses: snok/install-poetry@v1 + # with: + # virtualenvs-create: true + # virtualenvs-in-project: true + # installer-parallel: true + + # - name: Load cached venv + # id: cached-poetry-dependencies + # uses: actions/cache@v4 + # with: + # path: .venv + # key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + + # - name: Install dependencies + # if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + # run: | + # poetry config installer.max-workers 10 + # poetry install --no-interaction + + # - name: Run pytest + # env: + # AA_TOKEN: ${{ secrets.AA_TOKEN }} + # HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} + # ARGILLA_API_URL: "http://localhost:6900/" + # ARGILLA_API_KEY: "argilla.apikey" + # CLIENT_URL: "https://api.aleph-alpha.com" + # run: | + # ./scripts/test.sh + # run-notebooks: + # runs-on: ${{inputs.runner}} + # services: + # argilla-elastic-search: + # image: docker.elastic.co/elasticsearch/elasticsearch:8.5.3 + # env: + # ES_JAVA_OPTS: "-Xms512m -Xmx512m" + # discovery.type: "single-node" + # xpack.security.enabled: "false" + # argilla: + # image: argilla/argilla-server + # ports: + # - "6900:6900" + # env: + # ARGILLA_ELASTICSEARCH: "http://argilla-elastic-search:9200" + # steps: + # - name: Checkout repository + # uses: actions/checkout@v4 + # - uses: actions/setup-python@v5 + # with: + # python-version: "3.10" + # - name: Install and configure Poetry + # uses: snok/install-poetry@v1 + # with: + # virtualenvs-create: true + # virtualenvs-in-project: true + # installer-parallel: true + + # - name: Load cached venv + # id: cached-poetry-dependencies + # uses: actions/cache@v4 + # with: + # path: .venv + # key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + # - name: Install dependencies + # if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + # run: | + # poetry config installer.max-workers 10 + # poetry install --no-interaction + # - name: Configure Poetry for notebooks and run + # env: + # AA_TOKEN: ${{ secrets.AA_TOKEN }} + # HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} + # ARGILLA_API_URL: "http://localhost:6900/" + # ARGILLA_API_KEY: "argilla.apikey" + # CLIENT_URL: "https://api.aleph-alpha.com" + # run: | + # ./scripts/notebook_runner.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 5c8309f32..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,73 +0,0 @@ -on: - workflow_call: - inputs: - runner: - type: string - default: "ubuntu-latest" - secrets: - AA_TOKEN: - required: true - HUGGING_FACE_TOKEN: - required: true -jobs: - test: - runs-on: ${{inputs.runner}} - services: - argilla-elastic-search: - image: docker.elastic.co/elasticsearch/elasticsearch:8.5.3 - env: - ES_JAVA_OPTS: "-Xms512m -Xmx512m" - discovery.type: "single-node" - xpack.security.enabled: "false" - argilla: - image: argilla/argilla-server - ports: - - "6900:6900" - env: - ARGILLA_ELASTICSEARCH: "http://argilla-elastic-search:9200" - open-telemetry-trace-service: - env: - COLLECTOR_OTLP_ENABLED: "true" - ports: - - "4317:4317" - - "4318:4318" - - "16686:16686" - image: jaegertracing/all-in-one:1.35 - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: Install and configure Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - installer-parallel: true - - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v4 - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - - - name: Install dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: | - poetry config installer.max-workers 10 - poetry install --no-interaction - - - name: Run pytest - env: - AA_TOKEN: ${{ secrets.AA_TOKEN }} - HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} - ARGILLA_API_URL: "http://localhost:6900/" - ARGILLA_API_KEY: "argilla.apikey" - CLIENT_URL: "https://api.aleph-alpha.com" - run: | - ./scripts/test.sh