Skip to content

Commit

Permalink
Continued implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
tomuben committed Jun 21, 2024
1 parent e1c9553 commit 9a28252
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 18,
"id": "da57e77a-b41f-45e3-9a17-4b474bba898b",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "fc292eef40b644b58c599232d512d8fa",
"model_id": "2ea76eb5a4924a52be42a753f23c6f24",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -49,7 +49,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d5821c12ad1e48998dfb26758544fca9",
"model_id": "9be4aae87c6549e2ab2986a66081162e",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -79,7 +79,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 19,
"id": "27352b75-823d-40a1-b8df-d33218fd7de6",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -109,14 +109,14 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 24,
"id": "c554d698-d5a2-4f9b-846a-f606a3f183b7",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "298637d19433439d805fb7b7ff08e64d",
"model_id": "10c3aab42db24398b2c3d63b16614e59",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -151,15 +151,15 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"id": "f03723b8-2229-4e10-b801-ac074c7388cb",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Script-languages repository path is '/home/jupyter/script_languages_release'\n",
"Script-languages repository path is '/home/jupyter/notebooks/script_languages_release'\n",
"Selected flavor is 'template-Exasol-all-python-3.10'\n"
]
}
Expand Down Expand Up @@ -194,7 +194,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 27,
"id": "20665390-4f31-48db-ab78-249a1ef629e9",
"metadata": {
"scrolled": true
Expand All @@ -211,11 +211,12 @@
"source": [
"from exasol_script_languages_container_tool.lib import api as exaslct_api\n",
"\n",
"export_path = \"/tmp/slc\"\n",
"output_path = \"/tmp/output\"\n",
"export_path = \"/home/jupyter/notebooks/script_languages_container/container\"\n",
"output_path = \"/home/jupyter/notebooks/script_languages_container/output\"\n",
"\n",
"\n",
"with working_directory(slc_dir):\n",
" export_result = exaslct_api.export(flavor_path=(str(flavor_path),), export_path=export_path)\n",
" export_result = exaslct_api.export(flavor_path=(str(flavor_path),), export_path=export_path, output_directory=output_path)\n",
"print(\"Ready\")"
]
},
Expand All @@ -229,19 +230,41 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 23,
"id": "fc142500-d855-4112-bba2-ed3395889b9b",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Result file: /tmp/slc/template-Exasol-all-python-3.10_release.tar.gz\n",
"Directory content:\n",
"/tmp/slc/template-Exasol-all-python-3.10_release.tar.gz\n",
"/tmp/slc/template-Exasol-all-python-3.10_release.tar.gz.sha512sum\n"
"Result file: /home/jupyter/notebooks/slc/template-Exasol-all-python-3.10_release.tar.gz\n",
"Directory content:\n"
]
},
{
"data": {
"text/html": [
"<a href='../slc/template-Exasol-all-python-3.10_release.tar.gz' target='_blank'>../slc/template-Exasol-all-python-3.10_release.tar.gz</a><br>"
],
"text/plain": [
"/home/jupyter/notebooks/slc/template-Exasol-all-python-3.10_release.tar.gz"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<a href='../slc/template-Exasol-all-python-3.10_release.tar.gz.sha512sum' target='_blank'>../slc/template-Exasol-all-python-3.10_release.tar.gz.sha512sum</a><br>"
],
"text/plain": [
"/home/jupyter/notebooks/slc/template-Exasol-all-python-3.10_release.tar.gz.sha512sum"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
Expand All @@ -265,20 +288,25 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 28,
"id": "423b261a-3d99-4893-95dc-224a5794c588",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/home/jupyter/script_languages_release/.build_output/jobs/2024_06_21_08_52_13_1_ExportContainers/logs/main.log\n"
]
"data": {
"text/html": [
"<a href='output/jobs/2024_06_21_14_53_05_2_ExportContainers/logs/main.log' target='_blank'>output/jobs/2024_06_21_14_53_05_2_ExportContainers/logs/main.log</a><br>"
],
"text/plain": [
"/home/jupyter/notebooks/script_languages_container/output/jobs/2024_06_21_14_53_05_2_ExportContainers/logs/main.log"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"build_output = Path(slc_dir) / \".build_output\"\n",
"build_output = Path(output_path)\n",
"main_logs = list(build_output.glob('**/main.log'))\n",
"show_files(main_logs)"
]
Expand Down Expand Up @@ -341,19 +369,57 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 29,
"id": "1aa24f25-789c-49b3-bb5e-81d49f4afa69",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/home/jupyter/script_languages_release/.build_output/jobs/2024_06_21_08_52_13_1_ExportContainers/logs/main.log\n",
"/home/jupyter/script_languages_release/.build_output/jobs/2024_06_21_08_52_13_1_ExportContainers/outputs/ExportContainers_b00dce99a9/ExportFlavorContainer_7133c3de64/ExportContainerTask_7214837349/logs/pack_release_file.log\n",
"/home/jupyter/script_languages_release/.build_output/jobs/2024_06_21_08_52_13_1_ExportContainers/outputs/ExportContainers_b00dce99a9/ExportFlavorContainer_7133c3de64/ExportContainerTask_7214837349/logs/extract_release_file.log\n",
"/home/jupyter/script_languages_release/.build_output/jobs/2024_06_21_08_52_13_1_ExportContainers/outputs/ExportContainers_b00dce99a9/ExportFlavorContainer_7133c3de64/DockerCreateImageTask_6ada2ecae8/DockerPullImageTask_6ada2ecae8/logs/pull_docker_db_image.log\n"
]
"data": {
"text/html": [
"<a href='output/jobs/2024_06_21_14_53_05_2_ExportContainers/logs/main.log' target='_blank'>output/jobs/2024_06_21_14_53_05_2_ExportContainers/logs/main.log</a><br>"
],
"text/plain": [
"/home/jupyter/notebooks/script_languages_container/output/jobs/2024_06_21_14_53_05_2_ExportContainers/logs/main.log"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<a href='output/jobs/2024_06_21_14_53_05_2_ExportContainers/logs/.ipynb_checkpoints/main-checkpoint.log' target='_blank'>output/jobs/2024_06_21_14_53_05_2_ExportContainers/logs/.ipynb_checkpoints/main-checkpoint.log</a><br>"
],
"text/plain": [
"/home/jupyter/notebooks/script_languages_container/output/jobs/2024_06_21_14_53_05_2_ExportContainers/logs/.ipynb_checkpoints/main-checkpoint.log"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<a href='output/jobs/2024_06_21_14_53_05_2_ExportContainers/outputs/ExportContainers_fa5202c5a0/ExportFlavorContainer_a82bda8b22/ExportContainerTask_d268348ae6/logs/pack_release_file.log' target='_blank'>output/jobs/2024_06_21_14_53_05_2_ExportContainers/outputs/ExportContainers_fa5202c5a0/ExportFlavorContainer_a82bda8b22/ExportContainerTask_d268348ae6/logs/pack_release_file.log</a><br>"
],
"text/plain": [
"/home/jupyter/notebooks/script_languages_container/output/jobs/2024_06_21_14_53_05_2_ExportContainers/outputs/ExportContainers_fa5202c5a0/ExportFlavorContainer_a82bda8b22/ExportContainerTask_d268348ae6/logs/pack_release_file.log"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<a href='output/jobs/2024_06_21_14_53_05_2_ExportContainers/outputs/ExportContainers_fa5202c5a0/ExportFlavorContainer_a82bda8b22/ExportContainerTask_d268348ae6/logs/extract_release_file.log' target='_blank'>output/jobs/2024_06_21_14_53_05_2_ExportContainers/outputs/ExportContainers_fa5202c5a0/ExportFlavorContainer_a82bda8b22/ExportContainerTask_d268348ae6/logs/extract_release_file.log</a><br>"
],
"text/plain": [
"/home/jupyter/notebooks/script_languages_container/output/jobs/2024_06_21_14_53_05_2_ExportContainers/outputs/ExportContainers_fa5202c5a0/ExportFlavorContainer_a82bda8b22/ExportContainerTask_d268348ae6/logs/extract_release_file.log"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,24 @@
"source": [
"from pathlib import Path\n",
"from typing import List\n",
"from IPython.display import Code, display\n",
"from IPython.display import Code, display, FileLink, FileLinks\n",
"import os\n",
"\n",
"import os\n",
"import contextlib\n",
"from pathlib import Path\n",
"\n",
"def show_directory_content(p: Path, max_depth: int = 1):\n",
" for path in p.iterdir():\n",
" print(path)\n",
" if path.is_file():\n",
" display(FileLink(str(os.path.relpath(path))))\n",
" if path.is_dir() and max_depth > 1:\n",
" show_directory_content(path, max_depth - 1)\n",
"\n",
"def show_files(paths: List[Path]):\n",
" for path in paths:\n",
" print(path)\n",
" for path in paths:\n",
" if path.is_file():\n",
" display(FileLink(str(os.path.relpath(path))))\n",
"\n",
"def tail_file(path: Path, length: int):\n",
" with open(path) as f:\n",
Expand Down

0 comments on commit 9a28252

Please sign in to comment.