From f3d7c12c09b996fa5c034d2bd8bfe80dd7518c72 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Mon, 11 Mar 2024 19:22:03 +0300 Subject: [PATCH 01/29] draft version of independent device connector image --- roles/devices/templates/zebrunner-farm | 57 ++++++++++++++++++++------ 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/roles/devices/templates/zebrunner-farm b/roles/devices/templates/zebrunner-farm index 92b0b10..a4e9d6b 100755 --- a/roles/devices/templates/zebrunner-farm +++ b/roles/devices/templates/zebrunner-farm @@ -116,9 +116,25 @@ function create_containers () { {{ MITM_IMAGE }}:{{ MITM_VERSION }} || echo 'already created' fi + docker run -itd --name device-${device_name}-${udid}-connector --net=${net} \ + --restart on-failure $DEVICE_ARG \ + -e DEVICE_BUS=$usb_bus \ + -v mcloud-key-volume:/root/.android \ + -v device-${device_name}-${udid}:/tmp/log \ + -e PLATFORM_NAME=$platform_name \ + -e ANDROID_DEVICE=$ANDROID_DEVICE \ + -e DEVICE_UDID="$STF_DEVICE_UDID" \ + public.ecr.aws/zebrunner/device-container:1.0-beta1 || echo 'already created' + +# -e ANDROID_ADB_SERVER_ADDRESS=connector \ +# -e ANDROID_ADB_SERVER_PORT=5037 \ + #TODO: parametrized relaxed security, make false by default! docker run -itd --name device-${device_name}-${udid}-appium -m 1g --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ - --restart on-failure $DEVICE_ARG \ + --restart on-failure \ + --link device-${device_name}-${udid}-connector:connector \ + -e ANDROID_ADB_SERVER_ADDRESS=connector \ + -e ANDROID_ADB_SERVER_PORT=5037 \ -e DEVICE_BUS=$usb_bus \ -v mcloud-key-volume:/root/.android \ -v appium-storage-volume:/opt/appium-storage \ @@ -157,8 +173,10 @@ function create_containers () { docker run -d --name device-${device_name}-${udid} --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ + --link device-${device_name}-${udid}-connector:connector \ + -e STF_PROVIDER_ADB_HOST=connector \ + -e STF_PROVIDER_ADB_PORT=5037 \ --link device-${device_name}-${udid}-appium:appium \ - -e STF_PROVIDER_ADB_HOST=appium \ --health-start-period 60s \ --restart on-failure \ -e PLATFORM_NAME=$platform_name \ @@ -321,11 +339,13 @@ function stop_containers() { local container=device-$device-$udid echo echo "$container stopping..." + #TODO: retest below assumption # appium should be stopped first to disconnect in STF asap + docker stop $container docker stop $container-mitm docker stop $container-appium - docker stop $container docker stop $container-uploader + docker stop $container-connector } function down() { @@ -366,26 +386,32 @@ function remove_containers() { local container=device-$device-$udid #echo "$container removing..." # remove container(s) only if exists + docker ps -a | grep -v appium | grep $container > /dev/null + if [ $? -eq 0 ]; then + docker rm -f $container + fi + + docker ps -a | grep mitm | grep $container > /dev/null + if [ $? -eq 0 ]; then + docker rm -f $container-mitm + fi + docker ps -a | grep appium | grep $container > /dev/null if [ $? -eq 0 ]; then # remove appium first to disconnect device in stf asap docker rm -f $container-appium fi - docker ps -a | grep -v appium | grep $container > /dev/null + docker ps -a | grep uploader | grep $container > /dev/null if [ $? -eq 0 ]; then - docker rm -f $container + docker rm -f $container-uploader fi - docker ps -a | grep uploader | grep $container > /dev/null + docker ps -a | grep connector | grep $container > /dev/null if [ $? -eq 0 ]; then - docker rm -f $container-uploader + docker rm -f $container-connector fi - docker ps -a | grep mitm | grep $container > /dev/null - if [ $? -eq 0 ]; then - docker rm -f $container-mitm - fi docker volume ls | grep $container > /dev/null if [ $? -eq 0 ]; then @@ -421,8 +447,15 @@ function verify_containers() { if [ $? -eq 0 ]; then appiumState=`docker inspect --format='{{ '{{' }}json .State.Health.Status{{ '}}' }}' $container-appium` fi + + local connectorState="UNKNOWN" + docker ps -a | grep connector | grep $container > /dev/null + if [ $? -eq 0 ]; then + connectorState=`docker inspect --format='{{ '{{' }}json .State.Health.Status{{ '}}' }}' $container-connector` + fi + echo $container - echo "Appium: $appiumState; STF: $stfState" + echo "Connector: $connectorState; Appium: $appiumState; STF: $stfState" fi echo } From 579ece1aad5e5f60b5a074de9963e26c9e7ea723 Mon Sep 17 00:00:00 2001 From: azarouski Date: Fri, 22 Mar 2024 19:28:51 +0300 Subject: [PATCH 02/29] mcloud-ios-connector was experimentally added --- defaults/main.yml | 6 ++++ roles/devices/templates/zebrunner-farm | 41 ++++++++++---------------- roles/download/tasks/main.yml | 6 ++++ 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 7f7c33c..cd2535a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -11,6 +11,12 @@ UPLOADER_VERSION: 3.4 MITM_IMAGE: public.ecr.aws/zebrunner/mitmproxy MITM_VERSION: 2.0 +IOS_CONNECTOR_IMAGE: public.ecr.aws/zebrunner/mcloud-ios-connector +IOS_CONNECTOR_VERSION: 1.0 + +ANDROID_CONNECTOR_IMAGE: public.ecr.aws/zebrunner/mcloud-android-connector +ANDROID_CONNECTOR_VERSION: 1.0 + # Put true to disable app size check using local appium storage APPIUM_APP_SIZE_DISABLE: false diff --git a/roles/devices/templates/zebrunner-farm b/roles/devices/templates/zebrunner-farm index a4e9d6b..067fc1b 100755 --- a/roles/devices/templates/zebrunner-farm +++ b/roles/devices/templates/zebrunner-farm @@ -124,7 +124,7 @@ function create_containers () { -e PLATFORM_NAME=$platform_name \ -e ANDROID_DEVICE=$ANDROID_DEVICE \ -e DEVICE_UDID="$STF_DEVICE_UDID" \ - public.ecr.aws/zebrunner/device-container:1.0-beta1 || echo 'already created' + {{ ANDROID_CONNECTOR_IMAGE }}:{{ ANDROID_CONNECTOR_VERSION }} || echo 'already created' # -e ANDROID_ADB_SERVER_ADDRESS=connector \ # -e ANDROID_ADB_SERVER_PORT=5037 \ @@ -193,30 +193,8 @@ function create_containers () { -e STF_PROVIDER_CONNECT_PUSH={{ STF_PROVIDER_CONNECT_PUSH }} \ -e RETHINKDB_PORT_28015_TCP={{ STF_RETHINKDB }} \ {{ DEVICE_IMAGE }}:{{DEVICE_VERSION }} || echo 'already created' - elif [ $platform_name == "ios" ]; then - - #TODO: comment echoing wda related detailes before release - local wdaIpaPath={{ WDA_FILE }} - local deviceWdaIpaPath=`cat ${devices} | grep "$udid" | cut -d '|' -f 10` - if [ ! -z $deviceWdaIpaPath ] && [ ! "$deviceWdaIpaPath" == "/dev/null" ]; then - wdaIpaPath=$deviceWdaIpaPath - fi - if [ -z $wdaIpaPath ]; then - # unable to use empty value for docker volume share! - wdaIpaPath="/dev/null" - fi - echo "wdaIpaPath: $wdaIpaPath" - local wdaBundleId={{ WDA_BUNDLEID }} - local deviceWdaBundleId=`cat ${devices} | grep "$udid" | cut -d '|' -f 11` - if [ ! -z $deviceWdaBundleId ]; then - wdaBundleId=$deviceWdaBundleId - fi - if [ -z $wdaBundleId ]; then - # provide default value if empty - wdaBundleId="com.facebook.WebDriverAgentRunner.xctrunner" - fi - echo "wdaBundleId: $wdaBundleId" + elif [ $platform_name == "ios" ]; then if [ "$server_proxy_port" != "0" ] && [ "$proxy_port" != "0" ]; then docker run -itd --name device-${device_name}-${udid}-mitm -m 1g --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ @@ -227,10 +205,19 @@ function create_containers () { {{ MITM_IMAGE }}:{{ MITM_VERSION }} || echo 'already created' fi + docker run -itd --name device-${device_name}-${udid}-connector --net=${net} \ + --restart on-failure $DEVICE_ARG \ + -e DEVICE_BUS=$usb_bus \ + -v device-${device_name}-${udid}-lockdown:/var/lib/lockdown \ + -v device-${device_name}-${udid}:/tmp/log \ + -e DEVICE_UDID="$STF_DEVICE_UDID" \ + {{ IOS_CONNECTOR_IMAGE }}:{{ IOS_CONNECTOR_VERSION }} || echo 'already created' + # candidates for removal: ADB_PORT, STF_PROVIDER_MAX_PORT docker run -itd --name device-${device_name}-${udid}-appium -m 1g --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ --restart on-failure $DEVICE_ARG \ -e DEVICE_BUS=$usb_bus \ + -e WDA_HOST=connector \ -v appium-storage-volume:/opt/appium-storage \ -v device-${device_name}-${udid}:/tmp/log \ -v device-${device_name}-${udid}-lockdown:/var/lib/lockdown \ @@ -272,8 +259,8 @@ function create_containers () { # Linking with apppium required to share usbmuxd via socat docker run -d --name device-${device_name}-${udid} --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ --restart on-failure \ - --link device-${device_name}-${udid}-appium:appium \ - -e WDA_HOST=appium \ + --link device-${device_name}-${udid}-connector:connector \ + -e WDA_HOST=connector \ -e WDA_WAIT_TIMEOUT=60 \ -e PLATFORM_NAME=$platform_name \ -e STF_PROVIDER_DEVICE_NAME="${device_name}" -e DEVICE_UDID="${udid}" \ @@ -505,8 +492,10 @@ function start_containers() { echo echo "$container starting..." docker start $container + docker start $container-mitm docker start $container-appium docker start $container-uploader + docker start $container-connector } function status() { diff --git a/roles/download/tasks/main.yml b/roles/download/tasks/main.yml index a6daba5..def3aac 100644 --- a/roles/download/tasks/main.yml +++ b/roles/download/tasks/main.yml @@ -12,5 +12,11 @@ - name: Pull an Zebrunner Mitm image shell: docker pull "{{ MITM_IMAGE }}:{{ MITM_VERSION }}" +- name: Pull an Zebrunner Connector image + shell: docker pull "{{ IOS_CONNECTOR_IMAGE }}:{{ IOS_CONNECTOR_VERSION }}" + +- name: Pull an Zebrunner Connector image + shell: docker pull "{{ ANDROID_CONNECTOR_IMAGE }}:{{ ANDROID_CONNECTOR_VERSION }}" + - name: Create infra network if absent shell: docker network inspect "{{ STF_DOCKER_NETWORK }}" >/dev/null 2>&1 || docker network create "{{ STF_DOCKER_NETWORK }}" From ffe1f28bafc137bc8ff50a37f794258ac8e61004 Mon Sep 17 00:00:00 2001 From: azarouski Date: Fri, 22 Mar 2024 23:26:11 +0300 Subject: [PATCH 03/29] wda file params were deleted from appium run command --- roles/devices/templates/zebrunner-farm | 2 -- 1 file changed, 2 deletions(-) diff --git a/roles/devices/templates/zebrunner-farm b/roles/devices/templates/zebrunner-farm index 067fc1b..4eb3582 100755 --- a/roles/devices/templates/zebrunner-farm +++ b/roles/devices/templates/zebrunner-farm @@ -224,8 +224,6 @@ function create_containers () { -e TASK_LOG=/tmp/log/appium.log \ -e APPIUM_CLI="--session-override" \ -e WDA_BUNDLEID=$wdaBundleId \ - -e WDA_FILE=/tmp/zebrunner/WebDriverAgent.ipa \ - -v ${wdaIpaPath}:/tmp/zebrunner/WebDriverAgent.ipa \ -e PLATFORM_NAME=$platform_name \ -e RETAIN_TASK=true \ -e CONNECT_TO_GRID=true \ From b1176e13157086eae78dad89a678c1985e2c1280 Mon Sep 17 00:00:00 2001 From: azarouski Date: Mon, 25 Mar 2024 13:51:19 +0300 Subject: [PATCH 04/29] appium run command was edited --- roles/devices/templates/zebrunner-farm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/roles/devices/templates/zebrunner-farm b/roles/devices/templates/zebrunner-farm index 4eb3582..790b125 100755 --- a/roles/devices/templates/zebrunner-farm +++ b/roles/devices/templates/zebrunner-farm @@ -216,14 +216,11 @@ function create_containers () { # candidates for removal: ADB_PORT, STF_PROVIDER_MAX_PORT docker run -itd --name device-${device_name}-${udid}-appium -m 1g --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ --restart on-failure $DEVICE_ARG \ - -e DEVICE_BUS=$usb_bus \ -e WDA_HOST=connector \ -v appium-storage-volume:/opt/appium-storage \ -v device-${device_name}-${udid}:/tmp/log \ - -v device-${device_name}-${udid}-lockdown:/var/lib/lockdown \ -e TASK_LOG=/tmp/log/appium.log \ -e APPIUM_CLI="--session-override" \ - -e WDA_BUNDLEID=$wdaBundleId \ -e PLATFORM_NAME=$platform_name \ -e RETAIN_TASK=true \ -e CONNECT_TO_GRID=true \ @@ -233,9 +230,11 @@ function create_containers () { -e APPIUM_APP_FETCH_RETRIES={{ APPIUM_APP_FETCH_RETRIES }} \ -e APPIUM_MAX_LOCK_FILE_LIFETIME={{ APPIUM_MAX_LOCK_FILE_LIFETIME }} \ -e APPIUM_APP_WAITING_TIMEOUT={{ APPIUM_APP_WAITING_TIMEOUT }} \ - -e SELENIUM_HOST={{ SELENIUM_HUB_HOST }} -e SELENIUM_PORT={{ SELENIUM_HUB_PORT }} \ + -e SELENIUM_HOST={{ SELENIUM_HUB_HOST }} \ + -e SELENIUM_PORT={{ SELENIUM_HUB_PORT }} \ -e DEFAULT_CAPABILITIES=true \ - -e DEVICE_NAME="${device_name}" -e DEVICE_UDID="${udid}" \ + -e DEVICE_NAME="${device_name}" \ + -e DEVICE_UDID="${udid}" \ -e ADB_PORT=$device_adb_port \ -e PROXY_PORT=$proxy_port \ -e SERVER_PROXY_PORT=$server_proxy_port \ From f97560fbe7df15c191a7d0b2244bf60a153843ac Mon Sep 17 00:00:00 2001 From: azarouski Date: Mon, 25 Mar 2024 13:55:06 +0300 Subject: [PATCH 05/29] stf device run command was modified --- roles/devices/templates/zebrunner-farm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/devices/templates/zebrunner-farm b/roles/devices/templates/zebrunner-farm index 790b125..1f439a4 100755 --- a/roles/devices/templates/zebrunner-farm +++ b/roles/devices/templates/zebrunner-farm @@ -260,7 +260,8 @@ function create_containers () { -e WDA_HOST=connector \ -e WDA_WAIT_TIMEOUT=60 \ -e PLATFORM_NAME=$platform_name \ - -e STF_PROVIDER_DEVICE_NAME="${device_name}" -e DEVICE_UDID="${udid}" \ + -e STF_PROVIDER_DEVICE_NAME="${device_name}" \ + -e DEVICE_UDID="${udid}" \ -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ -e STF_PROVIDER_NAME="{{ STF_PROVIDER_NAME }}" \ -e STF_PROVIDER_MIN_PORT=$stf_min_port \ From e3bec5ba95b509dec09edbc717876e7efd44df1c Mon Sep 17 00:00:00 2001 From: azarouski Date: Mon, 25 Mar 2024 14:04:06 +0300 Subject: [PATCH 06/29] wdaIpaPath and wdaBundleId detection was reverted --- roles/devices/templates/zebrunner-farm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/roles/devices/templates/zebrunner-farm b/roles/devices/templates/zebrunner-farm index 1f439a4..a0145b5 100755 --- a/roles/devices/templates/zebrunner-farm +++ b/roles/devices/templates/zebrunner-farm @@ -196,6 +196,29 @@ function create_containers () { elif [ $platform_name == "ios" ]; then + #TODO: comment echoing wda related detailes before release + local wdaIpaPath={{ WDA_FILE }} + local deviceWdaIpaPath=`cat ${devices} | grep "$udid" | cut -d '|' -f 10` + if [ ! -z $deviceWdaIpaPath ] && [ ! "$deviceWdaIpaPath" == "/dev/null" ]; then + wdaIpaPath=$deviceWdaIpaPath + fi + if [ -z $wdaIpaPath ]; then + # unable to use empty value for docker volume share! + wdaIpaPath="/dev/null" + fi + echo "wdaIpaPath: $wdaIpaPath" + + local wdaBundleId={{ WDA_BUNDLEID }} + local deviceWdaBundleId=`cat ${devices} | grep "$udid" | cut -d '|' -f 11` + if [ ! -z $deviceWdaBundleId ]; then + wdaBundleId=$deviceWdaBundleId + fi + if [ -z $wdaBundleId ]; then + # provide default value if empty + wdaBundleId="com.facebook.WebDriverAgentRunner.xctrunner" + fi + echo "wdaBundleId: $wdaBundleId" + if [ "$server_proxy_port" != "0" ] && [ "$proxy_port" != "0" ]; then docker run -itd --name device-${device_name}-${udid}-mitm -m 1g --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ --restart on-failure \ From d00c2ac6fb350d5c789755a22bbeb371faeedc0d Mon Sep 17 00:00:00 2001 From: azarouski Date: Mon, 25 Mar 2024 14:05:26 +0300 Subject: [PATCH 07/29] wda file params were added to connector run command --- roles/devices/templates/zebrunner-farm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roles/devices/templates/zebrunner-farm b/roles/devices/templates/zebrunner-farm index a0145b5..14754ac 100755 --- a/roles/devices/templates/zebrunner-farm +++ b/roles/devices/templates/zebrunner-farm @@ -231,6 +231,9 @@ function create_containers () { docker run -itd --name device-${device_name}-${udid}-connector --net=${net} \ --restart on-failure $DEVICE_ARG \ -e DEVICE_BUS=$usb_bus \ + -e WDA_BUNDLEID=$wdaBundleId \ + -e WDA_FILE=/tmp/zebrunner/WebDriverAgent.ipa \ + -v ${wdaIpaPath}:/tmp/zebrunner/WebDriverAgent.ipa \ -v device-${device_name}-${udid}-lockdown:/var/lib/lockdown \ -v device-${device_name}-${udid}:/tmp/log \ -e DEVICE_UDID="$STF_DEVICE_UDID" \ From 267a991f0c52ec737cc319ee929a9a33a281a5be Mon Sep 17 00:00:00 2001 From: azarouski Date: Tue, 16 Apr 2024 14:00:17 +0200 Subject: [PATCH 08/29] mcloud-connector integration changer were made --- roles/devices/templates/zebrunner-farm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/roles/devices/templates/zebrunner-farm b/roles/devices/templates/zebrunner-farm index 14754ac..bde0792 100755 --- a/roles/devices/templates/zebrunner-farm +++ b/roles/devices/templates/zebrunner-farm @@ -133,10 +133,6 @@ function create_containers () { docker run -itd --name device-${device_name}-${udid}-appium -m 1g --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ --restart on-failure \ --link device-${device_name}-${udid}-connector:connector \ - -e ANDROID_ADB_SERVER_ADDRESS=connector \ - -e ANDROID_ADB_SERVER_PORT=5037 \ - -e DEVICE_BUS=$usb_bus \ - -v mcloud-key-volume:/root/.android \ -v appium-storage-volume:/opt/appium-storage \ -v device-${device_name}-${udid}:/tmp/log \ -e TASK_LOG=/tmp/log/appium.log \ @@ -150,15 +146,19 @@ function create_containers () { -e APPIUM_APP_FETCH_RETRIES={{ APPIUM_APP_FETCH_RETRIES }} \ -e APPIUM_MAX_LOCK_FILE_LIFETIME={{ APPIUM_MAX_LOCK_FILE_LIFETIME }} \ -e APPIUM_APP_WAITING_TIMEOUT={{ APPIUM_APP_WAITING_TIMEOUT }} \ - -e SELENIUM_HOST={{ SELENIUM_HUB_HOST }} -e SELENIUM_PORT={{ SELENIUM_HUB_PORT }} \ + -e SELENIUM_HOST={{ SELENIUM_HUB_HOST }} \ + -e SELENIUM_PORT={{ SELENIUM_HUB_PORT }} \ -e DEFAULT_CAPABILITIES=true \ - -e DEVICE_NAME="${device_name}" -e DEVICE_UDID="$STF_DEVICE_UDID" \ + -e DEVICE_NAME="${device_name}" \ + -e DEVICE_UDID="$STF_DEVICE_UDID" \ -e ADB_PORT=$device_adb_port \ -e PROXY_PORT=$proxy_port \ -e SERVER_PROXY_PORT=$server_proxy_port \ -e APPIUM_PORT=$appium_port \ -p $appium_port:$appium_port \ -e RELAXED_SECURITY=true \ + -e ADB_SERVER_SOCKET=tcp:connector:5037 \ + -e REMOTE_ADB_HOST=connector \ {{ APPIUM_IMAGE }}:{{ APPIUM_VERSION }} || echo 'already created' docker run -d --name device-${device_name}-${udid}-uploader --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ @@ -176,11 +176,11 @@ function create_containers () { --link device-${device_name}-${udid}-connector:connector \ -e STF_PROVIDER_ADB_HOST=connector \ -e STF_PROVIDER_ADB_PORT=5037 \ - --link device-${device_name}-${udid}-appium:appium \ --health-start-period 60s \ --restart on-failure \ -e PLATFORM_NAME=$platform_name \ - -e STF_PROVIDER_DEVICE_NAME="${device_name}" -e DEVICE_UDID="$STF_DEVICE_UDID" \ + -e STF_PROVIDER_DEVICE_NAME="${device_name}" \ + -e DEVICE_UDID="$STF_DEVICE_UDID" \ -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ -e STF_PROVIDER_NAME="{{ STF_PROVIDER_NAME }}" \ -e STF_PROVIDER_MIN_PORT=$stf_min_port \ @@ -242,6 +242,7 @@ function create_containers () { # candidates for removal: ADB_PORT, STF_PROVIDER_MAX_PORT docker run -itd --name device-${device_name}-${udid}-appium -m 1g --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ --restart on-failure $DEVICE_ARG \ + --link device-${device_name}-${udid}-connector:connector \ -e WDA_HOST=connector \ -v appium-storage-volume:/opt/appium-storage \ -v device-${device_name}-${udid}:/tmp/log \ From b9a6ff4254c18ca3c8e9f3dda52be2dda1b5043c Mon Sep 17 00:00:00 2001 From: azarouski Date: Tue, 16 Apr 2024 16:01:16 +0200 Subject: [PATCH 09/29] connector versions were edited --- defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 49017c9..0daa641 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -12,10 +12,10 @@ MITM_IMAGE: public.ecr.aws/zebrunner/mitmproxy MITM_VERSION: 2.0 IOS_CONNECTOR_IMAGE: public.ecr.aws/zebrunner/mcloud-ios-connector -IOS_CONNECTOR_VERSION: 1.0 +IOS_CONNECTOR_VERSION: 1.0-beta1 ANDROID_CONNECTOR_IMAGE: public.ecr.aws/zebrunner/mcloud-android-connector -ANDROID_CONNECTOR_VERSION: 1.0 +ANDROID_CONNECTOR_VERSION: 1.0-beta1 # Put true to disable app size check using local appium storage APPIUM_APP_SIZE_DISABLE: false From 30937f2c8d1a1a2b64d05710ecae94aeadffc90f Mon Sep 17 00:00:00 2001 From: azarouski Date: Tue, 16 Apr 2024 16:06:41 +0200 Subject: [PATCH 10/29] appium version was edited --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 0daa641..efbf02d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -3,7 +3,7 @@ DEVICE_IMAGE: public.ecr.aws/zebrunner/mcloud-device DEVICE_VERSION: 2.6.5 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium -APPIUM_VERSION: 2.0.15 +APPIUM_VERSION: 2.1.0-beta1 UPLOADER_IMAGE: public.ecr.aws/zebrunner/uploader UPLOADER_VERSION: 3.4 From b54dc05d8b9e43f2e282394843c22a07c76b1bca Mon Sep 17 00:00:00 2001 From: azarouski Date: Tue, 16 Apr 2024 16:08:04 +0200 Subject: [PATCH 11/29] adb comment was edited --- roles/devices/templates/zebrunner-farm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roles/devices/templates/zebrunner-farm b/roles/devices/templates/zebrunner-farm index bde0792..3292e8a 100755 --- a/roles/devices/templates/zebrunner-farm +++ b/roles/devices/templates/zebrunner-farm @@ -126,6 +126,9 @@ function create_containers () { -e DEVICE_UDID="$STF_DEVICE_UDID" \ {{ ANDROID_CONNECTOR_IMAGE }}:{{ ANDROID_CONNECTOR_VERSION }} || echo 'already created' +# Adb config env vars +# -e ADB_SERVER_SOCKET=tcp:connector:5037 \ +# or # -e ANDROID_ADB_SERVER_ADDRESS=connector \ # -e ANDROID_ADB_SERVER_PORT=5037 \ From aa19c1a51812a9eea348244e5b0f9085d7040224 Mon Sep 17 00:00:00 2001 From: azarouski Date: Tue, 16 Apr 2024 16:13:00 +0200 Subject: [PATCH 12/29] mcloud-device version was edited --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index efbf02d..4bc86ea 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- DEVICE_IMAGE: public.ecr.aws/zebrunner/mcloud-device -DEVICE_VERSION: 2.6.5 +DEVICE_VERSION: 2.7.0-beta1 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium APPIUM_VERSION: 2.1.0-beta1 From be59ebe5310aa83368113e547772d84c8df185b6 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Mon, 22 Apr 2024 17:43:58 +0300 Subject: [PATCH 13/29] bump up to the latest appium and android-connector --- defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 4bc86ea..0c8a4c6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -3,7 +3,7 @@ DEVICE_IMAGE: public.ecr.aws/zebrunner/mcloud-device DEVICE_VERSION: 2.7.0-beta1 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium -APPIUM_VERSION: 2.1.0-beta1 +APPIUM_VERSION: 2.1.0-beta3 UPLOADER_IMAGE: public.ecr.aws/zebrunner/uploader UPLOADER_VERSION: 3.4 @@ -15,7 +15,7 @@ IOS_CONNECTOR_IMAGE: public.ecr.aws/zebrunner/mcloud-ios-connector IOS_CONNECTOR_VERSION: 1.0-beta1 ANDROID_CONNECTOR_IMAGE: public.ecr.aws/zebrunner/mcloud-android-connector -ANDROID_CONNECTOR_VERSION: 1.0-beta1 +ANDROID_CONNECTOR_VERSION: 1.0-beta2 # Put true to disable app size check using local appium storage APPIUM_APP_SIZE_DISABLE: false From 5aca45d4471b38774f4ba71427a5f4d8dcc6d7f3 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Wed, 24 Apr 2024 19:05:04 +0300 Subject: [PATCH 14/29] bump up to mcloud-device:2.7.0-beta3 --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 0c8a4c6..1eec6b4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- DEVICE_IMAGE: public.ecr.aws/zebrunner/mcloud-device -DEVICE_VERSION: 2.7.0-beta1 +DEVICE_VERSION: 2.7.0-beta3 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium APPIUM_VERSION: 2.1.0-beta3 From fa7e662b34204b2544bfd1350b315dac0f82b125 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Thu, 25 Apr 2024 13:01:24 +0300 Subject: [PATCH 15/29] bump up to latest mcloud-device and appium --- defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 1eec6b4..67a9bb5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,9 +1,9 @@ --- DEVICE_IMAGE: public.ecr.aws/zebrunner/mcloud-device -DEVICE_VERSION: 2.7.0-beta3 +DEVICE_VERSION: 2.7.0-beta4 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium -APPIUM_VERSION: 2.1.0-beta3 +APPIUM_VERSION: 2.1.0-beta4 UPLOADER_IMAGE: public.ecr.aws/zebrunner/uploader UPLOADER_VERSION: 3.4 From b4d74f0358de1ad6ff775c10e24f679158917375 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Thu, 25 Apr 2024 13:04:23 +0300 Subject: [PATCH 16/29] updated containers order and organized linking for new recording --- roles/devices/templates/zebrunner-farm | 141 +++++++++++++------------ 1 file changed, 71 insertions(+), 70 deletions(-) diff --git a/roles/devices/templates/zebrunner-farm b/roles/devices/templates/zebrunner-farm index 3292e8a..61e0580 100755 --- a/roles/devices/templates/zebrunner-farm +++ b/roles/devices/templates/zebrunner-farm @@ -126,6 +126,28 @@ function create_containers () { -e DEVICE_UDID="$STF_DEVICE_UDID" \ {{ ANDROID_CONNECTOR_IMAGE }}:{{ ANDROID_CONNECTOR_VERSION }} || echo 'already created' + docker run -d --name device-${device_name}-${udid} --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ + --link device-${device_name}-${udid}-connector:connector \ + -e STF_PROVIDER_ADB_HOST=connector \ + -e STF_PROVIDER_ADB_PORT=5037 \ + --health-start-period 60s \ + --restart on-failure \ + -e PLATFORM_NAME=$platform_name \ + -e STF_PROVIDER_DEVICE_NAME="${device_name}" \ + -e DEVICE_UDID="$STF_DEVICE_UDID" \ + -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ + -e STF_PROVIDER_NAME="{{ STF_PROVIDER_NAME }}" \ + -e STF_PROVIDER_MIN_PORT=$stf_min_port \ + -e STF_PROVIDER_MAX_PORT=$stf_max_port \ + -p $stf_min_port-$stf_max_port:$stf_min_port-$stf_max_port \ + -e STF_PROVIDER_PUBLIC_IP={{ PUBLIC_IP }} \ + -e PUBLIC_IP_PORT={{ PUBLIC_IP_PORT }} \ + -e PUBLIC_IP_PROTOCOL={{ PUBLIC_IP_PROTOCOL }} \ + -e STF_PROVIDER_CONNECT_SUB={{ STF_PROVIDER_CONNECT_SUB }} \ + -e STF_PROVIDER_CONNECT_PUSH={{ STF_PROVIDER_CONNECT_PUSH }} \ + -e RETHINKDB_PORT_28015_TCP={{ STF_RETHINKDB }} \ + {{ DEVICE_IMAGE }}:{{DEVICE_VERSION }} || echo 'already created' + # Adb config env vars # -e ADB_SERVER_SOCKET=tcp:connector:5037 \ # or @@ -135,16 +157,17 @@ function create_containers () { #TODO: parametrized relaxed security, make false by default! docker run -itd --name device-${device_name}-${udid}-appium -m 1g --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ --restart on-failure \ + --link device-${device_name}-${udid}:device \ --link device-${device_name}-${udid}-connector:connector \ - -v appium-storage-volume:/opt/appium-storage \ + -v appium-storage-volume:/opt/appium-storage \ -v device-${device_name}-${udid}:/tmp/log \ - -e TASK_LOG=/tmp/log/appium.log \ - -e PLATFORM_NAME=$platform_name \ - -e ANDROID_DEVICE=$ANDROID_DEVICE \ + -e TASK_LOG=/tmp/log/appium.log \ + -e PLATFORM_NAME=$platform_name \ + -e ANDROID_DEVICE=$ANDROID_DEVICE \ -e RETAIN_TASK=true \ - -e CONNECT_TO_GRID=true \ - -e CUSTOM_NODE_CONFIG=true \ - -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ + -e CONNECT_TO_GRID=true \ + -e CUSTOM_NODE_CONFIG=true \ + -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ -e APPIUM_APP_SIZE_DISABLE={{ APPIUM_APP_SIZE_DISABLE }} \ -e APPIUM_APP_FETCH_RETRIES={{ APPIUM_APP_FETCH_RETRIES }} \ -e APPIUM_MAX_LOCK_FILE_LIFETIME={{ APPIUM_MAX_LOCK_FILE_LIFETIME }} \ @@ -152,13 +175,13 @@ function create_containers () { -e SELENIUM_HOST={{ SELENIUM_HUB_HOST }} \ -e SELENIUM_PORT={{ SELENIUM_HUB_PORT }} \ -e DEFAULT_CAPABILITIES=true \ - -e DEVICE_NAME="${device_name}" \ - -e DEVICE_UDID="$STF_DEVICE_UDID" \ - -e ADB_PORT=$device_adb_port \ - -e PROXY_PORT=$proxy_port \ - -e SERVER_PROXY_PORT=$server_proxy_port \ - -e APPIUM_PORT=$appium_port \ - -p $appium_port:$appium_port \ + -e DEVICE_NAME="${device_name}" \ + -e DEVICE_UDID="$STF_DEVICE_UDID" \ + -e ADB_PORT=$device_adb_port \ + -e PROXY_PORT=$proxy_port \ + -e SERVER_PROXY_PORT=$server_proxy_port \ + -e APPIUM_PORT=$appium_port \ + -p $appium_port:$appium_port \ -e RELAXED_SECURITY=true \ -e ADB_SERVER_SOCKET=tcp:connector:5037 \ -e REMOTE_ADB_HOST=connector \ @@ -174,29 +197,6 @@ function create_containers () { -e AWS_DEFAULT_REGION={{ S3_REGION }} \ {{ UPLOADER_IMAGE }}:{{ UPLOADER_VERSION }} || echo 'already created' - - docker run -d --name device-${device_name}-${udid} --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ - --link device-${device_name}-${udid}-connector:connector \ - -e STF_PROVIDER_ADB_HOST=connector \ - -e STF_PROVIDER_ADB_PORT=5037 \ - --health-start-period 60s \ - --restart on-failure \ - -e PLATFORM_NAME=$platform_name \ - -e STF_PROVIDER_DEVICE_NAME="${device_name}" \ - -e DEVICE_UDID="$STF_DEVICE_UDID" \ - -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ - -e STF_PROVIDER_NAME="{{ STF_PROVIDER_NAME }}" \ - -e STF_PROVIDER_MIN_PORT=$stf_min_port \ - -e STF_PROVIDER_MAX_PORT=$stf_max_port \ - -p $stf_min_port-$stf_max_port:$stf_min_port-$stf_max_port \ - -e STF_PROVIDER_PUBLIC_IP={{ PUBLIC_IP }} \ - -e PUBLIC_IP_PORT={{ PUBLIC_IP_PORT }} \ - -e PUBLIC_IP_PROTOCOL={{ PUBLIC_IP_PROTOCOL }} \ - -e STF_PROVIDER_CONNECT_SUB={{ STF_PROVIDER_CONNECT_SUB }} \ - -e STF_PROVIDER_CONNECT_PUSH={{ STF_PROVIDER_CONNECT_PUSH }} \ - -e RETHINKDB_PORT_28015_TCP={{ STF_RETHINKDB }} \ - {{ DEVICE_IMAGE }}:{{DEVICE_VERSION }} || echo 'already created' - elif [ $platform_name == "ios" ]; then #TODO: comment echoing wda related detailes before release @@ -242,27 +242,51 @@ function create_containers () { -e DEVICE_UDID="$STF_DEVICE_UDID" \ {{ IOS_CONNECTOR_IMAGE }}:{{ IOS_CONNECTOR_VERSION }} || echo 'already created' + # Linking with apppium required to share usbmuxd via socat + docker run -d --name device-${device_name}-${udid} --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ + --restart on-failure \ + --link device-${device_name}-${udid}-connector:connector \ + -e WDA_HOST=connector \ + -e WDA_WAIT_TIMEOUT=60 \ + -e PLATFORM_NAME=$platform_name \ + -e STF_PROVIDER_DEVICE_NAME="${device_name}" \ + -e DEVICE_UDID="${udid}" \ + -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ + -e STF_PROVIDER_NAME="{{ STF_PROVIDER_NAME }}" \ + -e STF_PROVIDER_MIN_PORT=$stf_min_port \ + -e STF_PROVIDER_MAX_PORT=$stf_max_port \ + -p $stf_min_port-$stf_max_port:$stf_min_port-$stf_max_port \ + -e STF_PROVIDER_PUBLIC_IP={{ PUBLIC_IP }} \ + -e PUBLIC_IP_PORT={{ PUBLIC_IP_PORT }} \ + -e PUBLIC_IP_PROTOCOL={{ PUBLIC_IP_PROTOCOL }} \ + -e STF_PROVIDER_CONNECT_SUB={{ STF_PROVIDER_CONNECT_SUB }} \ + -e STF_PROVIDER_CONNECT_PUSH={{ STF_PROVIDER_CONNECT_PUSH }} \ + -e STF_PROVIDER_CONNECT_APP_DEALER={{ STF_PROVIDER_CONNECT_APP_DEALER }} \ + -e STF_PROVIDER_CONNECT_DEV_DEALER={{ STF_PROVIDER_CONNECT_DEV_DEALER }} \ + -e RETHINKDB_PORT_28015_TCP={{ STF_RETHINKDB }} \ + {{ DEVICE_IMAGE }}:{{DEVICE_VERSION }} || echo 'already created' + # candidates for removal: ADB_PORT, STF_PROVIDER_MAX_PORT docker run -itd --name device-${device_name}-${udid}-appium -m 1g --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ --restart on-failure $DEVICE_ARG \ --link device-${device_name}-${udid}-connector:connector \ -e WDA_HOST=connector \ - -v appium-storage-volume:/opt/appium-storage \ - -v device-${device_name}-${udid}:/tmp/log \ - -e TASK_LOG=/tmp/log/appium.log \ - -e APPIUM_CLI="--session-override" \ + -v appium-storage-volume:/opt/appium-storage \ + -v device-${device_name}-${udid}:/tmp/log \ + -e TASK_LOG=/tmp/log/appium.log \ + -e APPIUM_CLI="--session-override" \ -e PLATFORM_NAME=$platform_name \ -e RETAIN_TASK=true \ -e CONNECT_TO_GRID=true \ -e CUSTOM_NODE_CONFIG=true \ - -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ + -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ -e APPIUM_APP_SIZE_DISABLE={{ APPIUM_APP_SIZE_DISABLE }} \ -e APPIUM_APP_FETCH_RETRIES={{ APPIUM_APP_FETCH_RETRIES }} \ -e APPIUM_MAX_LOCK_FILE_LIFETIME={{ APPIUM_MAX_LOCK_FILE_LIFETIME }} \ -e APPIUM_APP_WAITING_TIMEOUT={{ APPIUM_APP_WAITING_TIMEOUT }} \ -e SELENIUM_HOST={{ SELENIUM_HUB_HOST }} \ -e SELENIUM_PORT={{ SELENIUM_HUB_PORT }} \ - -e DEFAULT_CAPABILITIES=true \ + -e DEFAULT_CAPABILITIES=true \ -e DEVICE_NAME="${device_name}" \ -e DEVICE_UDID="${udid}" \ -e ADB_PORT=$device_adb_port \ @@ -277,35 +301,12 @@ function create_containers () { --restart on-failure \ -v device-${device_name}-${udid}:/tmp/log \ -e ENDPOINT_URL={{ S3_ENDPOINT }} \ - -e S3_KEY_PATTERN=${S3_KEY_PATTERN} \ - -e AWS_ACCESS_KEY_ID={{ S3_ACCESS_KEY_ID }} \ - -e AWS_SECRET_ACCESS_KEY={{ S3_SECRET }} \ - -e AWS_DEFAULT_REGION={{ S3_REGION }} \ + -e S3_KEY_PATTERN=${S3_KEY_PATTERN} \ + -e AWS_ACCESS_KEY_ID={{ S3_ACCESS_KEY_ID }} \ + -e AWS_SECRET_ACCESS_KEY={{ S3_SECRET }} \ + -e AWS_DEFAULT_REGION={{ S3_REGION }} \ {{ UPLOADER_IMAGE }}:{{ UPLOADER_VERSION }} || echo 'already created' - # Linking with apppium required to share usbmuxd via socat - docker run -d --name device-${device_name}-${udid} --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ - --restart on-failure \ - --link device-${device_name}-${udid}-connector:connector \ - -e WDA_HOST=connector \ - -e WDA_WAIT_TIMEOUT=60 \ - -e PLATFORM_NAME=$platform_name \ - -e STF_PROVIDER_DEVICE_NAME="${device_name}" \ - -e DEVICE_UDID="${udid}" \ - -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ - -e STF_PROVIDER_NAME="{{ STF_PROVIDER_NAME }}" \ - -e STF_PROVIDER_MIN_PORT=$stf_min_port \ - -e STF_PROVIDER_MAX_PORT=$stf_max_port \ - -p $stf_min_port-$stf_max_port:$stf_min_port-$stf_max_port \ - -e STF_PROVIDER_PUBLIC_IP={{ PUBLIC_IP }} \ - -e PUBLIC_IP_PORT={{ PUBLIC_IP_PORT }} \ - -e PUBLIC_IP_PROTOCOL={{ PUBLIC_IP_PROTOCOL }} \ - -e STF_PROVIDER_CONNECT_SUB={{ STF_PROVIDER_CONNECT_SUB }} \ - -e STF_PROVIDER_CONNECT_PUSH={{ STF_PROVIDER_CONNECT_PUSH }} \ - -e STF_PROVIDER_CONNECT_APP_DEALER={{ STF_PROVIDER_CONNECT_APP_DEALER }} \ - -e STF_PROVIDER_CONNECT_DEV_DEALER={{ STF_PROVIDER_CONNECT_DEV_DEALER }} \ - -e RETHINKDB_PORT_28015_TCP={{ STF_RETHINKDB }} \ - {{ DEVICE_IMAGE }}:{{DEVICE_VERSION }} || echo 'already created' else echo "ERROR! Unsupported platform: ${platform_name}" fi From 5e867998d43cc565cddad5f6803aeb9dc4159c89 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Fri, 26 Apr 2024 16:44:11 +0300 Subject: [PATCH 17/29] bump up to the latest appium and mcloud-device --- defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 67a9bb5..f5d1cdc 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,9 +1,9 @@ --- DEVICE_IMAGE: public.ecr.aws/zebrunner/mcloud-device -DEVICE_VERSION: 2.7.0-beta4 +DEVICE_VERSION: 2.7.0-beta5 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium -APPIUM_VERSION: 2.1.0-beta4 +APPIUM_VERSION: 2.1.0-beta5 UPLOADER_IMAGE: public.ecr.aws/zebrunner/uploader UPLOADER_VERSION: 3.4 From 6736bdb9cb5d127293bc8482ff53c60d945804d1 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Wed, 8 May 2024 17:42:33 +0300 Subject: [PATCH 18/29] bump up to appium:2.1.0-beta9 --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index f5d1cdc..1494b0b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -3,7 +3,7 @@ DEVICE_IMAGE: public.ecr.aws/zebrunner/mcloud-device DEVICE_VERSION: 2.7.0-beta5 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium -APPIUM_VERSION: 2.1.0-beta5 +APPIUM_VERSION: 2.1.0-beta9 UPLOADER_IMAGE: public.ecr.aws/zebrunner/uploader UPLOADER_VERSION: 3.4 From 02efb9647115e6e13b4bdc92825f94146e1a0cca Mon Sep 17 00:00:00 2001 From: vdelendik Date: Fri, 17 May 2024 18:37:33 +0300 Subject: [PATCH 19/29] bump up to appium:2.1.0 --- defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 1494b0b..8d58661 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,9 +1,9 @@ --- DEVICE_IMAGE: public.ecr.aws/zebrunner/mcloud-device -DEVICE_VERSION: 2.7.0-beta5 +DEVICE_VERSION: 2.7.0-beta9 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium -APPIUM_VERSION: 2.1.0-beta9 +APPIUM_VERSION: 2.1.0 UPLOADER_IMAGE: public.ecr.aws/zebrunner/uploader UPLOADER_VERSION: 3.4 From ac786cc4df0db69a1591430a4f4b2180a325addd Mon Sep 17 00:00:00 2001 From: vdelendik Date: Fri, 17 May 2024 18:45:34 +0300 Subject: [PATCH 20/29] #318: added new STF_API_URL and STF_AUTH_TOKEN vars for appium->stf integration --- defaults/main.yml | 5 ++++- roles/devices/templates/zebrunner-farm | 2 ++ roles/mac-devices/templates/zebrunner-farm | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 8d58661..1f00aef 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -20,8 +20,11 @@ ANDROID_CONNECTOR_VERSION: 1.0-beta2 # Put true to disable app size check using local appium storage APPIUM_APP_SIZE_DISABLE: false -# Optomized app verifications for AppCenter and AWS S3 storages +# Optimized app verifications for AppCenter and AWS S3 storages APPIUM_APP_FETCH_RETRIES: 2 APPIUM_MAX_LOCK_FILE_LIFETIME: 180 APPIUM_APP_WAITING_TIMEOUT: 90 +# STF integration settings to move devices into Unhealthy state +STF_API_URL: +STF_AUTH_TOKEN: diff --git a/roles/devices/templates/zebrunner-farm b/roles/devices/templates/zebrunner-farm index 61e0580..6a8ac20 100755 --- a/roles/devices/templates/zebrunner-farm +++ b/roles/devices/templates/zebrunner-farm @@ -185,6 +185,8 @@ function create_containers () { -e RELAXED_SECURITY=true \ -e ADB_SERVER_SOCKET=tcp:connector:5037 \ -e REMOTE_ADB_HOST=connector \ + -e STF_API_URL={{ STF_API_URL }} \ + -e STF_AUTH_TOKEN={{ STF_AUTH_TOKEN }} \ {{ APPIUM_IMAGE }}:{{ APPIUM_VERSION }} || echo 'already created' docker run -d --name device-${device_name}-${udid}-uploader --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ diff --git a/roles/mac-devices/templates/zebrunner-farm b/roles/mac-devices/templates/zebrunner-farm index 977929a..7ede39a 100755 --- a/roles/mac-devices/templates/zebrunner-farm +++ b/roles/mac-devices/templates/zebrunner-farm @@ -206,6 +206,8 @@ function create_containers () { -e APPIUM_PORT=$appium_port \ -p $appium_port:$appium_port \ -e RELAXED_SECURITY=true \ + -e STF_API_URL={{ STF_API_URL }} \ + -e STF_AUTH_TOKEN={{ STF_AUTH_TOKEN }} \ {{ APPIUM_IMAGE }}:{{ APPIUM_VERSION }} docker run -d --name device-${device_name}-${udid}-uploader --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ From f286bc28fb9c99c34cde55f7fb02e11a1cea4662 Mon Sep 17 00:00:00 2001 From: azarouski Date: Sat, 18 May 2024 18:07:04 +0200 Subject: [PATCH 21/29] mcloud-ios-connector support was added for Mac platform --- roles/mac-devices/templates/zebrunner-farm | 179 ++++++++++++--------- 1 file changed, 105 insertions(+), 74 deletions(-) diff --git a/roles/mac-devices/templates/zebrunner-farm b/roles/mac-devices/templates/zebrunner-farm index 7ede39a..ac100eb 100755 --- a/roles/mac-devices/templates/zebrunner-farm +++ b/roles/mac-devices/templates/zebrunner-farm @@ -49,7 +49,7 @@ on-usb-update() { echo "$udid device is not whitelisted in main.yml!" break fi - + verify_containers ${device_name} $udid if [ $? -eq 0 ]; then echo "do nothing as state is valid (healthy or starting) for $device_name ($udid)" @@ -88,7 +88,11 @@ function create_containers () { local isAppiumExists=$? #echo isAppiumExists: $isAppiumExists - if [ $isDeviceExists -eq 0 ] && [ $isAppiumExists -eq 0 ]; then + docker ps -a | grep connector | grep $container > /dev/null + local isConnectorExists=$? + #echo isConnectorExists: $isConnectorExists + + if [ $isDeviceExists -eq 0 ] && [ $isAppiumExists -eq 0 ] && [ $isConnectorExists -eq 0 ]; then echo "WARN! do nothing as containers already exists!" return 0 fi @@ -168,81 +172,90 @@ function create_containers () { echo "wdaBundleId: $wdaBundleId" if [ "$server_proxy_port" != "0" ] && [ "$proxy_port" != "0" ]; then - docker run -itd --name device-${device_name}-${udid}-mitm -m 1g --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ - --restart on-failure \ - -v mcloud-mitm-volume:/opt/mitmproxy \ - -e PROXY_PERMANENT_ARGS="$proxy_permament_arguments" \ - -p ${server_proxy_port}:8060 -p ${proxy_port}:8080 \ - {{ MITM_IMAGE }}:{{ MITM_VERSION }} || echo 'already created' + docker run -itd --name device-${device_name}-${udid}-mitm -m 1g --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ + --restart on-failure \ + -v mcloud-mitm-volume:/opt/mitmproxy \ + -e PROXY_PERMANENT_ARGS="$proxy_permament_arguments" \ + -p ${server_proxy_port}:8060 -p ${proxy_port}:8080 \ + {{ MITM_IMAGE }}:{{ MITM_VERSION }} || echo 'already created' fi + docker run -itd --name device-${device_name}-${udid}-connector --net=${net} \ + --restart on-failure $DEVICE_ARG \ + -e DEVICE_BUS=$usb_bus \ + -e WDA_BUNDLEID=$wdaBundleId \ + -e WDA_FILE=/tmp/zebrunner/WebDriverAgent.ipa \ + -v ${wdaIpaPath}:/tmp/zebrunner/WebDriverAgent.ipa \ + -v device-${device_name}-${udid}-lockdown:/var/lib/lockdown \ + -v device-${device_name}-${udid}:/tmp/log \ + -e DEVICE_UDID="$STF_DEVICE_UDID" \ + {{ IOS_CONNECTOR_IMAGE }}:{{ IOS_CONNECTOR_VERSION }} || echo 'already created' + + # Linking with apppium required to share usbmuxd via socat + docker run -d --name device-${device_name}-${udid} --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ + --restart on-failure \ + --link device-${device_name}-${udid}-connector:connector \ + -e WDA_HOST=connector \ + -e WDA_WAIT_TIMEOUT=60 \ + -e PLATFORM_NAME=$platform_name \ + -e STF_PROVIDER_DEVICE_NAME="${device_name}" \ + -e DEVICE_UDID="${udid}" \ + -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ + -e STF_PROVIDER_NAME="{{ STF_PROVIDER_NAME }}" \ + -e STF_PROVIDER_MIN_PORT=$stf_min_port \ + -e STF_PROVIDER_MAX_PORT=$stf_max_port \ + -p $stf_min_port-$stf_max_port:$stf_min_port-$stf_max_port \ + -e STF_PROVIDER_PUBLIC_IP={{ PUBLIC_IP }} \ + -e PUBLIC_IP_PORT={{ PUBLIC_IP_PORT }} \ + -e PUBLIC_IP_PROTOCOL={{ PUBLIC_IP_PROTOCOL }} \ + -e STF_PROVIDER_CONNECT_SUB={{ STF_PROVIDER_CONNECT_SUB }} \ + -e STF_PROVIDER_CONNECT_PUSH={{ STF_PROVIDER_CONNECT_PUSH }} \ + -e STF_PROVIDER_CONNECT_APP_DEALER={{ STF_PROVIDER_CONNECT_APP_DEALER }} \ + -e STF_PROVIDER_CONNECT_DEV_DEALER={{ STF_PROVIDER_CONNECT_DEV_DEALER }} \ + -e RETHINKDB_PORT_28015_TCP={{ STF_RETHINKDB }} \ + {{ DEVICE_IMAGE }}:{{DEVICE_VERSION }} || echo 'already created' + # candidates for removal: ADB_PORT, STF_PROVIDER_MAX_PORT docker run -itd --name device-${device_name}-${udid}-appium -m 1g --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ - -e USBMUXD_SOCKET_ADDRESS={{ USBMUXD_SOCKET_ADDRESS }} \ - --restart on-failure \ - -v appium-storage-volume:/opt/appium-storage \ - -v device-${device_name}-${udid}:/tmp/log \ - -e TASK_LOG=/tmp/log/appium.log \ - -e APPIUM_CLI="--session-override" \ - -e WDA_BUNDLEID=$wdaBundleId \ - -e WDA_FILE=/tmp/zebrunner/WebDriverAgent.ipa \ - -v ${wdaIpaPath}:/tmp/zebrunner/WebDriverAgent.ipa \ - -e PLATFORM_NAME=$platform_name \ - -e DEVICE_UDID=$udid \ - -e RETAIN_TASK=true \ - -e CONNECT_TO_GRID=true \ - -e CUSTOM_NODE_CONFIG=true \ - -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ - -e APPIUM_APP_SIZE_DISABLE={{ APPIUM_APP_SIZE_DISABLE }} \ - -e APPIUM_APP_FETCH_RETRIES={{ APPIUM_APP_FETCH_RETRIES }} \ - -e APPIUM_MAX_LOCK_FILE_LIFETIME={{ APPIUM_MAX_LOCK_FILE_LIFETIME }} \ - -e APPIUM_APP_WAITING_TIMEOUT={{ APPIUM_APP_WAITING_TIMEOUT }} \ - -e SELENIUM_HOST={{ SELENIUM_HUB_HOST }} -e SELENIUM_PORT={{ SELENIUM_HUB_PORT }} \ - -e DEFAULT_CAPABILITIES=true \ - -e DEVICE_NAME="${device_name}" -e DEVICE_UDID="${udid}" \ - -e ADB_PORT=$device_adb_port \ - -e PROXY_PORT=$proxy_port \ - -e SERVER_PROXY_PORT=$server_proxy_port \ - -e APPIUM_PORT=$appium_port \ - -p $appium_port:$appium_port \ - -e RELAXED_SECURITY=true \ - -e STF_API_URL={{ STF_API_URL }} \ - -e STF_AUTH_TOKEN={{ STF_AUTH_TOKEN }} \ - {{ APPIUM_IMAGE }}:{{ APPIUM_VERSION }} + --restart on-failure $DEVICE_ARG \ + --link device-${device_name}-${udid}-connector:connector \ + -e WDA_HOST=connector \ + -v appium-storage-volume:/opt/appium-storage \ + -v device-${device_name}-${udid}:/tmp/log \ + -e TASK_LOG=/tmp/log/appium.log \ + -e APPIUM_CLI="--session-override" \ + -e PLATFORM_NAME=$platform_name \ + -e RETAIN_TASK=true \ + -e CONNECT_TO_GRID=true \ + -e CUSTOM_NODE_CONFIG=true \ + -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ + -e APPIUM_APP_SIZE_DISABLE={{ APPIUM_APP_SIZE_DISABLE }} \ + -e APPIUM_APP_FETCH_RETRIES={{ APPIUM_APP_FETCH_RETRIES }} \ + -e APPIUM_MAX_LOCK_FILE_LIFETIME={{ APPIUM_MAX_LOCK_FILE_LIFETIME }} \ + -e APPIUM_APP_WAITING_TIMEOUT={{ APPIUM_APP_WAITING_TIMEOUT }} \ + -e SELENIUM_HOST={{ SELENIUM_HUB_HOST }} \ + -e SELENIUM_PORT={{ SELENIUM_HUB_PORT }} \ + -e DEFAULT_CAPABILITIES=true \ + -e DEVICE_NAME="${device_name}" \ + -e DEVICE_UDID="${udid}" \ + -e ADB_PORT=$device_adb_port \ + -e PROXY_PORT=$proxy_port \ + -e SERVER_PROXY_PORT=$server_proxy_port \ + -e APPIUM_PORT=$appium_port \ + -p $appium_port:$appium_port \ + -e RELAXED_SECURITY=true \ + {{ APPIUM_IMAGE }}:{{ APPIUM_VERSION }} || echo 'already created' docker run -d --name device-${device_name}-${udid}-uploader --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ - --restart on-failure \ - -v device-${device_name}-${udid}:/tmp/log \ - -e ENDPOINT_URL={{ S3_ENDPOINT }} \ - -e S3_KEY_PATTERN=${S3_KEY_PATTERN} \ - -e AWS_ACCESS_KEY_ID={{ S3_ACCESS_KEY_ID }} \ - -e AWS_SECRET_ACCESS_KEY={{ S3_SECRET }} \ - -e AWS_DEFAULT_REGION={{ S3_REGION }} \ - {{ UPLOADER_IMAGE }}:{{ UPLOADER_VERSION }} || echo 'already created' + --restart on-failure \ + -v device-${device_name}-${udid}:/tmp/log \ + -e ENDPOINT_URL={{ S3_ENDPOINT }} \ + -e S3_KEY_PATTERN=${S3_KEY_PATTERN} \ + -e AWS_ACCESS_KEY_ID={{ S3_ACCESS_KEY_ID }} \ + -e AWS_SECRET_ACCESS_KEY={{ S3_SECRET }} \ + -e AWS_DEFAULT_REGION={{ S3_REGION }} \ + {{ UPLOADER_IMAGE }}:{{ UPLOADER_VERSION }} || echo 'already created' - # Linking with apppium required to share usbmuxd via socat - docker run -d --name device-${device_name}-${udid} --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ - -e USBMUXD_SOCKET_ADDRESS={{ USBMUXD_SOCKET_ADDRESS }} \ - --restart on-failure \ - --link device-${device_name}-${udid}-appium:appium \ - -e WDA_HOST=appium \ - -e WDA_WAIT_TIMEOUT=60 \ - -e PLATFORM_NAME=$platform_name \ - -e STF_PROVIDER_DEVICE_NAME="${device_name}" -e DEVICE_UDID="${udid}" \ - -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ - -e STF_PROVIDER_NAME="{{ STF_PROVIDER_NAME }}" \ - -e STF_PROVIDER_MIN_PORT=$stf_min_port \ - -e STF_PROVIDER_MAX_PORT=$stf_max_port \ - -p $stf_min_port-$stf_max_port:$stf_min_port-$stf_max_port \ - -e STF_PROVIDER_PUBLIC_IP={{ PUBLIC_IP }} \ - -e PUBLIC_IP_PORT={{ PUBLIC_IP_PORT }} \ - -e PUBLIC_IP_PROTOCOL={{ PUBLIC_IP_PROTOCOL }} \ - -e STF_PROVIDER_CONNECT_SUB={{ STF_PROVIDER_CONNECT_SUB }} \ - -e STF_PROVIDER_CONNECT_PUSH={{ STF_PROVIDER_CONNECT_PUSH }} \ - -e STF_PROVIDER_CONNECT_APP_DEALER={{ STF_PROVIDER_CONNECT_APP_DEALER }} \ - -e STF_PROVIDER_CONNECT_DEV_DEALER={{ STF_PROVIDER_CONNECT_DEV_DEALER }} \ - -e RETHINKDB_PORT_28015_TCP={{ STF_RETHINKDB }} \ - {{ DEVICE_IMAGE }}:{{DEVICE_VERSION }} || echo 'already created' else echo "ERROR! Unsupported platform: ${platform_name}" fi @@ -289,7 +302,8 @@ function stop_containers() { local container=device-$device-$udid echo echo "$container stopping..." - # appium should be stopped first to disconnect in STF asap + # connector should be stopped first to disconnect in STF asap + docker stop $container-connector docker stop $container-mitm docker stop $container-appium docker stop $container @@ -336,9 +350,14 @@ function remove_containers() { local container=device-$device-$udid #echo "$container removing..." # remove container(s) only if exists + docker ps -a | grep connector | grep $container > /dev/null + if [ $? -eq 0 ]; then + # remove connector first to disconnect device in stf asap + docker rm -f $container-connector + fi + docker ps -a | grep appium | grep $container > /dev/null if [ $? -eq 0 ]; then - # remove appium first to disconnect device in stf asap docker rm -f $container-appium fi @@ -372,7 +391,6 @@ function verify_containers() { #echo "udid: $udid" local container=device-$device-$udid - local state= local stfState="UNKNOWN" #verify if device containers already exist and do nothing then @@ -387,8 +405,14 @@ function verify_containers() { appiumState=`docker inspect --format='{{ '{{' }}json .State.Health.Status{{ '}}' }}' $container-appium` fi + local connectorState="UNKNOWN" + docker ps -a | grep connector | grep $container > /dev/null + if [ $? -eq 0 ]; then + connectorState=`docker inspect --format='{{ '{{' }}json .State.Health.Status{{ '}}' }}' $container-connector` + fi + echo $container - echo "Appium: $appiumState; STF: $stfState;" + echo "Appium: $appiumState; STF: $stfState; Connector: $connectorState" echo @@ -404,6 +428,12 @@ function verify_containers() { return 1 fi + #echo connectorState:$connectorState + if [[ "$connectorState" != "\"healthy\"" ]] && [[ "$connectorState" != "\"starting\"" ]]; then + #echo "connector neither healthy nor starting!" + return 1 + fi + return 0 } @@ -452,6 +482,7 @@ function start_containers() { echo echo "$container starting..." + docker start $container-connector docker start $container docker start $container-appium docker start $container-uploader From d61fc0527f90457b3c41e7cf6006b13ce2d6d88e Mon Sep 17 00:00:00 2001 From: azarouski Date: Sat, 18 May 2024 18:11:22 +0200 Subject: [PATCH 22/29] all tabulation symbols were replaced with two space symbols --- roles/mac-devices/templates/zebrunner-farm | 46 +++++++++++----------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/roles/mac-devices/templates/zebrunner-farm b/roles/mac-devices/templates/zebrunner-farm index ac100eb..9504d84 100755 --- a/roles/mac-devices/templates/zebrunner-farm +++ b/roles/mac-devices/templates/zebrunner-farm @@ -184,8 +184,8 @@ function create_containers () { --restart on-failure $DEVICE_ARG \ -e DEVICE_BUS=$usb_bus \ -e WDA_BUNDLEID=$wdaBundleId \ - -e WDA_FILE=/tmp/zebrunner/WebDriverAgent.ipa \ - -v ${wdaIpaPath}:/tmp/zebrunner/WebDriverAgent.ipa \ + -e WDA_FILE=/tmp/zebrunner/WebDriverAgent.ipa \ + -v ${wdaIpaPath}:/tmp/zebrunner/WebDriverAgent.ipa \ -v device-${device_name}-${udid}-lockdown:/var/lib/lockdown \ -v device-${device_name}-${udid}:/tmp/log \ -e DEVICE_UDID="$STF_DEVICE_UDID" \ @@ -193,27 +193,27 @@ function create_containers () { # Linking with apppium required to share usbmuxd via socat docker run -d --name device-${device_name}-${udid} --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ - --restart on-failure \ - --link device-${device_name}-${udid}-connector:connector \ - -e WDA_HOST=connector \ - -e WDA_WAIT_TIMEOUT=60 \ - -e PLATFORM_NAME=$platform_name \ - -e STF_PROVIDER_DEVICE_NAME="${device_name}" \ - -e DEVICE_UDID="${udid}" \ - -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ - -e STF_PROVIDER_NAME="{{ STF_PROVIDER_NAME }}" \ - -e STF_PROVIDER_MIN_PORT=$stf_min_port \ - -e STF_PROVIDER_MAX_PORT=$stf_max_port \ - -p $stf_min_port-$stf_max_port:$stf_min_port-$stf_max_port \ - -e STF_PROVIDER_PUBLIC_IP={{ PUBLIC_IP }} \ - -e PUBLIC_IP_PORT={{ PUBLIC_IP_PORT }} \ - -e PUBLIC_IP_PROTOCOL={{ PUBLIC_IP_PROTOCOL }} \ - -e STF_PROVIDER_CONNECT_SUB={{ STF_PROVIDER_CONNECT_SUB }} \ - -e STF_PROVIDER_CONNECT_PUSH={{ STF_PROVIDER_CONNECT_PUSH }} \ - -e STF_PROVIDER_CONNECT_APP_DEALER={{ STF_PROVIDER_CONNECT_APP_DEALER }} \ - -e STF_PROVIDER_CONNECT_DEV_DEALER={{ STF_PROVIDER_CONNECT_DEV_DEALER }} \ - -e RETHINKDB_PORT_28015_TCP={{ STF_RETHINKDB }} \ - {{ DEVICE_IMAGE }}:{{DEVICE_VERSION }} || echo 'already created' + --restart on-failure \ + --link device-${device_name}-${udid}-connector:connector \ + -e WDA_HOST=connector \ + -e WDA_WAIT_TIMEOUT=60 \ + -e PLATFORM_NAME=$platform_name \ + -e STF_PROVIDER_DEVICE_NAME="${device_name}" \ + -e DEVICE_UDID="${udid}" \ + -e STF_PROVIDER_HOST={{ STF_PROVIDER_HOST }} \ + -e STF_PROVIDER_NAME="{{ STF_PROVIDER_NAME }}" \ + -e STF_PROVIDER_MIN_PORT=$stf_min_port \ + -e STF_PROVIDER_MAX_PORT=$stf_max_port \ + -p $stf_min_port-$stf_max_port:$stf_min_port-$stf_max_port \ + -e STF_PROVIDER_PUBLIC_IP={{ PUBLIC_IP }} \ + -e PUBLIC_IP_PORT={{ PUBLIC_IP_PORT }} \ + -e PUBLIC_IP_PROTOCOL={{ PUBLIC_IP_PROTOCOL }} \ + -e STF_PROVIDER_CONNECT_SUB={{ STF_PROVIDER_CONNECT_SUB }} \ + -e STF_PROVIDER_CONNECT_PUSH={{ STF_PROVIDER_CONNECT_PUSH }} \ + -e STF_PROVIDER_CONNECT_APP_DEALER={{ STF_PROVIDER_CONNECT_APP_DEALER }} \ + -e STF_PROVIDER_CONNECT_DEV_DEALER={{ STF_PROVIDER_CONNECT_DEV_DEALER }} \ + -e RETHINKDB_PORT_28015_TCP={{ STF_RETHINKDB }} \ + {{ DEVICE_IMAGE }}:{{DEVICE_VERSION }} || echo 'already created' # candidates for removal: ADB_PORT, STF_PROVIDER_MAX_PORT docker run -itd --name device-${device_name}-${udid}-appium -m 1g --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ From 01d2bbf88fdf944f41ca006827274fc51b4a2819 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Mon, 20 May 2024 14:20:45 +0300 Subject: [PATCH 23/29] #322: bump up to released connector images --- defaults/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 1f00aef..1f28971 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- DEVICE_IMAGE: public.ecr.aws/zebrunner/mcloud-device -DEVICE_VERSION: 2.7.0-beta9 +DEVICE_VERSION: 2.7.0-beta10 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium APPIUM_VERSION: 2.1.0 @@ -12,10 +12,10 @@ MITM_IMAGE: public.ecr.aws/zebrunner/mitmproxy MITM_VERSION: 2.0 IOS_CONNECTOR_IMAGE: public.ecr.aws/zebrunner/mcloud-ios-connector -IOS_CONNECTOR_VERSION: 1.0-beta1 +IOS_CONNECTOR_VERSION: 1.0 ANDROID_CONNECTOR_IMAGE: public.ecr.aws/zebrunner/mcloud-android-connector -ANDROID_CONNECTOR_VERSION: 1.0-beta2 +ANDROID_CONNECTOR_VERSION: 1.0 # Put true to disable app size check using local appium storage APPIUM_APP_SIZE_DISABLE: false From 25535fe7b6e45501890dbbb4031ce240611bd0f2 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Mon, 20 May 2024 14:25:00 +0300 Subject: [PATCH 24/29] #318: moved stf api url and token settings into the roles main.yml file --- defaults/main.yml | 4 ---- roles/devices/vars/main.yml.original | 4 ++++ roles/mac-devices/vars/main.yml.original | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 1f28971..d27cb21 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -24,7 +24,3 @@ APPIUM_APP_SIZE_DISABLE: false APPIUM_APP_FETCH_RETRIES: 2 APPIUM_MAX_LOCK_FILE_LIFETIME: 180 APPIUM_APP_WAITING_TIMEOUT: 90 - -# STF integration settings to move devices into Unhealthy state -STF_API_URL: -STF_AUTH_TOKEN: diff --git a/roles/devices/vars/main.yml.original b/roles/devices/vars/main.yml.original index 254b407..20ce102 100644 --- a/roles/devices/vars/main.yml.original +++ b/roles/devices/vars/main.yml.original @@ -27,6 +27,10 @@ STF_PROVIDER_HOST: linux-agent.zebrunner.farm # [OPTIONAL] provider/location name for devices. Use short city name like NYC STF_PROVIDER_NAME: mcloud-linux +# [OPTIONAL] STF integration settings to move devices into Unhealthy state +STF_API_URL: +STF_AUTH_TOKEN: + # [OPTIONAL] S3 compatible storage for video recordings. S3_BUCKET: S3_TENANT: diff --git a/roles/mac-devices/vars/main.yml.original b/roles/mac-devices/vars/main.yml.original index 71f5c90..f3cbe35 100644 --- a/roles/mac-devices/vars/main.yml.original +++ b/roles/mac-devices/vars/main.yml.original @@ -29,6 +29,10 @@ USBMUXD_SOCKET_ADDRESS: macos-agent.zebrunner.farm:2222 # [OPTIONAL] provider/location name for devices. Use short city name like NYC STF_PROVIDER_NAME: mcloud-macos +# [OPTIONAL] STF integration settings to move devices into Unhealthy state +STF_API_URL: +STF_AUTH_TOKEN: + # [OPTIONAL] S3 compatible storage for video recordings. S3_BUCKET: S3_TENANT: From 19857803e49aa1ab5138dfe59e891ab1112e5a38 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Mon, 20 May 2024 14:51:06 +0300 Subject: [PATCH 25/29] #323: bump up to rc mcloud-device:2.7 --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index d27cb21..5cc2a07 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- DEVICE_IMAGE: public.ecr.aws/zebrunner/mcloud-device -DEVICE_VERSION: 2.7.0-beta10 +DEVICE_VERSION: 2.7 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium APPIUM_VERSION: 2.1.0 From 6a9ac35638b5d7d601f8abfb3a217102f1dfcbf9 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Mon, 20 May 2024 16:05:21 +0300 Subject: [PATCH 26/29] switched to appium:2.1 --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 5cc2a07..2a9925b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -3,7 +3,7 @@ DEVICE_IMAGE: public.ecr.aws/zebrunner/mcloud-device DEVICE_VERSION: 2.7 APPIUM_IMAGE: public.ecr.aws/zebrunner/appium -APPIUM_VERSION: 2.1.0 +APPIUM_VERSION: 2.1 UPLOADER_IMAGE: public.ecr.aws/zebrunner/uploader UPLOADER_VERSION: 3.4 From b8d0622baf600459c6a3d914d4283424d43fe9cd Mon Sep 17 00:00:00 2001 From: azarouski Date: Mon, 20 May 2024 18:12:40 +0200 Subject: [PATCH 27/29] containers run params were fixed --- roles/devices/templates/zebrunner-farm | 1 + roles/mac-devices/templates/zebrunner-farm | 2 ++ 2 files changed, 3 insertions(+) diff --git a/roles/devices/templates/zebrunner-farm b/roles/devices/templates/zebrunner-farm index 6a8ac20..d49a6ad 100755 --- a/roles/devices/templates/zebrunner-farm +++ b/roles/devices/templates/zebrunner-farm @@ -271,6 +271,7 @@ function create_containers () { # candidates for removal: ADB_PORT, STF_PROVIDER_MAX_PORT docker run -itd --name device-${device_name}-${udid}-appium -m 1g --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ --restart on-failure $DEVICE_ARG \ + --link device-${device_name}-${udid}:device \ --link device-${device_name}-${udid}-connector:connector \ -e WDA_HOST=connector \ -v appium-storage-volume:/opt/appium-storage \ diff --git a/roles/mac-devices/templates/zebrunner-farm b/roles/mac-devices/templates/zebrunner-farm index 9504d84..5234857 100755 --- a/roles/mac-devices/templates/zebrunner-farm +++ b/roles/mac-devices/templates/zebrunner-farm @@ -182,6 +182,7 @@ function create_containers () { docker run -itd --name device-${device_name}-${udid}-connector --net=${net} \ --restart on-failure $DEVICE_ARG \ + -e USBMUXD_SOCKET_ADDRESS={{ USBMUXD_SOCKET_ADDRESS }} \ -e DEVICE_BUS=$usb_bus \ -e WDA_BUNDLEID=$wdaBundleId \ -e WDA_FILE=/tmp/zebrunner/WebDriverAgent.ipa \ @@ -218,6 +219,7 @@ function create_containers () { # candidates for removal: ADB_PORT, STF_PROVIDER_MAX_PORT docker run -itd --name device-${device_name}-${udid}-appium -m 1g --log-opt max-size=1024m --log-opt max-file=2 --net=${net} \ --restart on-failure $DEVICE_ARG \ + --link device-${device_name}-${udid}:device \ --link device-${device_name}-${udid}-connector:connector \ -e WDA_HOST=connector \ -v appium-storage-volume:/opt/appium-storage \ From 7c54dbb23ef6052edeb64e4db3cc33f23960eb6d Mon Sep 17 00:00:00 2001 From: azarouski Date: Tue, 21 May 2024 16:25:57 +0200 Subject: [PATCH 28/29] device udid env var was edited in connector init --- roles/mac-devices/templates/zebrunner-farm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mac-devices/templates/zebrunner-farm b/roles/mac-devices/templates/zebrunner-farm index 5234857..89c7c24 100755 --- a/roles/mac-devices/templates/zebrunner-farm +++ b/roles/mac-devices/templates/zebrunner-farm @@ -189,7 +189,7 @@ function create_containers () { -v ${wdaIpaPath}:/tmp/zebrunner/WebDriverAgent.ipa \ -v device-${device_name}-${udid}-lockdown:/var/lib/lockdown \ -v device-${device_name}-${udid}:/tmp/log \ - -e DEVICE_UDID="$STF_DEVICE_UDID" \ + -e DEVICE_UDID=$udid \ {{ IOS_CONNECTOR_IMAGE }}:{{ IOS_CONNECTOR_VERSION }} || echo 'already created' # Linking with apppium required to share usbmuxd via socat From 88f7f973574cc2f934b8d283c7f90c834dc5dbfe Mon Sep 17 00:00:00 2001 From: vdelendik Date: Mon, 27 May 2024 18:15:21 +0300 Subject: [PATCH 29/29] #327: bump up to uploader:3.6 --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 2a9925b..e4e5eb4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,7 +6,7 @@ APPIUM_IMAGE: public.ecr.aws/zebrunner/appium APPIUM_VERSION: 2.1 UPLOADER_IMAGE: public.ecr.aws/zebrunner/uploader -UPLOADER_VERSION: 3.4 +UPLOADER_VERSION: 3.6 MITM_IMAGE: public.ecr.aws/zebrunner/mitmproxy MITM_VERSION: 2.0