prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Bundle system - copy opensearch-tar-install script into bundle
  The [opensearch-tar-install](https://github.com/opensearch-project/opensearch-build/blob/main/release/tar/linux/opensearch-tar-install.sh) script needs to be included with assembled bundles similar to [this](https://github.com/opensearch-project/opensearch-build/blob/main/release/tar/linux/opensearch-tar-build.sh#L156) shell script.
  
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `bundle-workflow/python/assemble.py`
  Content:
  ```
  1 #!/usr/bin/env python
  2 
  3 # Copyright OpenSearch Contributors.
  4 # SPDX-License-Identifier: Apache-2.0
  5 
  6 import os
  7 import tempfile
  8 import argparse
  9 from assemble_workflow.bundle import Bundle
  10 from assemble_workflow.bundle_recorder import BundleRecorder
  11 from manifests.build_manifest import BuildManifest
  12 
  13 parser = argparse.ArgumentParser(description = "Assemble an OpenSearch Bundle")
  14 parser.add_argument('manifest', type = argparse.FileType('r'), help="Manifest file.")
  15 args = parser.parse_args()
  16 
  17 build_manifest = BuildManifest.from_file(args.manifest)
  18 build = build_manifest.build
  19 artifacts_dir = os.path.dirname(os.path.realpath(args.manifest.name))
  20 output_dir = os.path.join(os.getcwd(), 'bundle')
  21 os.makedirs(output_dir, exist_ok=True)
  22 
  23 with tempfile.TemporaryDirectory() as work_dir:
  24     print(f'Bundling {build.name} ({build.architecture}) into {output_dir} ...')
  25 
  26     os.chdir(work_dir)
  27 
  28     bundle_recorder = BundleRecorder(build, output_dir, artifacts_dir)
  29     bundle = Bundle(build_manifest, artifacts_dir, bundle_recorder)
  30 
  31     bundle.install_plugins()
  32     print(f'Installed plugins: {bundle.installed_plugins}')
  33 
  34     #  Save a copy of the manifest inside of the tar
  35     bundle_recorder.write_manifest(bundle.archive_path)
  36     bundle.build_tar(output_dir)
  37 
  38     bundle_recorder.write_manifest(output_dir)
  39 
  40 print(f'Done.')
  41
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/bundle-workflow/python/assemble.py b/bundle-workflow/python/assemble.py
  --- a/bundle-workflow/python/assemble.py
  +++ b/bundle-workflow/python/assemble.py
  @@ -6,6 +6,7 @@
   import os
   import tempfile
   import argparse
  +import shutil
   from assemble_workflow.bundle import Bundle
   from assemble_workflow.bundle_recorder import BundleRecorder
   from manifests.build_manifest import BuildManifest
  @@ -14,6 +15,12 @@
   parser.add_argument('manifest', type = argparse.FileType('r'), help="Manifest file.")
   args = parser.parse_args()
   
  +tarball_installation_script = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../release/tar/linux/opensearch-tar-install.sh')
  +
  +if not os.path.isfile(tarball_installation_script):
  +    print(f'No installation script found at path: {tarball_installation_script}')
  +    exit(1)
  +
   build_manifest = BuildManifest.from_file(args.manifest)
   build = build_manifest.build
   artifacts_dir = os.path.dirname(os.path.realpath(args.manifest.name))
  @@ -31,6 +38,9 @@
       bundle.install_plugins()
       print(f'Installed plugins: {bundle.installed_plugins}')
   
  +    # Copy the tar installation script into the bundle
  +    shutil.copyfile(tarball_installation_script, os.path.join(bundle.archive_path, os.path.basename(tarball_installation_script)))
  +
       #  Save a copy of the manifest inside of the tar
       bundle_recorder.write_manifest(bundle.archive_path)
       bundle.build_tar(output_dir)
  
verification_info: {"golden_diff": "diff --git a/bundle-workflow/python/assemble.py b/bundle-workflow/python/assemble.py\n--- a/bundle-workflow/python/assemble.py\n+++ b/bundle-workflow/python/assemble.py\n@@ -6,6 +6,7 @@\n import os\n import tempfile\n import argparse\n+import shutil\n from assemble_workflow.bundle import Bundle\n from assemble_workflow.bundle_recorder import BundleRecorder\n from manifests.build_manifest import BuildManifest\n@@ -14,6 +15,12 @@\n parser.add_argument('manifest', type = argparse.FileType('r'), help=\"Manifest file.\")\n args = parser.parse_args()\n \n+tarball_installation_script = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../release/tar/linux/opensearch-tar-install.sh')\n+\n+if not os.path.isfile(tarball_installation_script):\n+    print(f'No installation script found at path: {tarball_installation_script}')\n+    exit(1)\n+\n build_manifest = BuildManifest.from_file(args.manifest)\n build = build_manifest.build\n artifacts_dir = os.path.dirname(os.path.realpath(args.manifest.name))\n@@ -31,6 +38,9 @@\n     bundle.install_plugins()\n     print(f'Installed plugins: {bundle.installed_plugins}')\n \n+    # Copy the tar installation script into the bundle\n+    shutil.copyfile(tarball_installation_script, os.path.join(bundle.archive_path, os.path.basename(tarball_installation_script)))\n+\n     #  Save a copy of the manifest inside of the tar\n     bundle_recorder.write_manifest(bundle.archive_path)\n     bundle.build_tar(output_dir)\n", "issue": "Bundle system - copy opensearch-tar-install script into bundle\nThe [opensearch-tar-install](https://github.com/opensearch-project/opensearch-build/blob/main/release/tar/linux/opensearch-tar-install.sh) script needs to be included with assembled bundles similar to [this](https://github.com/opensearch-project/opensearch-build/blob/main/release/tar/linux/opensearch-tar-build.sh#L156) shell script.\r\n\r\n\n", "before_files": [{"content": "#!/usr/bin/env python\n\n# Copyright OpenSearch Contributors.\n# SPDX-License-Identifier: Apache-2.0\n\nimport os\nimport tempfile\nimport argparse\nfrom assemble_workflow.bundle import Bundle\nfrom assemble_workflow.bundle_recorder import BundleRecorder\nfrom manifests.build_manifest import BuildManifest\n\nparser = argparse.ArgumentParser(description = \"Assemble an OpenSearch Bundle\")\nparser.add_argument('manifest', type = argparse.FileType('r'), help=\"Manifest file.\")\nargs = parser.parse_args()\n\nbuild_manifest = BuildManifest.from_file(args.manifest)\nbuild = build_manifest.build\nartifacts_dir = os.path.dirname(os.path.realpath(args.manifest.name))\noutput_dir = os.path.join(os.getcwd(), 'bundle')\nos.makedirs(output_dir, exist_ok=True)\n\nwith tempfile.TemporaryDirectory() as work_dir:\n    print(f'Bundling {build.name} ({build.architecture}) into {output_dir} ...')\n\n    os.chdir(work_dir)\n\n    bundle_recorder = BundleRecorder(build, output_dir, artifacts_dir)\n    bundle = Bundle(build_manifest, artifacts_dir, bundle_recorder)\n\n    bundle.install_plugins()\n    print(f'Installed plugins: {bundle.installed_plugins}')\n\n    #  Save a copy of the manifest inside of the tar\n    bundle_recorder.write_manifest(bundle.archive_path)\n    bundle.build_tar(output_dir)\n\n    bundle_recorder.write_manifest(output_dir)\n\nprint(f'Done.')\n", "path": "bundle-workflow/python/assemble.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\n# Copyright OpenSearch Contributors.\n# SPDX-License-Identifier: Apache-2.0\n\nimport os\nimport tempfile\nimport argparse\nimport shutil\nfrom assemble_workflow.bundle import Bundle\nfrom assemble_workflow.bundle_recorder import BundleRecorder\nfrom manifests.build_manifest import BuildManifest\n\nparser = argparse.ArgumentParser(description = \"Assemble an OpenSearch Bundle\")\nparser.add_argument('manifest', type = argparse.FileType('r'), help=\"Manifest file.\")\nargs = parser.parse_args()\n\ntarball_installation_script = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../release/tar/linux/opensearch-tar-install.sh')\n\nif not os.path.isfile(tarball_installation_script):\n    print(f'No installation script found at path: {tarball_installation_script}')\n    exit(1)\n\nbuild_manifest = BuildManifest.from_file(args.manifest)\nbuild = build_manifest.build\nartifacts_dir = os.path.dirname(os.path.realpath(args.manifest.name))\noutput_dir = os.path.join(os.getcwd(), 'bundle')\nos.makedirs(output_dir, exist_ok=True)\n\nwith tempfile.TemporaryDirectory() as work_dir:\n    print(f'Bundling {build.name} ({build.architecture}) into {output_dir} ...')\n\n    os.chdir(work_dir)\n\n    bundle_recorder = BundleRecorder(build, output_dir, artifacts_dir)\n    bundle = Bundle(build_manifest, artifacts_dir, bundle_recorder)\n\n    bundle.install_plugins()\n    print(f'Installed plugins: {bundle.installed_plugins}')\n\n    # Copy the tar installation script into the bundle\n    shutil.copyfile(tarball_installation_script, os.path.join(bundle.archive_path, os.path.basename(tarball_installation_script)))\n\n    #  Save a copy of the manifest inside of the tar\n    bundle_recorder.write_manifest(bundle.archive_path)\n    bundle.build_tar(output_dir)\n\n    bundle_recorder.write_manifest(output_dir)\n\nprint(f'Done.')\n", "path": "bundle-workflow/python/assemble.py"}]}