Skip to content

Conversation

@cailafinn
Copy link
Collaborator

Adds a new role (that is, by default, set to run never in the playbook) to the agent playbook that downloads and then sets up a crontab job to keep the external data store up-to-date. This stops nodes having to wait until a build runs on them to download the data, improving parallelization.

The changes also adjust the way the data is stored on the host machine, moving it from a docker volume (which is inaccessible from the host machine) to a mount in the root directory. This allows viewing and manipulation of the contents of the volume to be performed without having to enter into a docker container.

This change was implemented primarily to get around a bug in a packaging script where new data could not be downloaded.
Having the data present on the machine ahead of time was an easier solution.

To Test

  • Take a linux node offline.
  • SSH into the node. Remove some data from the /{agent_name}_external_data/MD5 directory.
  • Wait a while.
  • Check that the crontab job downloaded the missing files by checking update_log.txt
  • Remove the crontab job (sudo crontab -e -u root)
  • Run the ansible script
    ansible-playbook -i inventory.txt jenkins-agent-production.yml -t "mirror, agent" -u {fedID}
  • SSH back into the machine and check the crontab job is present and the data has been downloaded.

if [ -z "${RSYNC_PROCESS_IDS}" ]; then
echo "running rsync..."
rsync -az --perms -o -g $SERVER_IP:/srv/$FTP_SRV_DIR/ftp/external-data/MD5/ /external-data/MD5/
rsync -azvW --perms -o -g $SERVER_IP:/srv/$FTP_SRV_DIR/ftp/external-data/MD5/ /external-data/MD5/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--whole-file, -W
              This option disables rsync's delta-transfer algorithm, which causes all transferred files to be sent whole.  The transfer may be faster if this option  is  used  when
              the  bandwidth between the source and destination machines is higher than the bandwidth to disk (especially when the "disk" is actually a networked filesystem).  This
              is the default when both the source and destination are specified as local paths, but only if no batch-writing option is in effect.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Including the -W flag seemed to reduce some of the flakiness that was happening when trying to rsync data though the load balancer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting for Review

Development

Successfully merging this pull request may close these issues.

3 participants