code: func (s *SwarmingClient) Configure(c context.Context, dir, user string) error {
  	// 0755 allows the directory structure to be read and listed by all users.
  	// Useful when SSHing fo the instance.
  	if err := os.MkdirAll(dir, 0755); err != nil {
  		return errors.Annotate(err, "failed to create: %s", dir).Err()
  	}
  	if err := s.chown(c, dir, user); err != nil {
  		return errors.Annotate(err, "failed to chown: %s", dir).Err()
  	}
  	zip := filepath.Join(dir, "swarming_bot.zip")
  	switch _, err := os.Stat(zip); {
  	case os.IsNotExist(err):
  	case err != nil:
  		return errors.Annotate(err, "failed to stat: %s", zip).Err()
  	default:
  		logging.Infof(c, "already installed: %s", zip)
  		return nil
  	}
  	if err := s.fetch(c, zip, user); err != nil {
  		return err
  	}
  	return s.autostart(c, zip, user)
  }
docs: // Configure fetches the Swarming bot code and configures it to run on startup.