Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jonlamb-gh committed Feb 14, 2024
1 parent 257c6cd commit 2967b14
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 18 deletions.
51 changes: 40 additions & 11 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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/
Expand All @@ -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 \
-p 14188:14188 \
-e MODALITY_HOST=auxon.io \
-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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test_system/scripts/run-reflector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 0 additions & 6 deletions test_system/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2967b14

Please sign in to comment.