Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-10422

Emulator snapshots impossible to use in job under android-emulator plugin

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      It's impractical to use snapshots in your job when you're using the android-emulator plugin, as it has two modes of operating:
      a) android-emulator manages and loads a snapshot,
      b) android-emulator disables snapshot support.

      While it would be possible for the job itself to use snapshots in a (simply by using a different snapshot name), having more than a single snapshot in a snapshot.img is currently broken (as reported in http://code.google.com/p/android/issues/detail?id=15922 - though no update so far).
      This only leaves the possibility of disabling snapshots in android-emulator, but when you choose not to use snapshots it passes the -no-snapstorage, making snapshots unusable for any jobs running. Why was this design decision made - is there some gain to be had?

      I've attached a simple patch that simply disables this behavior in b, until android issue 15922 is resolved.

        Attachments

          Activity

          Hide
          orrc Christopher Orr added a comment -

          If you have an emulator set up with a snapshots.img file, by default the emulator process will automatically attempt to load from (and save to) the "default" snapshot.

          For this plugin, that behaviour is not necessarily desirable: snapshots take up a lot of disk space, hence why the plugin takes more control of how snapshots are used. If the user doesn't want to make use of them, then -no-snapstorage is passed to completely disable snapshot storage.

          However, as this suggests, I hadn't considered the case that somebody would want to take full control over snapshots used by Jenkins
          Normally, I would expect that emulators are created by the plugin, and nobody bothers to insert their own snapshot files.

          In your case, would it be more desirable that we add a configuration option to the plugin, so you can specify the snapshot you want to use?

          [x] Use emulator snapshots
                Snapshot name (defaults to "jenkins"): [ ${my_snapshot} ]
          

          i.e. You can enter a custom snapshot name (if you want), which can then also do variable expansion.

          Show
          orrc Christopher Orr added a comment - If you have an emulator set up with a snapshots.img file, by default the emulator process will automatically attempt to load from (and save to) the "default" snapshot. For this plugin, that behaviour is not necessarily desirable: snapshots take up a lot of disk space, hence why the plugin takes more control of how snapshots are used. If the user doesn't want to make use of them, then -no-snapstorage is passed to completely disable snapshot storage. However, as this suggests, I hadn't considered the case that somebody would want to take full control over snapshots used by Jenkins Normally, I would expect that emulators are created by the plugin, and nobody bothers to insert their own snapshot files. In your case, would it be more desirable that we add a configuration option to the plugin, so you can specify the snapshot you want to use? [x] Use emulator snapshots Snapshot name (defaults to "jenkins"): [ ${my_snapshot} ] i.e. You can enter a custom snapshot name (if you want), which can then also do variable expansion.
          Hide
          jorgenpt Jørgen Tjernø added a comment - - edited

          You can leave snapshots enabled, yet disable automatic saving & loading of snapshots by passing the following arguments:
          -no-snapshot-load -no-snapshot-save

          I use that in some internal tools to be able to load snapshots on-demand, by connecting to the emulator's console and issuing an "avd snapshot load".

          Show
          jorgenpt Jørgen Tjernø added a comment - - edited You can leave snapshots enabled, yet disable automatic saving & loading of snapshots by passing the following arguments: -no-snapshot-load -no-snapshot-save I use that in some internal tools to be able to load snapshots on-demand, by connecting to the emulator's console and issuing an "avd snapshot load".
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christopher Orr
          Path:
          src/main/java/hudson/plugins/android_emulator/EmulatorConfig.java
          http://jenkins-ci.org/commit/android-emulator-plugin/030e4bff9d27d2c59ee41244cf92a08eb457abb7
          Log:
          [FIXED JENKINS-10422] Don't prevent snapshots from being used manually.

          Now users can use the "adb snapshot" commands, even if the emulator is
          configured such that the plugin does not manage the usage of snapshots.

          Compare: https://github.com/jenkinsci/android-emulator-plugin/compare/0e9e7cc...030e4bf

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christopher Orr Path: src/main/java/hudson/plugins/android_emulator/EmulatorConfig.java http://jenkins-ci.org/commit/android-emulator-plugin/030e4bff9d27d2c59ee41244cf92a08eb457abb7 Log: [FIXED JENKINS-10422] Don't prevent snapshots from being used manually. Now users can use the "adb snapshot" commands, even if the emulator is configured such that the plugin does not manage the usage of snapshots. Compare: https://github.com/jenkinsci/android-emulator-plugin/compare/0e9e7cc...030e4bf
          Hide
          orrc Christopher Orr added a comment -

          Version 1.16 has now been released, which includes this update.

          Show
          orrc Christopher Orr added a comment - Version 1.16 has now been released, which includes this update.

            People

            • Assignee:
              orrc Christopher Orr
              Reporter:
              jorgenpt Jørgen Tjernø
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: