|
9 | 9 |
|
10 | 10 | ## Development Setup |
11 | 11 |
|
12 | | -1. Say Hi On The [Cylc Developers Chat](https://matrix.to/#/#cylc-general:matrix.org). |
| 12 | +#. **Say Hi On The [Cylc Developers Chat](https://matrix.to/#/#cylc-general:matrix.org)!** |
13 | 13 |
|
14 | | -2. Install System Dependencies: |
15 | 14 |
|
16 | | - > **Note**: We recommend developing in a Conda environment, although it |
17 | | - is possible, though less flexible, to install the required system |
18 | | - dependencies and work in Python virtual environments. |
| 15 | +#. **Install System Dependencies** |
19 | 16 |
|
20 | | - Use whatever Conda client you prefer, `micromamba` is the most performant. |
| 17 | + > [!NOTE] |
| 18 | + > We recommend developing in a Conda environment, although it |
| 19 | + > is possible, though less flexible, to install the required system |
| 20 | + > dependencies and work in Python virtual environments. |
| 21 | + > |
| 22 | + > Use whatever Conda client you prefer, `micromamba` is the most performant. |
21 | 23 |
|
22 | 24 | This command will give you a Conda environment containing all the things you |
23 | | - might need for Cylc development: |
| 25 | + might need for Cylc/Rose development: |
24 | 26 |
|
25 | 27 | ```bash |
26 | | - conda create -n cylc-dev python pip configurable-http-proxy graphviz nodejs yarn shellcheck |
| 28 | + conda create -y -n cylc-dev \ |
| 29 | + python \ |
| 30 | + pip \ |
| 31 | + configurable-http-proxy \ |
| 32 | + graphviz \ |
| 33 | + nodejs \ |
| 34 | + yarn \ |
| 35 | + shellcheck \ |
| 36 | + pygraphviz \ |
| 37 | + pygobject \ |
| 38 | + gtk3 |
27 | 39 | ``` |
28 | 40 |
|
29 | | - To ensure your Conda environment is automatically activated across a |
30 | | - distributed network, create a pair of activate/deactivate files: |
| 41 | + |
| 42 | +#. **Configure For Distributed Development** |
| 43 | + |
| 44 | + Follow these steps if you're running on a network with a shared filesystem. |
| 45 | + |
| 46 | + [Install the Cylc wrapper script](https://cylc.github.io/cylc-doc/stable/html/installation.html#managing-environments). |
| 47 | + |
| 48 | + > [!NOTE] |
| 49 | + > Your site may have already done this for you. |
| 50 | +
|
| 51 | + Then configure the path to your Conda environment directory in your shell |
| 52 | + profile file (e.g, `.bash_profile`), e.g: |
| 53 | + |
| 54 | + ```bash |
| 55 | + # ~/.bash_profile |
| 56 | + export CYLC_HOME_ROOT_ALT="/path/to/conda/environment/directory" |
| 57 | + ``` |
| 58 | + |
| 59 | + To locate your environment directory, run: |
| 60 | + |
| 61 | + ```bash |
| 62 | + conda activate cylc-dev |
| 63 | + dirname $CONDA_PREFIX |
| 64 | + ``` |
| 65 | + |
| 66 | + Then get Conda to set the `CYLC_ENV_NAME` environment variable automatically |
| 67 | + when you active the environment (this tells the wrapper script which Conda |
| 68 | + environment to use for remote command invocations): |
31 | 69 |
|
32 | 70 | ```console |
33 | 71 | $ conda activate cylc-dev |
34 | 72 | $ echo "export CYLC_ENV_NAME=$CONDA_DEFAULT_ENV" > $CONDA_PREFIX/etc/conda/activate.d/cylc.sh |
35 | 73 | $ echo 'unset CYLC_ENV_NAME' > $CONDA_PREFIX/etc/conda/deactivate.d/cylc.sh |
36 | 74 | ``` |
37 | 75 |
|
38 | | -3. Fork & Clone |
| 76 | + |
| 77 | +#. **Fork & Clone** |
39 | 78 |
|
40 | 79 | On GitHub, create a fork of any of the Cylc repositories you want to work |
41 | 80 | on and create a local clone of them |
42 | 81 | (i.e, `git clone git@github.com/<yourname>/<repo>.git`). |
43 | 82 |
|
44 | | - Please star https://github.com/cylc/cylc-flow and |
45 | | - https://github.com/metomi/rose/ :) |
| 83 | + Please star [cylc-flow](https://github.com/cylc/cylc-flow) and |
| 84 | + [metomi-rose](https://github.com/metomi/rose/) :) |
46 | 85 |
|
47 | 86 |
|
48 | | -4. Install Python Projects |
| 87 | +#. **Install Python Projects** |
49 | 88 |
|
50 | 89 | Install any Python projects you have just cloned into your Conda |
51 | 90 | environment. |
52 | | - > Note: `cylc-ui` is installed separately below via a different process. |
53 | 91 |
|
54 | 92 | Install [cylc/cylc-flow](https://github.com/cylc/cylc-flow/) and optionally: |
55 | 93 |
|
56 | | - * [cylc/cylc-uiserver](https://github.com/cylc/cylc-uiserver/) (for UIS work) |
| 94 | + * [cylc/cylc-uiserver](https://github.com/cylc/cylc-uiserver/) (for web server work) |
57 | 95 | * [metomi/rose](https://github.com/metomi/rose/) (for Rose work) |
58 | | - * [cylc/cylc-rose](https://github.com/cylc/cylc-rose/) (for Rose work) |
59 | | - * [cylc/cylc-doc](https://github.com/cylc/cylc-doc/) (for docs changes) |
60 | | - > Note: This requires all above repo sorties to be installed via: |
| 96 | + * [cylc/cylc-rose](https://github.com/cylc/cylc-rose/) (for Cylc / Rose integration) |
| 97 | + * [cylc/cylc-doc](https://github.com/cylc/cylc-doc/) (for Cylc docs changes) |
| 98 | + |
| 99 | + Install the `[all]` optional dependency to pick up test, developer and |
| 100 | + documentation extras, i.e: |
61 | 101 |
|
62 | 102 | ```bash |
63 | 103 | pip install -e "path/to/repo[all]" |
64 | 104 | ``` |
65 | | - Dependencies are best installed in this order to avoid conflicts: |
66 | | - * cylc-rose |
67 | | - * cylc-uiserver |
68 | | - * cylc-flow |
69 | | - * rose |
70 | | - * cylc-doc |
71 | | - |
72 | | - > Note: For a fuller description see [project dependencies](#project-dependencies) |
73 | | -
|
74 | | - You only need to repeat this `pip install` command when certain project |
75 | | - files are modified: |
76 | | - * `setup.py` |
77 | | - * `setup.cfg` |
78 | | - * `pyproject.toml` |
79 | | - * `MANIFEST.in` |
80 | | - > Note: You can use `uv pip` as a stand-in for `pip`. |
81 | | -
|
82 | | -5. Install and configure [cylc/cylc-ui](https://github.com/cylc/cylc-ui/) (optional) |
| 105 | + |
| 106 | + When doing this for the first time it's better to install them all in one |
| 107 | + go, e.g: |
| 108 | + |
| 109 | + ```bash |
| 110 | + pip install -e ./cylc-flow[all] \ |
| 111 | + -e ./cylc-uiserver[all] \ |
| 112 | + -e ./rose[all] \ |
| 113 | + -e ./cylc-rose[all] \ |
| 114 | + -e ./cylc-doc[all] |
| 115 | + ``` |
| 116 | + |
| 117 | + > [!NOTE] |
| 118 | + > There are dependencies between projects, so they may need to be installed |
| 119 | + > in order, see [project dependencies](#project-dependencies) |
| 120 | +
|
| 121 | + > [!NOTE] |
| 122 | + > Installing in "editable" mode (the `-e` above) means you only need to |
| 123 | + > repeat this `pip install` command when certain project files are modified: |
| 124 | + > * `setup.py` |
| 125 | + > * `setup.cfg` |
| 126 | + > * `pyproject.toml` |
| 127 | + > * `MANIFEST.in` |
| 128 | +
|
| 129 | + > [!NOTE] |
| 130 | + > You can use `uv pip` as a stand-in for `pip`. |
| 131 | +
|
| 132 | + |
| 133 | +#. **Install and configure [cylc/cylc-ui](https://github.com/cylc/cylc-ui/) (optional)** |
83 | 134 |
|
84 | 135 | ```bash |
85 | 136 | cd path/to/cylc-ui |
86 | 137 | conda activate cylc-dev |
87 | 138 | yarn install |
88 | | - yarn run build # create your first build |
| 139 | + yarn run build # create your first production build |
89 | 140 | ``` |
90 | 141 |
|
91 | 142 | The Cylc UI Server comes with a bundled version of Cylc UI. To use your |
92 | 143 | personal build add the following to your Jupyter configuration: |
93 | 144 |
|
94 | 145 | ```python |
95 | 146 | # ~/.cylc/hub/jupyter_config.py |
| 147 | + # NOTE: some of us use an environment variable to toggle this on/off |
96 | 148 | c.CylcUIServer.ui_build_dir = '~/cylc-ui/dist' # path to build |
97 | 149 | ``` |
98 | 150 |
|
|
115 | 167 | # done so before. |
116 | 168 | ``` |
117 | 169 |
|
118 | | -6. Contributor License Agreement |
| 170 | + |
| 171 | +#. **Contributor License Agreement** |
119 | 172 |
|
120 | 173 | Read the `CONTRIBUTING.md` file and add your name to it with your first |
121 | 174 | commit. |
|
127 | 180 | ## Running Your First Workflow |
128 | 181 |
|
129 | 182 | ```bash |
| 183 | +conda acitvate cylc-dev |
| 184 | + |
130 | 185 | # clone the workflow into ~/cylc-src |
131 | 186 | cylc get-resources tutorial/cylc-forecasting-workflow |
132 | 187 |
|
@@ -183,16 +238,18 @@ The currently supported (i.e. actively developed) versions are documented |
183 | 238 |
|
184 | 239 | ### Project Dependencies |
185 | 240 |
|
| 241 | +There are dependencies between our projects, here's a summary: |
| 242 | + |
186 | 243 | <pre class="mermaid"> |
187 | 244 | --- |
188 | 245 | config: |
189 | 246 | look: handDrawn |
190 | 247 | --- |
191 | | -flowchart RL |
192 | | - rose -->|requires| isodatetime["metomi/isodatetime"] |
193 | | - CR[cylc-rose] -->|requires| CF[cylc-flow] |
194 | | - CR -->|requires| rose["metomi/rose"] |
195 | | - uis[cylc uiserver] -->|requires| CF |
196 | | - uis .->|bundles| ui["cylc ui (JavaScript)"] |
197 | | - |
| 248 | +flowchart LR |
| 249 | + isodatetime --> rose |
| 250 | + isodatetime --> cylc-flow |
| 251 | + rose --> cylc-rose |
| 252 | + cylc-flow --> cylc-rose |
| 253 | + cylc-flow --> cylc-uiserver |
| 254 | + cylc-ui -->|bundled| cylc-uiserver |
198 | 255 | </pre> |
0 commit comments