<commit_before>---
- name: Making local image of EBS Volume to bundle
  command: 'qemu-img convert -f host_device -O raw {{ ami_device }} /mnt/{{ ami_name }}.img'

- name: Making folder for bundle
  file:
    path: /mnt/{{ ami_name }}-bundled
    state: directory
    owner: root
    group: root
    mode: 0444


# TODO: --product-codes blabla,foo
- name: Bundling image for S3
  #command: 'ec2-bundle-image -k {{ ami_bundle_pk }} -c {{ ami_bundle_cert }} -u {{ ami_bundle_account }} -i /mnt/{{ ami_name }}.img -d /mnt/{{ ami_name }}-bundled -r x86_64'
  command: 'ec2-bundle-image -k {{ ami_bundle_pk }} -c {{ ami_bundle_cert }} -u {{ ami_bundle_account }} -i /mnt/{{ ami_name }}.img -d /mnt/{{ ami_name }}-bundled -r x86_64 --block-device-mapping ami=sda,root=/dev/sda1,ephemeral0=sdb'

# TODO: --region us-west-2
- name: Uploading image to S3
  command: "ec2-upload-bundle -b {{ ami_bundle_bucket_path }}/{{ ami_name }} -m /mnt/{{ ami_name }}-bundled/{{ ami_name }}.img.manifest.xml -a {{ iam_access_key }} -s {{ iam_secret_key }} -t {{ iam_token }}"

# FIXME: clean up image, bundle folder

#- name: Removing temporary files for bundle:
#  file:
#    path: '{{ item }}'
#    state: absent
#  with_items: 
#    - /mnt/{{ ami_name }}-bundled
#    - /mnt/{{ ami_name }}.img<commit_msg>add retry flag to bundle<commit_after>---
- name: Making local image of EBS Volume to bundle
  command: 'qemu-img convert -f host_device -O raw {{ ami_device }} /mnt/{{ ami_name }}.img'

- name: Making folder for bundle
  file:
    path: /mnt/{{ ami_name }}-bundled
    state: directory
    owner: root
    group: root
    mode: 0444


# TODO: --product-codes blabla,foo
- name: Bundling image for S3
  #command: 'ec2-bundle-image -k {{ ami_bundle_pk }} -c {{ ami_bundle_cert }} -u {{ ami_bundle_account }} -i /mnt/{{ ami_name }}.img -d /mnt/{{ ami_name }}-bundled -r x86_64'
  command: 'ec2-bundle-image -k {{ ami_bundle_pk }} -c {{ ami_bundle_cert }} -u {{ ami_bundle_account }} -i /mnt/{{ ami_name }}.img -d /mnt/{{ ami_name }}-bundled -r x86_64 --block-device-mapping ami=sda,root=/dev/sda1,ephemeral0=sdb'

# TODO: --region us-west-2
- name: Uploading image to S3
  command: "ec2-upload-bundle -b {{ ami_bundle_bucket_path }}/{{ ami_name }} -m /mnt/{{ ami_name }}-bundled/{{ ami_name }}.img.manifest.xml -a {{ iam_access_key }} -s {{ iam_secret_key }} -t {{ iam_token }} --retry"

# FIXME: clean up image, bundle folder

#- name: Removing temporary files for bundle:
#  file:
#    path: '{{ item }}'
#    state: absent
#  with_items: 
#    - /mnt/{{ ami_name }}-bundled
#    - /mnt/{{ ami_name }}.img
{'fraction_non_alphanumeric': 0.17599382477807796, 'fraction_numerical': 0.015438054805094558, 'mean_word_length': 3.1806451612903226, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5614083', 'n_tokens_mistral': 1053, 'n_tokens_neox': 1031, 'n_words': 272}