Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile End to End test #818

Open
wants to merge 54 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
4ed88b6
Basic docker compose for mobile stack testing
macpie May 21, 2024
5a34a16
Basic test mobile stack
macpie May 21, 2024
4d5c74a
Add mobile config
macpie May 22, 2024
8c33ce4
Add compose up and down
macpie May 22, 2024
dc37931
Add packet verifier
macpie May 23, 2024
3f4938d
Add db seeder to add keys to mobile config DB
macpie May 23, 2024
3278ba1
Only start config when seeder is done
macpie May 23, 2024
ff8d81a
Fixup seeder and packet verifier startup
macpie May 23, 2024
2283ba5
Simpler dockerfile
macpie May 23, 2024
f38eb69
Add verifier and improve seeder
macpie May 23, 2024
643872f
Do not update created_at
macpie May 24, 2024
dc60ed5
Upgrade to latest main and init verifier bucket with local dataset
macpie May 24, 2024
b975078
Auto load data sets for verifier
macpie May 24, 2024
9d0049b
Add todo geofence files
macpie May 24, 2024
4caefc1
Publish actual geofence
macpie May 28, 2024
3dbbfbf
Generate assignment files
macpie May 28, 2024
2ba08b6
Fix assignment encoding
macpie May 28, 2024
65bb555
Generate price report for mobile verifier
macpie May 29, 2024
0a87b08
Add reward_index
macpie May 29, 2024
d6029e0
Improve init s3 to update timestamp and add descriptions
macpie May 29, 2024
eb067d5
Add add server up in test
macpie May 29, 2024
1be6341
Test skeleton
macpie May 30, 2024
47b475f
Simplify script
macpie May 30, 2024
4aaf9e6
Test cleanup
macpie May 30, 2024
e98e7b5
Update readme
macpie May 30, 2024
a5b59d6
Add docs
macpie May 30, 2024
2388346
Fix link
macpie May 30, 2024
ee70bf6
Fix again
macpie May 30, 2024
5682a7d
Fix readme
macpie May 30, 2024
e778184
Slightly better docker files
macpie May 30, 2024
589ed41
make env into file
macpie May 31, 2024
1e93f90
Improve submit_speedtest
macpie May 31, 2024
0886549
Add set_metadata to wrap req with api token
macpie May 31, 2024
ce6dd98
Add basic coverage_object
macpie May 31, 2024
a978d99
Add feature ingest/time (HONOR_TIMESTAMP)
macpie Jun 3, 2024
50ec7e4
Fix directories
macpie Jun 3, 2024
d569c3c
manipulate req times
macpie Jun 3, 2024
c796ae6
Send 12 wifi heartbeat
macpie Jun 3, 2024
b13d90e
Update Roll Time
macpie Jun 3, 2024
504a16d
remove data from data_sets_directory
macpie Jun 4, 2024
220bfeb
Attempt to inset data into metadata
macpie Jun 4, 2024
7cf11b7
Fix for verifier
macpie Jun 5, 2024
192a535
Fix Price report
macpie Jun 6, 2024
5b95628
Enable full rewards
macpie Jun 6, 2024
4939f76
Make CoverageObjectReqV1 valid
macpie Jun 6, 2024
681f1b4
Make wifi heartbeat file process epoch larger
macpie Jun 6, 2024
ad41bc2
- Fix boosted by adding tables
macpie Jun 7, 2024
ff1d756
Some timestamps are in seconds ...
macpie Jun 7, 2024
22f2408
Full test!
macpie Jun 7, 2024
bea5cf7
Cleanup when test is successful
macpie Jun 7, 2024
ef88c24
Improve TestGuard
macpie Jun 7, 2024
c5d4587
Avoid rate limit
macpie Jun 10, 2024
86bd7f0
More comments
macpie Jun 10, 2024
0265724
rename test feature
macpie Jun 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache
uses: actions/cache@v4
Expand Down Expand Up @@ -78,6 +80,8 @@ jobs:

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Clippy
run: cargo clippy --all-targets -- -Dclippy::all -D warnings
Expand Down Expand Up @@ -113,6 +117,8 @@ jobs:

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache
uses: actions/cache@v4
Expand Down Expand Up @@ -149,6 +155,8 @@ jobs:

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache
uses: actions/cache@v4
Expand Down Expand Up @@ -178,6 +186,8 @@ jobs:

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache
uses: actions/cache@v4
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ flamegraph.*

!/minio/bucket-policy.json
*.bak

docker/mobile/verifier/data_sets_directory/*
29 changes: 29 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ members = [
"reward_scheduler",
"solana",
"task_manager",
"hex_assignments"
"hex_assignments",
"test_mobile",
]
resolver = "2"

Expand Down
160 changes: 0 additions & 160 deletions docker-compose.yml

This file was deleted.

12 changes: 12 additions & 0 deletions docker/mobile/.env-mobile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
RUST_BACKTRACE=1

# As the be set for s3 file store
AWS_ACCESS_KEY_ID=AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY=AWS_SECRET_ACCESS_KEY
AWS_SESSION_TOKEN=AWS_SESSION_TOKEN

# Ingest: use timestamps sent by client. This allows to send heartbeats from 24 hours ago.
HONOR_TIMESTAMP=0

# Mobile Verifier: Allow to process heartbeats that are more than 3 hours old.
PROCESS_FILE_EPOCH_MIN=48
60 changes: 60 additions & 0 deletions docker/mobile/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
FROM rust:latest AS builder

RUN apt-get update && apt-get install -y \
gcc \
curl \
protobuf-compiler \
pkg-config \
openssl \
libssl-dev

# Copy Deps
COPY custom_tracing custom_tracing/
COPY db_store db_store/
COPY file_store file_store/
COPY hex_assignments hex_assignments/
COPY metrics metrics/
COPY price price/
COPY reward_scheduler reward_scheduler/
COPY solana solana/
COPY task_manager task_manager/
COPY Cargo.toml Cargo.toml
COPY Cargo.lock Cargo.lock

# Copy mobile pakages
COPY ingest ingest/
COPY mobile_config mobile_config/
COPY mobile_packet_verifier mobile_packet_verifier/
COPY mobile_verifier mobile_verifier/
COPY reward_index reward_index/

# Remove useless packages from toml
RUN sed -i \
-e '/denylist/d' \
-e '/iot_config/d' \
-e '/iot_packet_verifier/d' \
-e '/iot_verifier/d' \
-e '/poc_entropy/d' \
-e '/mobile_config_cli/d' \
-e '/boost_manager/d' \
-e '/test_mobile/d' \
Cargo.toml

# Build releases
RUN cargo build --features "ingest/mobile-test,mobile-verifier/mobile-test" --release

# Package Runners
FROM debian:bookworm-slim

RUN apt-get update && apt-get install -y \
libssl-dev \
ca-certificates

ARG PACKAGE

# $PACKAGE via build args
COPY --from=builder ./target/release/$PACKAGE /opt/$PACKAGE/bin/$PACKAGE

ENV PACKAGE=${PACKAGE}

CMD /opt/$PACKAGE/bin/$PACKAGE -c /opt/$PACKAGE/etc/settings.toml server
1 change: 1 addition & 0 deletions docker/mobile/config/keypair.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
p��2��� ��}�gh�D�(�Z���d� C���MW��4�n��U"��}�լ+�{S
Expand Down
16 changes: 16 additions & 0 deletions docker/mobile/config/settings.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
log = "mobile_config=debug,file_store=info,custom_tracing=info"
listen = "0.0.0.0:9081"
signing_keypair = "/opt/mobile-config/etc/keypair.bin"
admin_pubkey = "131kC5gTPFfTyzziHbh2PWz2VSdF4gDvhoC5vqCz25N7LFtDocF"
# ./target/release/mobile-config-cli env info --keypair=docker/mobile/config/keypair.bin

[database]
url = "postgres://postgres:postgres@postgres:5432/mobile_config"
max_connections = 10

[metadata]
url = "postgres://postgres:postgres@postgres:5432/mobile_metadata"
max_connections = 10

[metrics]
endpoint = "0.0.0.0:19000"
Loading