From 340aa114874ebd5a07bbab3b478f625b2700ccf1 Mon Sep 17 00:00:00 2001 From: Jonathan Almeida Date: Fri, 17 May 2024 15:13:24 -0400 Subject: [PATCH] task(scripts): Add cirrus service in a dev environment Co-authored-by: dschom --- _dev/pm2/infrastructure.config.js | 6 ++++++ _scripts/check-ports.sh | 1 + _scripts/cirrus.sh | 10 ++++++++++ _scripts/configs/cirrus.env.sample | 10 ++++++++++ _scripts/configs/cirrus.fml.yml | 26 ++++++++++++++++++++++++++ 5 files changed, 53 insertions(+) create mode 100755 _scripts/cirrus.sh create mode 100644 _scripts/configs/cirrus.env.sample create mode 100644 _scripts/configs/cirrus.fml.yml diff --git a/_dev/pm2/infrastructure.config.js b/_dev/pm2/infrastructure.config.js index 95590a5c6e..2493a4bb79 100644 --- a/_dev/pm2/infrastructure.config.js +++ b/_dev/pm2/infrastructure.config.js @@ -60,5 +60,11 @@ module.exports = { autorestart: false, kill_timeout: 20000, }, + { + name: 'cirrus', + script: '_scripts/cirrus.sh', + autorestart: false, + kill_timeout: 20000, + }, ], }; diff --git a/_scripts/check-ports.sh b/_scripts/check-ports.sh index 2e828a0dc9..9b26117cf6 100755 --- a/_scripts/check-ports.sh +++ b/_scripts/check-ports.sh @@ -7,6 +7,7 @@ PORTS=( 8085 # google-pubsub-emulator 9090 # google-firestore-emulator 5000 # sync server + 8001 # cirrus (experimenter) 8000 # auth-server db mysql 9000 # auth-server key server 3030 # content-server diff --git a/_scripts/cirrus.sh b/_scripts/cirrus.sh new file mode 100755 index 0000000000..fa643cabf2 --- /dev/null +++ b/_scripts/cirrus.sh @@ -0,0 +1,10 @@ +#!/bin/bash -ex + +echo -e "Starting cirrus experimenter." + +docker run --rm --name cirrus \ + --net fxa \ + --mount type=bind,source=$(pwd)/_scripts/configs/cirrus.env.sample,target=/cirrus/.env \ + --mount type=bind,source=$(pwd)/_scripts/configs/cirrus.fml.yml,target=/cirrus/feature_manifest/fml.yml \ + -p 8001:8001 \ + mozilla/cirrus:latest diff --git a/_scripts/configs/cirrus.env.sample b/_scripts/configs/cirrus.env.sample new file mode 100644 index 0000000000..69661bcbf2 --- /dev/null +++ b/_scripts/configs/cirrus.env.sample @@ -0,0 +1,10 @@ +CIRRUS_REMOTE_SETTING_URL=https://firefox.settings.services.mozilla.com/v1/buckets/main/collections/nimbus-web-experiments/records +CIRRUS_REMOTE_SETTING_REFRESH_RATE_IN_SECONDS=10 +CIRRUS_APP_ID=test_app_id +CIRRUS_APP_NAME=test_app_name +CIRRUS_CHANNEL=release +CIRRUS_FML_PATH=/cirrus/feature_manifest/sample.yml +# CIRRUS_SENTRY_DSN=dsn_url +CIRRUS_INSTANCE_NAME=cirrus_pod_app_v1 +CIRRUS_ENV_NAME=test_app_stage +CIRRUS_GLEAN_MAX_EVENTS_BUFFER=10 diff --git a/_scripts/configs/cirrus.fml.yml b/_scripts/configs/cirrus.fml.yml new file mode 100644 index 0000000000..5bdce71c3a --- /dev/null +++ b/_scripts/configs/cirrus.fml.yml @@ -0,0 +1,26 @@ +about: + description: Nimbus Feature Manifest for Python Testing +channels: + - beta + - release +features: + example-feature: + description: An example feature + variables: + enabled: + description: If the feature is enabled + type: Boolean + default: false + something: + description: Another variable + type: Option + default: null + defaults: + - channel: beta + value: { "enabled": true } + - channel: release + value: { "something": "wicked" } + +types: + objects: {} + enums: {}