{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "861d880e-ec9a-4f92-9ed9-a4dba4225442",
   "metadata": {},
   "source": [
    "# Notebook based code\n",
    "You can write code in python in the notebook, ship things from the notebook and get respones, outputs, logs.\n",
    "\n",
    "## Challenges today\n",
    "1. You cannot run \"nested\" `dynamic` etc in a notebook in V1\n",
    "2. Seeing logs etc and getting the right version is hard\n",
    "\n",
    "## Things to note!\n",
    "1. Simple init (we will make this magical soon for serverless etc)\n",
    "2. asyncio is native in a notebook\n",
    "3. nested calls square calls hello\n",
    "4. Observe phases\n",
    "5. Observe logs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "0e2d1a43-d3ef-4fdb-b7e2-019a3210a823",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-19T21:41:26.372729Z",
     "start_time": "2025-05-19T21:41:26.339157Z"
    }
   },
   "outputs": [],
   "source": [
    "import flyte"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "80893b50-7666-4344-a97f-259cfc8af8af",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-19T21:41:28.230746Z",
     "start_time": "2025-05-19T21:41:28.180605Z"
    }
   },
   "outputs": [],
   "source": [
    "flyte.init(\n",
    "    endpoint=\"https://union.example.com\",\n",
    "    org=\"example_org\",\n",
    "    project=\"example_project\",\n",
    "    domain=\"development\",\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "04843b45-7646-4fa9-b137-b25604ecb995",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-19T21:41:35.980847Z",
     "start_time": "2025-05-19T21:41:35.978711Z"
    }
   },
   "outputs": [],
   "source": [
    "env = flyte.TaskEnvironment(\n",
    "    name=\"hello_world\",\n",
    "    image=flyte.Image.auto(),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "4acfbd7f-629d-4c8e-bf4b-8b1247eb5d96",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-19T21:41:38.054526Z",
     "start_time": "2025-05-19T21:41:38.051147Z"
    }
   },
   "outputs": [],
   "source": [
    "import asyncio\n",
    "from typing import List\n",
    "\n",
    "\n",
    "@env.task\n",
    "async def say_hello(data: str, lt: List[int]) -> str:\n",
    "    print(f\"Hello, world! - {flyte.ctx().action}\")\n",
    "    return f\"Hello {data} {lt}\"\n",
    "\n",
    "\n",
    "@env.task\n",
    "async def square(i: int = 3) -> int:\n",
    "    print(flyte.ctx().action)\n",
    "    return i * i\n",
    "\n",
    "\n",
    "@env.task\n",
    "async def say_hello_nested(data: str = \"default string\") -> str:\n",
    "    print(f\"Hello, nested! - {flyte.ctx().action}\")\n",
    "    coros = []\n",
    "    for i in range(100):\n",
    "        coros.append(square(i=i))\n",
    "\n",
    "    vals = await asyncio.gather(*coros)\n",
    "    return await say_hello(data=data, lt=vals)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "8bdcdb93-0447-4f7f-895a-b87ff034e5e2",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-19T21:42:08.373102Z",
     "start_time": "2025-05-19T21:42:08.293015Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">09:07:01.266120 </span><span style=\"color: #000080; text-decoration-color: #000080\">INFO    </span> _deploy.py:<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">102</span> - Building Image for environment hello_world, image: <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">Image</span><span style=\"font-weight: bold\">(</span><span style=\"color: #808000; text-decoration-color: #808000\">base_image</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'python:3.12-slim-bookworm'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">dockerfile</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">None</span>,     \n",
       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                </span>         <span style=\"color: #808000; text-decoration-color: #808000\">registry</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'ghcr.io/unionai-oss'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">name</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'flyte'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">platform</span>=<span style=\"font-weight: bold\">(</span><span style=\"color: #008000; text-decoration-color: #008000\">'linux/amd64'</span>, <span style=\"color: #008000; text-decoration-color: #008000\">'linux/arm64'</span><span style=\"font-weight: bold\">)</span>, <span style=\"color: #808000; text-decoration-color: #808000\">tag</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'py3.12-v0.2.0b4.dev6-g17ff4f7'</span>,            \n",
       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                </span>         <span style=\"color: #808000; text-decoration-color: #808000\">python_version</span>=<span style=\"font-weight: bold\">(</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">12</span><span style=\"font-weight: bold\">)</span>, <span style=\"color: #808000; text-decoration-color: #808000\">_identifier_override</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'auto'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">is_final</span>=<span style=\"color: #ff0000; text-decoration-color: #ff0000; font-style: italic\">False</span>, <span style=\"color: #808000; text-decoration-color: #808000\">_layers</span>=<span style=\"font-weight: bold\">(</span><span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">_DockerLines</span><span style=\"font-weight: bold\">(</span>LABEL                                       \n",
       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                </span>         org.opencontainers.image.<span style=\"color: #808000; text-decoration-color: #808000\">authors</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'Union.AI &lt;sales@union.ai&gt;'</span><span style=\"color: #000000; text-decoration-color: #000000\">=</span><span style=\"color: #008000; text-decoration-color: #008000\">'LABEL </span>                                                                   \n",
       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                </span>         <span style=\"color: #008000; text-decoration-color: #008000\">org.opencontainers.image.source=https://github.com/unionai/unionv2'</span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">)</span><span style=\"color: #000000; text-decoration-color: #000000\">, </span><span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">Env</span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">(</span><span style=\"color: #808000; text-decoration-color: #808000\">env_vars</span><span style=\"color: #000000; text-decoration-color: #000000\">=</span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">((</span><span style=\"color: #008000; text-decoration-color: #008000\">'VIRTUAL_ENV'</span><span style=\"color: #000000; text-decoration-color: #000000\">, </span><span style=\"color: #008000; text-decoration-color: #008000\">'/opt/venv'</span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">)</span><span style=\"color: #000000; text-decoration-color: #000000\">, </span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">(</span><span style=\"color: #008000; text-decoration-color: #008000\">'PATH'</span><span style=\"color: #000000; text-decoration-color: #000000\">, </span>            \n",
       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                </span>         <span style=\"color: #008000; text-decoration-color: #008000\">'/opt/venv/bin:$PATH'</span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">)</span><span style=\"color: #000000; text-decoration-color: #000000\">, </span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">(</span><span style=\"color: #008000; text-decoration-color: #008000\">'PYTHONPATH'</span><span style=\"color: #000000; text-decoration-color: #000000\">, </span><span style=\"color: #008000; text-decoration-color: #008000\">'/root'</span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">)</span><span style=\"color: #000000; text-decoration-color: #000000\">, </span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">(</span><span style=\"color: #008000; text-decoration-color: #008000\">'UV_LINK_MODE'</span><span style=\"color: #000000; text-decoration-color: #000000\">, </span><span style=\"color: #008000; text-decoration-color: #008000\">'copy'</span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">)))</span><span style=\"color: #000000; text-decoration-color: #000000\">, </span><span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">AptPackages</span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">(</span><span style=\"color: #000000; text-decoration-color: #000000\">build-</span><span style=\"color: #808000; text-decoration-color: #808000\">essential</span><span style=\"color: #000000; text-decoration-color: #000000\">=</span><span style=\"color: #008000; text-decoration-color: #008000\">'ca-certificates'</span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">)</span><span style=\"color: #000000; text-decoration-color: #000000\">, </span>          \n",
       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                </span>         <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">PipPackages</span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">(</span><span style=\"color: #808000; text-decoration-color: #808000\">packages</span><span style=\"color: #000000; text-decoration-color: #000000\">=</span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">(</span><span style=\"color: #008000; text-decoration-color: #008000\">'kubernetes'</span><span style=\"color: #000000; text-decoration-color: #000000\">, </span><span style=\"color: #008000; text-decoration-color: #008000\">'msgpack'</span><span style=\"color: #000000; text-decoration-color: #000000\">, </span><span style=\"color: #008000; text-decoration-color: #008000\">'mashumaro'</span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">))</span><span style=\"color: #000000; text-decoration-color: #000000\">, </span><span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">CopyConfig</span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">(</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span><span style=\"color: #000000; text-decoration-color: #000000\">, </span><span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">PosixPath</span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">(</span><span style=\"color: #008000; text-decoration-color: #008000\">'/Users/ketanumare/src/unionv2/dist'</span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">)</span><span style=\"color: #000000; text-decoration-color: #000000\">, </span>          \n",
       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                </span>         <span style=\"color: #808000; text-decoration-color: #808000\">_compute_identifier</span><span style=\"color: #000000; text-decoration-color: #000000\">=&lt;function Image.with_local_v2.&lt;locals&gt;.&lt;lambda&gt; at </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0x106642020</span><span style=\"font-weight: bold\">&gt;)</span>,                                                  \n",
       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                </span>         <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">Commands</span><span style=\"font-weight: bold\">(</span><span style=\"color: #008000; text-decoration-color: #008000\">'--mount=type=cache,sharing=locked,mode=0777,target=/root/.cache/uv,id=uv --mount=from=uv,source=/uv,target=/usr/bin/uv </span>      \n",
       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                </span>         <span style=\"color: #008000; text-decoration-color: #008000\">--mount=source=dist,target=/dist,type=bind uv pip install --python $VIRTUALENV $(ls /dist/*whl)'</span><span style=\"font-weight: bold\">)))</span>                                    \n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2;36m09:07:01.266120\u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO    \u001b[0m _deploy.py:\u001b[1;36m102\u001b[0m - Building Image for environment hello_world, image: \u001b[1;35mImage\u001b[0m\u001b[1m(\u001b[0m\u001b[33mbase_image\u001b[0m=\u001b[32m'python:3.12-slim-bookworm'\u001b[0m, \u001b[33mdockerfile\u001b[0m=\u001b[3;35mNone\u001b[0m,     \n",
       "\u001b[2;36m                \u001b[0m         \u001b[33mregistry\u001b[0m=\u001b[32m'ghcr.io/unionai-oss'\u001b[0m, \u001b[33mname\u001b[0m=\u001b[32m'flyte'\u001b[0m, \u001b[33mplatform\u001b[0m=\u001b[1m(\u001b[0m\u001b[32m'linux/amd64'\u001b[0m, \u001b[32m'linux/arm64'\u001b[0m\u001b[1m)\u001b[0m, \u001b[33mtag\u001b[0m=\u001b[32m'py3.12-v0.2.0b4.dev6-g17ff4f7'\u001b[0m,            \n",
       "\u001b[2;36m                \u001b[0m         \u001b[33mpython_version\u001b[0m=\u001b[1m(\u001b[0m\u001b[1;36m3\u001b[0m, \u001b[1;36m12\u001b[0m\u001b[1m)\u001b[0m, \u001b[33m_identifier_override\u001b[0m=\u001b[32m'auto'\u001b[0m, \u001b[33mis_final\u001b[0m=\u001b[3;91mFalse\u001b[0m, \u001b[33m_layers\u001b[0m=\u001b[1m(\u001b[0m\u001b[1;35m_DockerLines\u001b[0m\u001b[1m(\u001b[0mLABEL                                       \n",
       "\u001b[2;36m                \u001b[0m         org.opencontainers.image.\u001b[33mauthors\u001b[0m=\u001b[32m'Union.AI \u001b[0m\u001b[32m<\u001b[0m\u001b[32msales\u001b[0m\u001b[32m@union.ai>'\u001b[0m\u001b[39m=\u001b[0m\u001b[32m'LABEL \u001b[0m                                                                   \n",
       "\u001b[2;36m                \u001b[0m         \u001b[32morg.opencontainers.image.\u001b[0m\u001b[32msource\u001b[0m\u001b[32m=\u001b[0m\u001b[32mhttps\u001b[0m\u001b[32m://github.com/unionai/unionv2'\u001b[0m\u001b[1;39m)\u001b[0m\u001b[39m, \u001b[0m\u001b[1;35mEnv\u001b[0m\u001b[1;39m(\u001b[0m\u001b[33menv_vars\u001b[0m\u001b[39m=\u001b[0m\u001b[1;39m(\u001b[0m\u001b[1;39m(\u001b[0m\u001b[32m'VIRTUAL_ENV'\u001b[0m\u001b[39m, \u001b[0m\u001b[32m'/opt/venv'\u001b[0m\u001b[1;39m)\u001b[0m\u001b[39m, \u001b[0m\u001b[1;39m(\u001b[0m\u001b[32m'PATH'\u001b[0m\u001b[39m, \u001b[0m            \n",
       "\u001b[2;36m                \u001b[0m         \u001b[32m'/opt/venv/bin:$PATH'\u001b[0m\u001b[1;39m)\u001b[0m\u001b[39m, \u001b[0m\u001b[1;39m(\u001b[0m\u001b[32m'PYTHONPATH'\u001b[0m\u001b[39m, \u001b[0m\u001b[32m'/root'\u001b[0m\u001b[1;39m)\u001b[0m\u001b[39m, \u001b[0m\u001b[1;39m(\u001b[0m\u001b[32m'UV_LINK_MODE'\u001b[0m\u001b[39m, \u001b[0m\u001b[32m'copy'\u001b[0m\u001b[1;39m)\u001b[0m\u001b[1;39m)\u001b[0m\u001b[1;39m)\u001b[0m\u001b[39m, \u001b[0m\u001b[1;35mAptPackages\u001b[0m\u001b[1;39m(\u001b[0m\u001b[39mbuild-\u001b[0m\u001b[33messential\u001b[0m\u001b[39m=\u001b[0m\u001b[32m'ca-certificates'\u001b[0m\u001b[1;39m)\u001b[0m\u001b[39m, \u001b[0m          \n",
       "\u001b[2;36m                \u001b[0m         \u001b[1;35mPipPackages\u001b[0m\u001b[1;39m(\u001b[0m\u001b[33mpackages\u001b[0m\u001b[39m=\u001b[0m\u001b[1;39m(\u001b[0m\u001b[32m'kubernetes'\u001b[0m\u001b[39m, \u001b[0m\u001b[32m'msgpack'\u001b[0m\u001b[39m, \u001b[0m\u001b[32m'mashumaro'\u001b[0m\u001b[1;39m)\u001b[0m\u001b[1;39m)\u001b[0m\u001b[39m, \u001b[0m\u001b[1;35mCopyConfig\u001b[0m\u001b[1;39m(\u001b[0m\u001b[1;36m1\u001b[0m\u001b[39m, \u001b[0m\u001b[1;35mPosixPath\u001b[0m\u001b[1;39m(\u001b[0m\u001b[32m'/Users/ketanumare/src/unionv2/dist'\u001b[0m\u001b[1;39m)\u001b[0m\u001b[39m, \u001b[0m          \n",
       "\u001b[2;36m                \u001b[0m         \u001b[33m_compute_identifier\u001b[0m\u001b[39m=<function Image.with_local_v2.<locals>.<lambda> at \u001b[0m\u001b[1;36m0x106642020\u001b[0m\u001b[1m>\u001b[0m\u001b[1m)\u001b[0m,                                                  \n",
       "\u001b[2;36m                \u001b[0m         \u001b[1;35mCommands\u001b[0m\u001b[1m(\u001b[0m\u001b[32m'--\u001b[0m\u001b[32mmount\u001b[0m\u001b[32m=\u001b[0m\u001b[32mtype\u001b[0m\u001b[32m=cache,\u001b[0m\u001b[32msharing\u001b[0m\u001b[32m=\u001b[0m\u001b[32mlocked\u001b[0m\u001b[32m,\u001b[0m\u001b[32mmode\u001b[0m\u001b[32m=\u001b[0m\u001b[32m0777\u001b[0m\u001b[32m,\u001b[0m\u001b[32mtarget\u001b[0m\u001b[32m=/root/.cache/uv,\u001b[0m\u001b[32mid\u001b[0m\u001b[32m=\u001b[0m\u001b[32muv\u001b[0m\u001b[32m --\u001b[0m\u001b[32mmount\u001b[0m\u001b[32m=\u001b[0m\u001b[32mfrom\u001b[0m\u001b[32m=uv,\u001b[0m\u001b[32msource\u001b[0m\u001b[32m=/uv,\u001b[0m\u001b[32mtarget\u001b[0m\u001b[32m=/usr/bin/uv \u001b[0m      \n",
       "\u001b[2;36m                \u001b[0m         \u001b[32m--\u001b[0m\u001b[32mmount\u001b[0m\u001b[32m=\u001b[0m\u001b[32msource\u001b[0m\u001b[32m=dist,\u001b[0m\u001b[32mtarget\u001b[0m\u001b[32m=/dist,\u001b[0m\u001b[32mtype\u001b[0m\u001b[32m=\u001b[0m\u001b[32mbind\u001b[0m\u001b[32m uv pip install --python $VIRTUALENV $\u001b[0m\u001b[32m(\u001b[0m\u001b[32mls /dist/*whl\u001b[0m\u001b[32m)\u001b[0m\u001b[32m'\u001b[0m\u001b[1m)\u001b[0m\u001b[1m)\u001b[0m\u001b[1m)\u001b[0m                                    \n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">09:07:01.272238 </span><span style=\"color: #000080; text-decoration-color: #000080\">INFO    </span> _deploy.py:<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">88</span> - Building image flyte for environment hello_world                                                                       \n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2;36m09:07:01.272238\u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO    \u001b[0m _deploy.py:\u001b[1;36m88\u001b[0m - Building image flyte for environment hello_world                                                                       \n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING: All log messages before absl::InitializeLog() is called are written to STDERR\n",
      "I0000 00:00:1749053221.292629 1652680 fork_posix.cc:75] Other threads are currently calling into gRPC, skipping fork() handlers\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">09:07:07.833418 </span><span style=\"color: #000080; text-decoration-color: #000080\">INFO    </span> image_builder.py:<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">196</span> - Image ghcr.io/unionai-oss/flyte:py3.<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">12</span>-v0.<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2.</span>0b4.dev6-g17ff4f7 already exists in registry. Skipping build.       \n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2;36m09:07:07.833418\u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO    \u001b[0m image_builder.py:\u001b[1;36m196\u001b[0m - Image ghcr.io/unionai-oss/flyte:py3.\u001b[1;36m12\u001b[0m-v0.\u001b[1;36m2.\u001b[0m0b4.dev6-g17ff4f7 already exists in registry. Skipping build.       \n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">09:07:07.840159 </span><span style=\"color: #000080; text-decoration-color: #000080\">INFO    </span> _deploy.py:<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">111</span> - Built Image for environment hello_world, image: ghcr.io/unionai-oss/flyte:py3.<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">12</span>-v0.<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2.</span>0b4.dev6-g17ff4f7               \n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2;36m09:07:07.840159\u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO    \u001b[0m _deploy.py:\u001b[1;36m111\u001b[0m - Built Image for environment hello_world, image: ghcr.io/unionai-oss/flyte:py3.\u001b[1;36m12\u001b[0m-v0.\u001b[1;36m2.\u001b[0m0b4.dev6-g17ff4f7               \n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "run = await flyte.run.aio(say_hello_nested, data=\"jupyter says hello 2!\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9a3a7993-9aff-41f2-b065-8124c98335ef",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "875e438219df4b25abc78c8a270663a8",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Output()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "await run.wait.aio()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "1e2adb85-c460-4344-b0a7-470a29d173cd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'wn6qmm897qs8nb9tmhwc'"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "run.name"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "dd2e7c45-3a6f-4050-844f-5175c831f8d1",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
