diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 041ae04..02a5caa 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -1,6 +1,8 @@ name: Integration Tests on: [push, workflow_dispatch] +# TODO - add option for stable/nightly channel + env: MODALITY_URL: "http://localhost:14181/v1" MODALITY_WORKSPACE: "ci-tests" @@ -57,21 +59,29 @@ jobs: - name: Build release binary run: cargo build --release - - name: Install Auxon packages + - name: Install Auxon client packages env: DEBIAN_FRONTEND: noninteractive run: | wget --no-verbose --quiet https://get.keygen.sh/auxon-io/auxon.deb -O /tmp/auxon.deb sudo apt-get install -y /tmp/auxon.deb sudo apt-get update - sudo apt-get install -y --no-install-recommends modalityd modality-client modality-reflector conform deviant + sudo apt-get install -y --no-install-recommends modality-client conform deviant - - name: Setup Modality server + - name: Start Modality server run: | - sudo systemctl stop modalityd - echo 'license-key = "'"${{secrets.MODALITY_LICENSE_KEY}}"'"' | sudo tee -a /etc/modalityd/config.toml - sudo systemctl start modalityd - sudo systemctl status modalityd --no-pager --full + mkdir -p modalityd_data + docker run \ + --name modalityd \ + --network=host \ + -v "$(pwd)/modalityd_data:/data-dir" \ + -e MODALITY_ACCEPT_EULA=Y \ + -e MODALITY_LICENSE_KEY="${{secrets.MODALITY_LICENSE_KEY}}" \ + -e NO_TLS=Y \ + -d --rm \ + ghcr.io/auxoncorp/modalityd-nightly:latest + docker logs modalityd + curl --retry-max-time 30 --retry 10 --retry-connrefused ${{env.MODALITY_URL}}/alive - name: Setup initial Modality configuration @@ -84,6 +94,8 @@ jobs: - name: Update reflector plugins run: | + sudo mkdir -p /usr/lib/modality-reflector-plugins/importers + sudo mkdir -p /usr/lib/modality-reflector-plugins/collectors sudo cp target/release/modality-trace-recorder-importer /usr/lib/modality-reflector-plugins/importers/ sudo cp target/release/modality-trace-recorder-tcp-collector /usr/lib/modality-reflector-plugins/collectors/ sudo cp target/release/modality-trace-recorder-itm-collector /usr/lib/modality-reflector-plugins/collectors/ @@ -100,11 +112,28 @@ jobs: working-directory: test_system run: ./scripts/build.sh + - name: Start Modality Reflector + working-directory: test_system + run: | + docker run \ + --name reflector \ + --network=host + -e MODALITY_HOST=localhost \ + -v "/usr/lib/modality-reflector-plugins:/usr/lib/modality-reflector-plugins" \ + -v "$(pwd)/reflector-config.toml:/reflector-config.toml" \ + -e MODALITY_AUTH_TOKEN="${{env.MODALITY_AUTH_TOKEN}}" \ + -e REFLECTOR_OPTS='--config /reflector-config.toml --collector trace-recorder-tcp' \ + -d --rm \ + ghcr.io/auxoncorp/modality-reflector-nightly:latest + docker logs reflector + - name: Run the system working-directory: test_system env: MODALITY_AUTH_TOKEN: ${{env.MODALITY_AUTH_TOKEN}} - run: ./scripts/run.sh + run: | + ./scripts/run.sh + docker container stop reflector - name: Inspect data env: @@ -129,9 +158,9 @@ jobs: tarfile=trc_test_system_modality_data_${datetime}.tar.gz echo TARBALL_NAME=${tarfile} >> $GITHUB_ENV - sudo systemctl stop modalityd - modality user auth-token | sudo tee /var/lib/modality/user_auth_token - cd /tmp && sudo tar czvf ${tarfile} -C /var/lib modality + docker container stop modalityd + modality user auth-token > modalityd_data/user_auth_token + tar czvf ${tarfile} modalityd_data - name: Upload Modality data uses: actions/upload-artifact@v4 @@ -139,6 +168,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: name: ${{ env.TARBALL_NAME }} - path: /tmp/${{ env.TARBALL_NAME }} + path: ${{ env.TARBALL_NAME }} retention-days: 2 if-no-files-found: error diff --git a/test_system/scripts/run-reflector.sh b/test_system/scripts/run-reflector.sh index fd1ceee..7a66f07 100755 --- a/test_system/scripts/run-reflector.sh +++ b/test_system/scripts/run-reflector.sh @@ -2,6 +2,6 @@ set -euo pipefail -modality-reflector run --config reflector-config.toml --collector trace-recorder-tcp +RUST_LOG=error modality-reflector run --config reflector-config.toml --collector trace-recorder-tcp exit 0 diff --git a/test_system/scripts/run.sh b/test_system/scripts/run.sh index d2e75b8..30c5228 100755 --- a/test_system/scripts/run.sh +++ b/test_system/scripts/run.sh @@ -2,17 +2,11 @@ set -euo pipefail -RUST_LOG=error modality-reflector run --config reflector-config.toml --collector trace-recorder-tcp & -refl_pid=$! - ( cd build make emulate ) -kill -SIGINT $refl_pid -wait $refl_pid - modality internal sync-indices exit 0