maxence-lefebvre / docker-forcedroid

MIT License
0 stars 0 forks source link

Puppet installation hangs for way too much time #2

Closed maxence-lefebvre closed 3 weeks ago

maxence-lefebvre commented 7 years ago

I don't know why but it seems that this simple puppet manifest file takes way too much time to execute...

# Install java 8 & android SDK
class { 'java': } ->
  class { 'android': }

android::platform { 'android-24' : }
android::build_tools { 'build-tools-24.0.1' : }

# Install nodejs
class { 'nodejs':
  repo_url_suffix => '7.x'
}

# Install cordova
package { 'cordova':
  ensure          => 'present',
  install_options => ['--silent'],
  provider        => 'npm',
} -> # Disable telemtry
  exec { 'disable cordova telemetry':
    command => '/usr/bin/cordova telemetry off',
    user    => root
  }

# Install forcedroid
package { 'forcedroid':
  ensure          => 'present',
  install_options => ['--silent'],
  provider        => 'npm',
}

include git
maxence-lefebvre commented 7 years ago
==> default: Notice: Finished catalog run in 55915.24 seconds

Looks like this takes 56000 secondes to execute, aka 15.5h.

Using vagrant-cachier may earn some time

maxence-lefebvre commented 7 years ago

By upgrading RAM inside VB guest, it decreased to 17k5s

Notice: Finished catalog run in 17451.01 seconds

Using htop during provisionning, it seems it is still limited by java -XmX during installation of android SDK.

Looking into it

maxence-lefebvre commented 7 years ago

Following monkey patch wasn't effective :

# Trying to make sur "-Xmx256M" in android-sdk-linux/tools/android is replaced by "-Xmx1G"
# Installation of platform tools / platform / build tools is WAY too long (between 4 and 17hours!!)
exec { 'Increase-maxheapsize-for-android-sdk-manager':
  command    => '/bin/sed -i \'s/Xmx256M/Xmx1G/g\' /opt/android/android-sdk-linux/tools/android',
  before     => Exec['update-android-package-platform-tools'],
  require    => [File['/opt/android/expect-install-platform-tools']]
}

Using htop during provisionning shows that memory use is still around 260M

maxence-lefebvre commented 7 years ago

Okay still due to the fact that proxy management is still no standard.

Instead of looking into "http_proxy" environment variable, you have to set it as an option to android.

AFAIK I'll have to go deeper inside puppet & hiera to know how I should handle it properly (setting proxy_host and proxy_port only if http_proxy environment variable exists)