Skip to content

Swarming: Avoids mounting volume#5213

Open
IvanBM18 wants to merge 1 commit intomasterfrom
feature/swarming/docker-mount
Open

Swarming: Avoids mounting volume#5213
IvanBM18 wants to merge 1 commit intomasterfrom
feature/swarming/docker-mount

Conversation

@IvanBM18
Copy link
Collaborator

@IvanBM18 IvanBM18 commented Mar 20, 2026

Overview

Swarming, as well as K8S has issues when trying to mounting this volume to the container.

mount /mnt/scratch0 -o remount,exec,suid,dev

So we added a validation to not mount when we are either in K8S or in swarming.

Note: Uses SWARMING_BOT env var as its the one we already use in the swarming request

Tests performed

I created a custom bash script to test this:

should_mount() {
  # Skip if running in Kubernetes
  if [[ -n "$IS_K8S_ENV" ]]; then
    return 1
  fi

  # Skip if running as a Swarming Job
  if [[ "$SWARMING_BOT" == "True" ]] || [[ "$SWARMING_BOT" == "1" ]] || [[ "$SWARMING_BOT" == "true" ]]; then
    return 1
  fi

  return 0
}

test_mount() {
  unset IS_K8S_ENV SWARMING_BOT
  [[ "$1" != "unset" ]] && export IS_K8S_ENV=$1
  [[ "$2" != "unset" ]] && export SWARMING_BOT=$2
  printf "IS_K8S_ENV=%-5s | SWARMING_BOT=%-5s  =>" "$1" "$2"
  if should_mount; then echo " [MOUNT EXECUTED]"; else echo " [MOUNT SKIPPED]"; fi
}

Against multiple inputs:

test_mount "unset" "unset"
test_mount "1"     "unset"
test_mount "unset" "True"
test_mount "unset" "1"
test_mount "unset" "false"

And got this results:

=== DRY RUN OUTPUT USING should_mount ===
IS_K8S_ENV=unset | SWARMING_BOT=unset  => [MOUNT EXECUTED]
IS_K8S_ENV=1     | SWARMING_BOT=unset  => [MOUNT SKIPPED]
IS_K8S_ENV=unset | SWARMING_BOT=True   => [MOUNT SKIPPED]
IS_K8S_ENV=unset | SWARMING_BOT=1      => [MOUNT SKIPPED]
IS_K8S_ENV=unset | SWARMING_BOT=false  => [MOUNT EXECUTED]

@IvanBM18 IvanBM18 self-assigned this Mar 20, 2026
@IvanBM18 IvanBM18 requested a review from a team as a code owner March 20, 2026 23:21
@IvanBM18 IvanBM18 added the swarming Changes related to the clusterfuzz-swarming integration label Mar 20, 2026
@IvanBM18 IvanBM18 force-pushed the feature/swarming/docker-mount branch from 63d4a39 to 0015431 Compare March 20, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

swarming Changes related to the clusterfuzz-swarming integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant