You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: each cluster has its own compose cache
* fix: use multipe cluster caches
* fix: store a cache obj
* fix: use the dirname of the cache loc
* fix: log cache obj
* refactor: extra constant for cache config
* fix: shorten the composeProject name after isolation
* fix: simplify command cache handling
* test: fix tests
* docs: fix desc for changed arg
* chore: new yarn.lock file after master was merged in
* feat: allow cluster configuration to be stored in ~/.config/d2/config.js
* docs: update readme for cluster
* docs: update readme
* docs: fix broken syntax
* refactor: break up path and clean up imports
* refactor: clean up imports
* docs: add note about config order
* chore: add repo config files
* refactor: address pr comments
* refactor: prefix docker-compose projects
* refactor: rearrange noop change
* chore: correct log variable
@@ -19,21 +19,298 @@ While you can install and run `d2-cluster` from `@dhis2/cli-cluster`, the prefer
19
19
20
20
Depending on your installation method, the following examples which use `d2 cluster` may need to be modified to use `d2-cluster`, or `npx @dhis2/cli-cluster`.
21
21
22
-
## Spin up a development cluster
22
+
## Common concepts
23
23
24
-
This sequence of commands will install the latest bleeding-edge DHIS2 core instance in a Docker container and seed it with the relevant Sierra Leone [demo database](https://github.com/dhis2/dhis2-demo-db/)
24
+
### Release channels
25
25
26
-
```sh
27
-
> d2 cluster up dev --seed
28
-
> d2 cluster logs dev core
29
-
# Wait for the line "Catalina.start Server startup in XXXX ms", then ctrl+c / cmd+c to terminate
30
-
> d2 cluster restart dev gateway # this is a hack necessary to rehup the gateway
31
-
# DHIS2 is available with Sierra Leone db at http://localhost:8080
32
-
# Run the Analytics Table export task from the Data Administration app
26
+
DHIS2 has several release channels, such as **dev** and **stable**.
27
+
28
+
To each channel several artifacts can be published, so the **stable**
29
+
channel contains all the stable releases of DHIS2, such as 2.32.0,
30
+
2.32.1, etc.
31
+
32
+
The **dev** channel is the latest build straight from the development
33
+
branches. There is one development branch per supported release of
34
+
DHIS2.
35
+
36
+
For our Docker images, that means that we have one repo on Docker Hub
There are two arguments that are always required for the `cluster` to
86
+
command to be able to do anything at all: `{command}` and `{name}`.
87
+
88
+
```bash
89
+
d2 cluster {command} {name}
33
90
```
34
91
35
-
Note that any Docker image in [amcgee/dhis2-core](https://cloud.docker.com/u/amcgee/repository/docker/amcgee/dhis2-core) can be used, just omit the `-alpine` suffix. Sierra Leone demo databases are automatically downloaded from the [dhis2-demo-db](https://github.com/dhis2/dhis2-demo-db) repository.
92
+
The command refers to an action, like `up` or `down` and the name is the
93
+
name of the cluster to operate on, which can be anything you like, like
94
+
`mydev`, `superfly`, or `2.32`.
95
+
96
+
### Arguments
97
+
98
+
In addition to the command and name, there are more arguments you can
99
+
pass to `cluster` to customize your environment. If the arguments are
100
+
omitted there is some fallback logic, so even if they are not used, they
101
+
are important to know about.
102
+
103
+
-`--channel`: This matches to the Docker Hub repository mentioned above
104
+
in [Release channels](#release-channels). E.g. `dev`.
105
+
106
+
-`--dhis2-version`: This matches to the [tag name within a Docker
From here it's possible to override the configuration file properties
305
+
for a cluster as well:
306
+
307
+
```
308
+
# port is 9999 in ~/.config/d2/config.js:clusters.superfly.port
309
+
d2 cluster up superfly --port 8888
310
+
311
+
# port is saved as 8888 in ~/.cache/d2/cache/cluster/superfly/config.json:port
312
+
```
38
313
39
-
- The 2.31 patch releases (2.31.0, 2.31.1, etc.) are nested, so they cannot be downloaded automatically. You can download any .sql.gz file manually and specify it with the `--seedFile` option to the `d2 cluster up` command or the `--path` option to the `d2 cluster seed` command.
314
+
Now for each subsequence `down` and `up` command, the cached config will
315
+
take priority over the persistent configuration. When you clear the
316
+
cache, the persistent configuration will come into effect again.
0 commit comments