-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Add docs for special envs (#689)
- Loading branch information
Showing
4 changed files
with
66 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,38 +5,45 @@ Summary: Documentation for Dagu | |
Author-email: Yota Hamada <[email protected]> | ||
Requires-Python: >=3.11 | ||
Description-Content-Type: text/markdown | ||
License-File: LICENSE | ||
Requires-Dist: sphinx==5.3.0 | ||
Requires-Dist: sphinx-rtd-theme==2.0.0 | ||
Requires-Dist: sphinx-autobuild>=2024.4.16 | ||
Requires-Dist: sphinx-intl>=2.2.0 | ||
|
||
# Dagu Documentation | ||
|
||
This is the documentation for the Dagu project. | ||
|
||
## Prerequisites | ||
|
||
Make sure you have the following installed: | ||
|
||
- Python (version >= 3.11) | ||
- Rye | ||
- Python (version >= 3.11) | ||
- Rye | ||
|
||
## Getting Started | ||
|
||
1. Clone the repository: | ||
|
||
```sh | ||
git clone https://github.com/dagu-org/dagu.git | ||
``` | ||
|
||
2. Navigate to the document directory: | ||
|
||
```sh | ||
cd docs | ||
``` | ||
|
||
3. Install the project dependencies using Rye: | ||
|
||
```sh | ||
rye sync | ||
``` | ||
|
||
## Running Locally | ||
|
||
To run the documentation server locally, use the following command: | ||
|
||
```sh | ||
|
@@ -47,21 +54,25 @@ This will start the sphinx-autobuild server, which will watch for changes in the | |
Open your web browser and visit http://localhost:8000 to view the documentation. | ||
|
||
## Building the Documentation | ||
|
||
To build the documentation, use one of the following commands: | ||
|
||
- For English documentation: | ||
- For English documentation: | ||
|
||
```sh | ||
rye run build | ||
``` | ||
|
||
- For Japanese documentation: | ||
- For Japanese documentation: | ||
|
||
```sh | ||
rye run build-ja | ||
``` | ||
|
||
The built documentation will be available in the build/html directory. | ||
|
||
## Generating Gettext Files (Japanese) | ||
|
||
To generate the gettext files for Japanese translation, run: | ||
|
||
```shell | ||
|
@@ -76,23 +87,30 @@ We welcome contributions for adding new translations to the documentation. To ad | |
|
||
1. Create a new directory for the target language in the `source/locale` directory (e.g., `source/locale/fr` for French). | ||
2. Generate the gettext files for the target language by running: | ||
|
||
```shell | ||
sphinx-build -b gettext source/ build/locale | ||
make gettext | ||
sphinx-intl update -p build/gettext -l <language> | ||
``` | ||
3. Update the translation files in the source/locale/<language>/LC_MESSAGES directory. | ||
4. Build the documentation for the target language: | ||
|
||
Replace `<language>` with the appropriate language code (e.g., `fr` for French). 3. Update the translation files in the source/locale/<language>/LC_MESSAGES directory. 4. Build the documentation for the target language: | ||
|
||
```shell | ||
sphinx-build -b html -D language=<language> source/ build/html/<language> | ||
``` | ||
Replace `<language>` with the appropriate language code (e.g., `fr` for French). | ||
5. Submit a pull request with your changes. | ||
|
||
Replace `<language>` with the appropriate language code (e.g., `fr` for French). 5. Submit a pull request with your changes. | ||
|
||
See [Sphinx Internationalization](https://www.sphinx-doc.org/en/master/usage/advanced/intl.html) for more information on internationalization in Sphinx. | ||
|
||
## Dependencies | ||
|
||
The project dependencies are managed using Rye and specified in the `pyproject.toml` file. The main dependencies include: | ||
|
||
- Sphinx (version 5.3.0) | ||
- sphinx-rtd-theme (version 2.0.0) | ||
- sphinx-autobuild (version >= 2024.4.16) | ||
- Sphinx (version 5.3.0) | ||
- sphinx-rtd-theme (version 2.0.0) | ||
- sphinx-autobuild (version >= 2024.4.16) | ||
|
||
## Contributing | ||
|
||
We welcome contributions to improve the documentation. If you find any issues or have suggestions for enhancements, please feel free to open an issue or submit a pull request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
LICENSE | ||
README.md | ||
pyproject.toml | ||
docs.egg-info/PKG-INFO | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,7 @@ Quick Start | |
executors | ||
base_config | ||
examples | ||
special_env | ||
|
||
.. toctree:: | ||
:caption: Configuration | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
.. _Special Environment Variables: | ||
|
||
Special Environment Variables | ||
============================== | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Inside a DAG, you can use the following environment variables to access special values: | ||
|
||
- ``DAG_EXECUTION_LOG_PATH``: The path to the log file for the current step. | ||
- ``DAG_SCHEDULER_LOG_PATH``: The path to the log file for the scheduler. | ||
- ``DAG_REQUEST_ID``: The unique ID for the current execution request. | ||
|
||
Example Usage | ||
~~~~~~~~~~~~~ | ||
|
||
.. code-block:: yaml | ||
steps: | ||
- name: print values | ||
command: bash | ||
script: | | ||
echo DAG_EXECUTION_LOG_PATH=$DAG_EXECUTION_LOG_PATH | ||
echo DAG_SCHEDULER_LOG_PATH=$DAG_SCHEDULER_LOG_PATH | ||
echo DAG_REQUEST_ID=$DAG_REQUEST_ID | ||
**Example Output** | ||
|
||
.. code-block:: bash | ||
DAG_EXECUTION_LOG_PATH=/path/to/logs/special-envs/step1.20241001.22:31:29.167.0cf64f67.log | ||
DAG_SCHEDULER_LOG_PATH=/path/to/logs/special-envs/start_special-envs.20241001.22:31:29.163.0cf64f67.log | ||
DAG_REQUEST_ID=0cf64f67-a1d6-4764-b5e0-0ea92c3089e2 |