Skip to content

Commit

Permalink
build: revert "test: create configurable pipeline"
Browse files Browse the repository at this point in the history
This reverts commit 8ebbcfc.
  • Loading branch information
grisha87 committed Nov 28, 2023
1 parent cd3b295 commit da9d6d7
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 181 deletions.
61 changes: 17 additions & 44 deletions .github/workflows/cypress-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,11 @@ name: Nightly Cypress Tests

on:
schedule:
# run this workflow every day at 1:20 AM UTC
- cron: "20 1 * * *"

# Allows triggering the workflow manually
workflow_dispatch:
inputs:
provider_version:
description: "Provider version (e.g., v0.12.3 or pre-rel-v0.13.1)"
required: false
default: "v0.12.3"
requestor_version:
description: "Requestor version (e.g., v0.12.3 or pre-rel-v0.13.1)"
required: false
default: "v0.12.3"
provider_wasi_version:
description: "Provider WASI version (e.g., v0.2.2)"
required: false
default: "v0.2.2"
provider_vm_version:
description: "Provider VM version (e.g., v0.3.0)"
required: false
default: "v0.3.0"

jobs:
cypress-tests:
Expand All @@ -35,43 +21,31 @@ jobs:
uses: actions/checkout@v3

- name: Use random string for subnet
# Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2
run: echo "YAGNA_SUBNET=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')" >> $GITHUB_ENV

- name: Set up Versions
run: |
echo "PROVIDER_VERSION=${PROVIDER_VERSION}" >> $GITHUB_ENV
echo "REQUESTOR_VERSION=${REQUESTOR_VERSION}" >> $GITHUB_ENV
echo "PROVIDER_WASI_VERSION=${PROVIDER_WASI_VERSION}" >> $GITHUB_ENV
echo "PROVIDER_VM_VERSION=${PROVIDER_VM_VERSION}" >> $GITHUB_ENV
- name: Build the docker containers
run: |
docker compose -f tests/docker/docker-compose.yml build \
--build-arg UBUNTU_VERSION=22.04 \
--build-arg YA_CORE_PROVIDER_VERSION=${PROVIDER_VERSION} \
--build-arg YA_CORE_REQUESTOR_VERSION=${REQUESTOR_VERSION} \
--build-arg YA_WASI_VERSION=${PROVIDER_WASI_VERSION} \
--build-arg YA_VM_VERSION=${PROVIDER_VM_VERSION}
run: docker compose -f tests/docker/docker-compose.yml build

- name: Start the docker containers
run: |
sudo service docker restart
docker compose -f tests/docker/docker-compose.yml down
docker compose -f tests/docker/docker-compose.yml up -d
# Restart docker to avoid issues with the docker compose down due to improper cleanup of the previous run.
run: sudo service docker restart && docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d

- name: Fund the requestor
run: |
sleep 4
docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"
# Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry.
run: sleep 4 && docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"

- name: Install and build the SDK
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build && ./node_modules/.bin/cypress install"
- name: Install and build the SDK in the docker container
run: |
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build && ./node_modules/.bin/cypress install"
- name: Run web server
run: docker exec -t -d docker-requestor-1 /bin/sh -c "cd /golem-js/examples/web && node app.mjs"
run: |
docker exec -t -d docker-requestor-1 /bin/sh -c "cd /golem-js/examples/web && node app.mjs"
- name: Run test suite
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm run test:cypress -- --browser chromium"
run: |
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm run test:cypress -- --browser chromium"
- name: Upload test logs
uses: actions/upload-artifact@v2
Expand All @@ -83,6 +57,5 @@ jobs:
- name: Cleanup Docker
if: always()
run: |
c=$(docker ps -q)
[[ $c ]] && docker kill $c
c=$(docker ps -q) && [[ $c ]] && docker kill $c
docker system prune -af
50 changes: 16 additions & 34 deletions .github/workflows/examples-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,11 @@ name: Nightly Examples Tests

on:
schedule:
# run this workflow every day at 1:30 AM UTC
- cron: "30 1 * * *"

# Allows triggering the workflow manually
workflow_dispatch:
inputs:
provider_version:
description: "Provider version (e.g., v0.12.3 or pre-rel-v0.13.1)"
required: false
default: "v0.12.3"
requestor_version:
description: "Requestor version (e.g., v0.12.3 or pre-rel-v0.13.1)"
required: false
default: "v0.12.3"
provider_wasi_version:
description: "Provider WASI version (e.g., v0.2.2)"
required: false
default: "v0.2.2"
provider_vm_version:
description: "Provider VM version (e.g., v0.3.0)"
required: false
default: "v0.3.0"

jobs:
prepare-matrix-master-only:
Expand All @@ -33,6 +19,7 @@ jobs:
- name: Get matrix JSON
id: get-matrix
run: echo "::set-output name=matrix::{\"include\":[{\"branch\":\"master\"}]}"

goth-tests:
runs-on: goth2
needs: prepare-matrix-master-only
Expand All @@ -44,41 +31,36 @@ jobs:
strategy:
matrix: ${{ fromJson(needs.prepare-matrix-master-only.outputs.matrix-json) }}
fail-fast: false
name: Run example tests (nightly) on ${{ matrix.branch }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use random string for subnet
# Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2
run: echo "YAGNA_SUBNET=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')" >> $GITHUB_ENV

- name: Set up Versions
run: |
echo "PROVIDER_VERSION=${PROVIDER_VERSION}" >> $GITHUB_ENV
echo "REQUESTOR_VERSION=${REQUESTOR_VERSION}" >> $GITHUB_ENV
echo "PROVIDER_WASI_VERSION=${PROVIDER_WASI_VERSION}" >> $GITHUB_ENV
echo "PROVIDER_VM_VERSION=${PROVIDER_VM_VERSION}" >> $GITHUB_ENV
- name: Build the docker containers
run: |
docker compose -f tests/docker/docker-compose.yml build \
--build-arg UBUNTU_VERSION=22.04 \
--build-arg YA_CORE_PROVIDER_VERSION=${PROVIDER_VERSION} \
--build-arg YA_CORE_REQUESTOR_VERSION=${REQUESTOR_VERSION} \
--build-arg YA_WASI_VERSION=${PROVIDER_WASI_VERSION} \
--build-arg YA_VM_VERSION=${PROVIDER_VM_VERSION}
run: docker compose -f tests/docker/docker-compose.yml build

- name: Start the docker containers
# Restart docker to avoid issues with the docker compose down due to improper cleanup of the previous run.
run: sudo service docker restart && docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d

- name: Fund the requestor
# Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry.
run: sleep 10 && docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"

- name: Install and build the SDK in the docker container
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build"
run: |
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build"
- name: Run the Examples tests
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm install --prefix examples && npm install ts-node && npm run test:examples -- --exitOnError"
run: |
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm install --prefix examples && npm install ts-node && npm run test:examples -- --exitOnError"
- name: Cleanup Docker
if: always()
run: docker ps -q | xargs -r docker kill && docker system prune -af
run: |
c=$(docker ps -q) && [[ $c ]] && docker kill $c
docker system prune -af
57 changes: 13 additions & 44 deletions .github/workflows/goth-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,11 @@ name: Nightly E2E Tests

on:
schedule:
# run this workflow every day at 1:00 AM UTC
- cron: "0 1 * * *"

# Allows triggering the workflow manually
workflow_dispatch:
inputs:
provider_version:
description: "Provider version (e.g., v0.12.3 or pre-rel-v0.13.1)"
required: false
default: "v0.12.3"
requestor_version:
description: "Requestor version (e.g., v0.12.3 or pre-rel-v0.13.1)"
required: false
default: "v0.12.3"
provider_wasi_version:
description: "Provider WASI version (e.g., v0.2.2)"
required: false
default: "v0.2.2"
provider_vm_version:
description: "Provider VM version (e.g., v0.3.0)"
required: false
default: "v0.3.0"

jobs:
prepare-matrix-master-only:
Expand Down Expand Up @@ -52,45 +38,28 @@ jobs:

- name: Use random string for subnet
# Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2

run: echo "YAGNA_SUBNET=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')" >> $GITHUB_ENV

- name: Set up Versions
run: |
echo "PROVIDER_VERSION=${PROVIDER_VERSION}" >> $GITHUB_ENV
echo "REQUESTOR_VERSION=${REQUESTOR_VERSION}" >> $GITHUB_ENV
echo "PROVIDER_WASI_VERSION=${PROVIDER_WASI_VERSION}" >> $GITHUB_ENV
echo "PROVIDER_VM_VERSION=${PROVIDER_VM_VERSION}" >> $GITHUB_ENV
- name: Build the docker containers
run: |
docker compose -f tests/docker/docker-compose.yml build \
--build-arg UBUNTU_VERSION=22.04 \
--build-arg YA_CORE_PROVIDER_VERSION=${PROVIDER_VERSION} \
--build-arg YA_CORE_REQUESTOR_VERSION=${REQUESTOR_VERSION} \
--build-arg YA_WASI_VERSION=${PROVIDER_WASI_VERSION} \
--build-arg YA_VM_VERSION=${PROVIDER_VM_VERSION}
run: docker compose -f tests/docker/docker-compose.yml build

- name: Start the docker containers
run: |
sudo service docker restart
docker compose -f tests/docker/docker-compose.yml down
docker compose -f tests/docker/docker-compose.yml up -d
# Restart docker to avoid issues with the docker compose down due to improper cleanup of the previous run.
run: sudo service docker restart && docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d

- name: Fund the requestor
run: |
sleep 10
docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"
# Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry.
run: sleep 10 && docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"

- name: Install and build the SDK
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build"
- name: Install and build the SDK in the docker container
run: |
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build"
- name: Start the e2e test
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run test:e2e"
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run test:e2e -- --reporters github-actions --reporters summary"

- name: Cleanup Docker
if: always()
run: |
c=$(docker ps -q)
[[ $c ]] && docker kill $c
c=$(docker ps -q) && [[ $c ]] && docker kill $c
docker system prune -af
46 changes: 6 additions & 40 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,6 @@ on:

# Allows triggering the workflow manually
workflow_dispatch:
inputs:
provider_version:
description: "Provider version (e.g., v0.12.3 or pre-rel-v0.13.1)"
required: false
default: "v0.12.3"
requestor_version:
description: "Requestor version (e.g., v0.12.3 or pre-rel-v0.13.1)"
required: false
default: "v0.12.3"
provider_wasi_version:
description: "Provider WASI version (e.g., v0.2.2)"
required: false
default: "v0.2.2"
provider_vm_version:
description: "Provider VM version (e.g., v0.3.0)"
required: false
default: "v0.3.0"

# We're going to interact with GH from the pipelines, so we need to get some permissions
permissions:
Expand Down Expand Up @@ -80,32 +63,16 @@ jobs:
# Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2
run: echo "YAGNA_SUBNET=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')" >> $GITHUB_ENV

- name: Set up Versions
run: |
echo "PROVIDER_VERSION=${PROVIDER_VERSION}" >> $GITHUB_ENV
echo "REQUESTOR_VERSION=${REQUESTOR_VERSION}" >> $GITHUB_ENV
echo "PROVIDER_WASI_VERSION=${PROVIDER_WASI_VERSION}" >> $GITHUB_ENV
echo "PROVIDER_VM_VERSION=${PROVIDER_VM_VERSION}" >> $GITHUB_ENV
- name: Build the docker containers
run: |
docker compose -f tests/docker/docker-compose.yml build \
--build-arg UBUNTU_VERSION=22.04 \
--build-arg YA_CORE_PROVIDER_VERSION=${PROVIDER_VERSION} \
--build-arg YA_CORE_REQUESTOR_VERSION=${REQUESTOR_VERSION} \
--build-arg YA_WASI_VERSION=${PROVIDER_WASI_VERSION} \
--build-arg YA_VM_VERSION=${PROVIDER_VM_VERSION}
run: docker compose -f tests/docker/docker-compose.yml build

- name: Start the docker containers
run: |
sudo service docker restart
docker compose -f tests/docker/docker-compose.yml down
docker compose -f tests/docker/docker-compose.yml up -d
# Restart docker to avoid issues with the docker compose down due to improper cleanup of the previous run.
run: sudo service docker restart && docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d

- name: Fund the requestor
run: |
sleep 10
docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"
# Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry.
run: sleep 4 && docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"

- name: Install and build the SDK in the docker container
run: |
Expand Down Expand Up @@ -137,8 +104,7 @@ jobs:
- name: Cleanup Docker
if: always()
run: |
c=$(docker ps -q)
[[ $c ]] && docker kill $c
c=$(docker ps -q) && [[ $c ]] && docker kill $c
docker system prune -af
release:
Expand Down
28 changes: 14 additions & 14 deletions tests/docker/Provider.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
ARG UBUNTU_VERSION=22.04
ARG YA_CORE_PROVIDER_VERSION=v0.12.3
ARG YA_WASI_VERSION=v0.2.2
ARG YA_VM_VERSION=v0.3.0
ARG YA_CORE_VERSION=0.12.3
ARG YA_WASI_VERSION=0.2.2
ARG YA_VM_VERSION=0.3.0

FROM ubuntu:${UBUNTU_VERSION}
ARG YA_CORE_PROVIDER_VERSION
ARG YA_CORE_VERSION
ARG YA_WASI_VERSION
ARG YA_VM_VERSION
ARG YA_DIR_INSTALLER=/ya-installer
Expand All @@ -25,16 +25,16 @@ RUN apt-get update -q \
&& mkdir -p ${YA_DIR_PLUGINS} \
&& mkdir ${YA_DIR_INSTALLER} \
&& cd ${YA_DIR_INSTALLER} \
&& wget -q "https://github.com/golemfactory/yagna/releases/download/${YA_CORE_PROVIDER_VERSION}/golem-provider-linux-${YA_CORE_PROVIDER_VERSION}.tar.gz" \
&& wget -q "https://github.com/golemfactory/ya-runtime-wasi/releases/download/${YA_WASI_VERSION}/ya-runtime-wasi-linux-${YA_WASI_VERSION}.tar.gz" \
&& wget -q "https://github.com/golemfactory/ya-runtime-vm/releases/download/${YA_VM_VERSION}/ya-runtime-vm-linux-${YA_VM_VERSION}.tar.gz" \
&& tar -zxvf golem-provider-linux-${YA_CORE_PROVIDER_VERSION}.tar.gz \
&& tar -zxvf ya-runtime-wasi-linux-${YA_WASI_VERSION}.tar.gz \
&& tar -zxvf ya-runtime-vm-linux-${YA_VM_VERSION}.tar.gz \
&& find golem-provider-linux-${YA_CORE_PROVIDER_VERSION} -executable -type f -exec cp {} ${YA_DIR_BIN} \; \
&& cp -R golem-provider-linux-${YA_CORE_PROVIDER_VERSION}/plugins/* ${YA_DIR_PLUGINS} \
&& cp -R ya-runtime-wasi-linux-${YA_WASI_VERSION}/* ${YA_DIR_PLUGINS} \
&& cp -R ya-runtime-vm-linux-${YA_VM_VERSION}/* ${YA_DIR_PLUGINS} \
&& wget -q "https://github.com/golemfactory/yagna/releases/download/v${YA_CORE_VERSION}/golem-provider-linux-v${YA_CORE_VERSION}.tar.gz" \
&& wget -q "https://github.com/golemfactory/ya-runtime-wasi/releases/download/v${YA_WASI_VERSION}/ya-runtime-wasi-linux-v${YA_WASI_VERSION}.tar.gz" \
&& wget -q "https://github.com/golemfactory/ya-runtime-vm/releases/download/v${YA_VM_VERSION}/ya-runtime-vm-linux-v${YA_VM_VERSION}.tar.gz" \
&& tar -zxvf golem-provider-linux-v${YA_CORE_VERSION}.tar.gz \
&& tar -zxvf ya-runtime-wasi-linux-v${YA_WASI_VERSION}.tar.gz \
&& tar -zxvf ya-runtime-vm-linux-v${YA_VM_VERSION}.tar.gz \
&& find golem-provider-linux-v${YA_CORE_VERSION} -executable -type f -exec cp {} ${YA_DIR_BIN} \; \
&& cp -R golem-provider-linux-v${YA_CORE_VERSION}/plugins/* ${YA_DIR_PLUGINS} \
&& cp -R ya-runtime-wasi-linux-v${YA_WASI_VERSION}/* ${YA_DIR_PLUGINS} \
&& cp -R ya-runtime-vm-linux-v${YA_VM_VERSION}/* ${YA_DIR_PLUGINS} \
&& rm -Rf ${YA_DIR_INSTALLER}
COPY ./configureProvider.py /configureProvider.py

Expand Down
Loading

0 comments on commit da9d6d7

Please sign in to comment.